aboutsummaryrefslogtreecommitdiffstats
path: root/feature-distributed-locking/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-06-18 14:40:05 -0400
committerJim Hahn <jrh3@att.com>2018-06-18 16:40:56 -0400
commitfd7593078cddbed63a8c68bc8f6352283a3fb849 (patch)
tree410c9bacff7f2b30a87a46804cd4e20c4b11396e /feature-distributed-locking/src
parentb706707b5f209f0b7332ecec3a949ac03e7016b9 (diff)
Add setXxx methods for @Property annotation
We'll be modifying the PropertyConfiguration class so that, instead of directly setting values in private fields, it will use public setXxx methods. Consequently, we have to add the setXxx methods to the PropertyConfiguration subclasses so that they're available when the superclass is modified policy/common. Change-Id: Idff9942eabec182670cbb427b960f6308a2ca30c Issue-ID: POLICY-906 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-distributed-locking/src')
-rw-r--r--feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingProperties.java111
1 files changed, 70 insertions, 41 deletions
diff --git a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingProperties.java b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingProperties.java
index 97ba3b10..b82f4b00 100644
--- a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingProperties.java
+++ b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingProperties.java
@@ -20,26 +20,25 @@
package org.onap.policy.distributed.locking;
import java.util.Properties;
-
import org.onap.policy.common.utils.properties.PropertyConfiguration;
import org.onap.policy.common.utils.properties.exception.PropertyException;
-public class DistributedLockingProperties extends PropertyConfiguration{
-
- /**
+public class DistributedLockingProperties extends PropertyConfiguration {
+
+ /**
* Feature properties all begin with this prefix.
*/
public static final String PREFIX = "distributed.locking.";
-
- public static final String DB_DRIVER = "javax.persistence.jdbc.driver";
- public static final String DB_URL = "javax.persistence.jdbc.url";
- public static final String DB_USER = "javax.persistence.jdbc.user";
- public static final String DB_PWD = "javax.persistence.jdbc.password";
- public static final String AGING_PROPERTY = PREFIX + "lock.aging";
- public static final String HEARTBEAT_INTERVAL_PROPERTY = PREFIX + "heartbeat.interval";
-
- /**
+
+ public static final String DB_DRIVER = "javax.persistence.jdbc.driver";
+ public static final String DB_URL = "javax.persistence.jdbc.url";
+ public static final String DB_USER = "javax.persistence.jdbc.user";
+ public static final String DB_PWD = "javax.persistence.jdbc.password";
+ public static final String AGING_PROPERTY = PREFIX + "lock.aging";
+ public static final String HEARTBEAT_INTERVAL_PROPERTY = PREFIX + "heartbeat.interval";
+
+ /**
* Properties from which this was constructed.
*/
private Properties source;
@@ -49,31 +48,31 @@ public class DistributedLockingProperties extends PropertyConfiguration{
*/
@Property(name = DB_DRIVER)
private String dbDriver;
-
+
/**
* Database url
*/
@Property(name = DB_URL)
private String dbUrl;
-
+
/**
* Database user
*/
@Property(name = DB_USER)
private String dbUser;
-
+
/**
* Database password
*/
@Property(name = DB_PWD)
private String dbPwd;
-
+
/**
* Used to set expiration time for lock.
*/
@Property(name = AGING_PROPERTY, defaultValue = "300000")
private long agingProperty;
-
+
/**
* Indicates intervals at which we refresh locks.
*/
@@ -81,43 +80,73 @@ public class DistributedLockingProperties extends PropertyConfiguration{
private long heartBeatIntervalProperty;
public DistributedLockingProperties(Properties props) throws PropertyException {
- super(props);
- source = props;
+ super(props);
+ source = props;
+ }
+
+
+ public Properties getSource() {
+ return source;
+ }
+
+
+ public String getDbDriver() {
+ return dbDriver;
+ }
+
+
+ public String getDbUrl() {
+ return dbUrl;
+ }
+
+
+ public String getDbUser() {
+ return dbUser;
+ }
+
+
+ public String getDbPwd() {
+ return dbPwd;
+ }
+
+
+ public long getAgingProperty() {
+ return agingProperty;
}
- public Properties getSource() {
- return source;
- }
+ public long getHeartBeatIntervalProperty() {
+ return heartBeatIntervalProperty;
+ }
- public String getDbDriver() {
- return dbDriver;
- }
+ public void setDbDriver(String dbDriver) {
+ this.dbDriver = dbDriver;
+ }
- public String getDbUrl() {
- return dbUrl;
- }
+ public void setDbUrl(String dbUrl) {
+ this.dbUrl = dbUrl;
+ }
- public String getDbUser() {
- return dbUser;
- }
+ public void setDbUser(String dbUser) {
+ this.dbUser = dbUser;
+ }
- public String getDbPwd() {
- return dbPwd;
- }
+ public void setDbPwd(String dbPwd) {
+ this.dbPwd = dbPwd;
+ }
- public long getAgingProperty() {
- return agingProperty;
- }
+ public void setAgingProperty(long agingProperty) {
+ this.agingProperty = agingProperty;
+ }
- public long getHeartBeatIntervalProperty() {
- return heartBeatIntervalProperty;
- }
+ public void setHeartBeatIntervalProperty(long heartBeatIntervalProperty) {
+ this.heartBeatIntervalProperty = heartBeatIntervalProperty;
+ }
}