aboutsummaryrefslogtreecommitdiffstats
path: root/feature-pooling-dmaap/src/main/java/org
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-pooling-dmaap/src/main/java/org
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-pooling-dmaap/src/main/java/org')
-rw-r--r--feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingFeature.java4
-rw-r--r--feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingProperties.java43
2 files changed, 45 insertions, 2 deletions
diff --git a/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingFeature.java b/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingFeature.java
index 67cb21ee..d42b8de1 100644
--- a/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingFeature.java
+++ b/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingFeature.java
@@ -149,7 +149,9 @@ public class PoolingFeature implements PolicyEngineFeatureAPI, PolicyControllerF
String name = controller.getName();
- if (FeatureEnabledChecker.isFeatureEnabled(featProps, name, PoolingProperties.FEATURE_ENABLED)) {
+ SpecProperties specProps = new SpecProperties(PoolingProperties.PREFIX, name, featProps);
+
+ if (FeatureEnabledChecker.isFeatureEnabled(specProps, PoolingProperties.FEATURE_ENABLED)) {
try {
// get & validate the properties
PoolingProperties props = new PoolingProperties(name, featProps);
diff --git a/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingProperties.java b/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingProperties.java
index 54319423..ad118727 100644
--- a/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingProperties.java
+++ b/feature-pooling-dmaap/src/main/java/org/onap/policy/drools/pooling/PoolingProperties.java
@@ -38,6 +38,12 @@ public class PoolingProperties extends SpecPropertyConfiguration {
* Feature properties all begin with this prefix.
*/
public static final String PREFIX = "pooling.";
+
+ /*
+ * These properties are not used by a SpecPropertyConfiguration, thus
+ * they do not use any of the "{xxx}" forms.
+ */
+ public static final String FEATURE_ENABLED = PREFIX + "enabled";
/*
* These properties REQUIRE a controller name, thus they use the "{$}" form.
@@ -48,7 +54,6 @@ public class PoolingProperties extends SpecPropertyConfiguration {
* These properties allow the controller name to be left out, thus they use
* the "{prefix?suffix}" form.
*/
- public static final String FEATURE_ENABLED = PREFIX + "{?.}enabled";
public static final String OFFLINE_LIMIT = PREFIX + "{?.}offline.queue.limit";
public static final String OFFLINE_AGE_MS = PREFIX + "{?.}offline.queue.age.milliseconds";
public static final String OFFLINE_PUB_WAIT_MS = PREFIX + "{?.}offline.publish.wait.milliseconds";
@@ -186,4 +191,40 @@ public class PoolingProperties extends SpecPropertyConfiguration {
public long getInterHeartbeatMs() {
return interHeartbeatMs;
}
+
+ public void setPoolingTopic(String poolingTopic) {
+ this.poolingTopic = poolingTopic;
+ }
+
+ public void setOfflineLimit(int offlineLimit) {
+ this.offlineLimit = offlineLimit;
+ }
+
+ public void setOfflineAgeMs(long offlineAgeMs) {
+ this.offlineAgeMs = offlineAgeMs;
+ }
+
+ public void setOfflinePubWaitMs(long offlinePubWaitMs) {
+ this.offlinePubWaitMs = offlinePubWaitMs;
+ }
+
+ public void setStartHeartbeatMs(long startHeartbeatMs) {
+ this.startHeartbeatMs = startHeartbeatMs;
+ }
+
+ public void setReactivateMs(long reactivateMs) {
+ this.reactivateMs = reactivateMs;
+ }
+
+ public void setIdentificationMs(long identificationMs) {
+ this.identificationMs = identificationMs;
+ }
+
+ public void setActiveHeartbeatMs(long activeHeartbeatMs) {
+ this.activeHeartbeatMs = activeHeartbeatMs;
+ }
+
+ public void setInterHeartbeatMs(long interHeartbeatMs) {
+ this.interHeartbeatMs = interHeartbeatMs;
+ }
}