summaryrefslogtreecommitdiffstats
path: root/engine-d/src/main/java/org/onap/holmes/engine/dmaappolling/SubscriberAction.java
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-14 16:38:26 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-14 17:38:54 +0800
commit530fcc3970550c2ddbe62f51c59b9705cbaa244b (patch)
treead6b1be923651fb7952b692781ca5a77b116a39a /engine-d/src/main/java/org/onap/holmes/engine/dmaappolling/SubscriberAction.java
parente540d3894d2f662a843e5c51535d44b876b9889f (diff)
Add DMaaP Configuration APIs for Testing
Change-Id: I4f2d75ba8148f3118a731d0b2d68f13c6b941bb0 Issue-ID: HOLMES-59 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'engine-d/src/main/java/org/onap/holmes/engine/dmaappolling/SubscriberAction.java')
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/dmaappolling/SubscriberAction.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/dmaappolling/SubscriberAction.java b/engine-d/src/main/java/org/onap/holmes/engine/dmaappolling/SubscriberAction.java
index ef585d5..da83683 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/dmaappolling/SubscriberAction.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/dmaappolling/SubscriberAction.java
@@ -35,19 +35,19 @@ public class SubscriberAction {
private ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
public void addSubscriber(Subscriber subscriber) {
- if (!pollingRequests.containsKey(subscriber.getUrl())) {
+ if (!pollingRequests.containsKey(subscriber.getTopic())) {
DMaaPPollingRequest pollingTask = new DMaaPPollingRequest(subscriber, droolsEngine);
ScheduledFuture future = service
.scheduleAtFixedRate(pollingTask, 0, subscriber.getPeriod(), TimeUnit.MILLISECONDS);
- pollingRequests.put(subscriber.getUrl(), future);
+ pollingRequests.put(subscriber.getTopic(), future);
}
}
public void removeSubscriber(Subscriber subscriber) {
- ScheduledFuture future = pollingRequests.get(subscriber.getUrl());
+ ScheduledFuture future = pollingRequests.get(subscriber.getTopic());
if (future != null) {
future.cancel(true);
}
- pollingRequests.remove(subscriber.getUrl());
+ pollingRequests.remove(subscriber.getTopic());
}
}