KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > jtrac > domain > Config


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package info.jtrac.domain;
18
19 import java.io.Serializable JavaDoc;
20 import java.util.LinkedHashSet JavaDoc;
21 import java.util.Set JavaDoc;
22
23 /**
24  * Simple name value pair to hold configuration parameters
25  * in the database for JTrac, e.g. SMTP e-mail server, etc.
26  */

27 public class Config implements Serializable JavaDoc {
28     
29     private String JavaDoc param; // someone reported that "key" is a reserved word in MySQL
30
private String JavaDoc value;
31
32     private static final Set JavaDoc<String JavaDoc> params;
33     
34     // set up a static set of valid config key names
35
static {
36         params = new LinkedHashSet JavaDoc<String JavaDoc>();
37         params.add("mail.server.host");
38         params.add("mail.server.port");
39         params.add("mail.server.username");
40         params.add("mail.server.password");
41         params.add("mail.server.starttls.enable");
42         params.add("mail.subject.prefix");
43         params.add("mail.from");
44         params.add("jtrac.url.base");
45         params.add("locale.default");
46     }
47     
48     public static Set JavaDoc<String JavaDoc> getParams() {
49         return params;
50     }
51     
52     public Config() {
53         // zero arg constructor
54
}
55     
56     public Config(String JavaDoc param, String JavaDoc value) {
57         this.param = param;
58         this.value = value;
59     }
60     
61     public String JavaDoc getParam() {
62         return param;
63     }
64
65     public void setParam(String JavaDoc param) {
66         this.param = param;
67     }
68
69     public String JavaDoc getValue() {
70         return value;
71     }
72
73     public void setValue(String JavaDoc value) {
74         this.value = value;
75     }
76     
77 }
78
Popular Tags