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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.distributed.locking;
23 import java.util.Properties;
24 import org.onap.policy.common.utils.properties.BeanConfigurator;
25 import org.onap.policy.common.utils.properties.Property;
26 import org.onap.policy.common.utils.properties.exception.PropertyException;
29 public class DistributedLockingProperties {
32 * Feature properties all begin with this prefix.
34 public static final String PREFIX = "distributed.locking.";
36 public static final String DB_DRIVER = "javax.persistence.jdbc.driver";
37 public static final String DB_URL = "javax.persistence.jdbc.url";
38 public static final String DB_USER = "javax.persistence.jdbc.user";
39 public static final String DB_PWD = "javax.persistence.jdbc.password";
42 * Properties from which this was constructed.
44 private final Properties source;
49 @Property(name = DB_DRIVER)
50 private String dbDriver;
55 @Property(name = DB_URL)
61 @Property(name = DB_USER)
62 private String dbUser;
67 @Property(name = DB_PWD)
71 * Constructs the object, populating fields from the properties.
73 * @param props properties from which to configure this
74 * @throws PropertyException if an error occurs
76 public DistributedLockingProperties(Properties props) throws PropertyException {
79 new BeanConfigurator().configureFromProperties(this, props);
83 public Properties getSource() {
88 public String getDbDriver() {
93 public String getDbUrl() {
98 public String getDbUser() {
103 public String getDbPwd() {
108 public void setDbDriver(String dbDriver) {
109 this.dbDriver = dbDriver;
113 public void setDbUrl(String dbUrl) {
118 public void setDbUser(String dbUser) {
119 this.dbUser = dbUser;
123 public void setDbPwd(String dbPwd) {