1 package tinlizard.model;
2
3 import tinlizard.dao.MashDao;
4 import tinlizard.dao.ScmDao;
5
6 import java.text.ParseException;
7 import java.text.SimpleDateFormat;
8 import java.util.Date;
9 import java.util.Properties;
10
11 /***
12 * Holds the Configuration of TinLizard.
13 */
14 public final class TinLizardConfig implements TinLizardConfigMBean {
15 private static final String DATE_FORMAT = "yyyyMMddHHmmss";
16
17 /*** The Plexus role identifier. */
18 public static final String ROLE = TinLizardConfig.class.getName();
19 private ScmDao scmDao;
20 private MashDao mashDao;
21 private String indexOnStartup;
22 private Properties jpaProperties;
23 private String version;
24 private Date lastModified;
25 private Date created;
26
27 public TinLizardConfig() {
28 }
29
30 public MashDao getMashDao() {
31 return mashDao;
32 }
33
34 public void setMashDao(final MashDao mashDao) {
35 this.mashDao = mashDao;
36 }
37
38 public ScmDao getScmDao() {
39 return scmDao;
40 }
41
42 public void setScmDao(final ScmDao scmDao) {
43 this.scmDao = scmDao;
44 }
45
46 public boolean isIndexOnStartUp() {
47 return Boolean.valueOf(indexOnStartup);
48 }
49
50 public String getIndexOnStartUp() {
51 return indexOnStartup;
52 }
53
54 public void setIndexOnStartup(final String indexOnStartup) {
55 this.indexOnStartup = indexOnStartup;
56 }
57
58 public Properties getJpaProperties() {
59 return jpaProperties;
60 }
61
62 public void setJpaProperties(final Properties jpaProperties) {
63 this.jpaProperties = jpaProperties;
64 }
65
66 public String getVersion() {
67 return version;
68 }
69
70 public void setVersion(final String version) {
71 this.version = version;
72 }
73
74 public Date getLastModified() {
75 return lastModified;
76 }
77
78 public void setLastModified(final String lastModifiedStr) throws ParseException {
79 SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT);
80 this.lastModified = format.parse(lastModifiedStr);
81 }
82
83 public Date getCreated() {
84 return created;
85 }
86
87 public void setCreated(final String createdStr) throws ParseException {
88 SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT);
89 this.created = format.parse(createdStr);
90 }
91 }