00db573376652c42055d2e3f10e88af441295921
[policy/drools-pdp.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * feature-distributed-locking
4  * ================================================================================
5  * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.distributed.locking;
22
23 import java.util.Properties;
24 import org.onap.policy.common.utils.properties.PropertyConfiguration;
25 import org.onap.policy.common.utils.properties.exception.PropertyException;
26
27
28 public class DistributedLockingProperties extends PropertyConfiguration {
29
30     /**
31      * Feature properties all begin with this prefix.
32      */
33     public static final String PREFIX = "distributed.locking.";
34
35     public static final String DB_DRIVER = "javax.persistence.jdbc.driver";
36     public static final String DB_URL = "javax.persistence.jdbc.url";
37     public static final String DB_USER = "javax.persistence.jdbc.user";
38     public static final String DB_PWD = "javax.persistence.jdbc.password";
39
40     /**
41      * Properties from which this was constructed.
42      */
43     private Properties source;
44
45     /**
46      * Database driver.
47      */
48     @Property(name = DB_DRIVER)
49     private String dbDriver;
50
51     /**
52      * Database url.
53      */
54     @Property(name = DB_URL)
55     private String dbUrl;
56
57     /**
58      * Database user.
59      */
60     @Property(name = DB_USER)
61     private String dbUser;
62
63     /**
64      * Database password.
65      */
66     @Property(name = DB_PWD)
67     private String dbPwd;
68
69     public DistributedLockingProperties(Properties props) throws PropertyException {
70         super(props);
71         source = props;
72     }
73
74
75     public Properties getSource() {
76         return source;
77     }
78
79
80     public String getDbDriver() {
81         return dbDriver;
82     }
83
84
85     public String getDbUrl() {
86         return dbUrl;
87     }
88
89
90     public String getDbUser() {
91         return dbUser;
92     }
93
94
95     public String getDbPwd() {
96         return dbPwd;
97     }
98
99
100     public void setDbDriver(String dbDriver) {
101         this.dbDriver = dbDriver;
102     }
103
104
105     public void setDbUrl(String dbUrl) {
106         this.dbUrl = dbUrl;
107     }
108
109
110     public void setDbUser(String dbUser) {
111         this.dbUser = dbUser;
112     }
113
114
115     public void setDbPwd(String dbPwd) {
116         this.dbPwd = dbPwd;
117     }
118
119 }