001 package tinlizard.model; 002 003 import tinlizard.dao.MashDao; 004 import tinlizard.dao.ScmDao; 005 006 import java.text.ParseException; 007 import java.text.SimpleDateFormat; 008 import java.util.Date; 009 import java.util.Properties; 010 011 /** 012 * Holds the Configuration of TinLizard. 013 */ 014 public final class TinLizardConfig implements TinLizardConfigMBean { 015 private static final String DATE_FORMAT = "yyyyMMddHHmmss"; 016 017 /** The Plexus role identifier. */ 018 public static final String ROLE = TinLizardConfig.class.getName(); 019 private ScmDao scmDao; 020 private MashDao mashDao; 021 private String indexOnStartup; 022 private Properties jpaProperties; 023 private String version; 024 private Date lastModified; 025 private Date created; 026 027 public TinLizardConfig() { 028 } 029 030 public MashDao getMashDao() { 031 return mashDao; 032 } 033 034 public void setMashDao(final MashDao mashDao) { 035 this.mashDao = mashDao; 036 } 037 038 public ScmDao getScmDao() { 039 return scmDao; 040 } 041 042 public void setScmDao(final ScmDao scmDao) { 043 this.scmDao = scmDao; 044 } 045 046 public boolean isIndexOnStartUp() { 047 return Boolean.valueOf(indexOnStartup); 048 } 049 050 public String getIndexOnStartUp() { 051 return indexOnStartup; 052 } 053 054 public void setIndexOnStartup(final String indexOnStartup) { 055 this.indexOnStartup = indexOnStartup; 056 } 057 058 public Properties getJpaProperties() { 059 return jpaProperties; 060 } 061 062 public void setJpaProperties(final Properties jpaProperties) { 063 this.jpaProperties = jpaProperties; 064 } 065 066 public String getVersion() { 067 return version; 068 } 069 070 public void setVersion(final String version) { 071 this.version = version; 072 } 073 074 public Date getLastModified() { 075 return lastModified; 076 } 077 078 public void setLastModified(final String lastModifiedStr) throws ParseException { 079 SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT); 080 this.lastModified = format.parse(lastModifiedStr); 081 } 082 083 public Date getCreated() { 084 return created; 085 } 086 087 public void setCreated(final String createdStr) throws ParseException { 088 SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT); 089 this.created = format.parse(createdStr); 090 } 091 }