summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-29 11:38:28 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-29 11:48:38 +0800
commit954440d0acc132151df7f828e2c63606f2ba9cdf (patch)
treed316c38376b2d86d3b0c675ff6998f0336ad45b4
parentb6e1b12ee06a03b4faff592df9644575d9fb58c3 (diff)
Add the CL Name to the Cache when Starting Up
Change-Id: I6a21707cf0475fa42aaf416088663c9f99af5a71 Issue-ID: HOLMES-82 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java2
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java2
-rw-r--r--engine-d/src/test/java/org/onap/holmes/engine/manager/DroolsEngineTest.java2
3 files changed, 5 insertions, 1 deletions
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java
index 52f3915..37b39c0 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java
@@ -41,7 +41,7 @@ public class DMaaPAlarmPolling implements Runnable {
try {
vesAlarmList = subscriber.subscribe();
} catch (CorrelationException e) {
- log.error("Failed polling request alarm." + e.getMessage());
+ log.error("Failed polling request alarm. " + e.getMessage());
}
vesAlarmList.forEach(vesAlarm -> droolsEngine.putRaisedIntoStream(vesAlarm));
}
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java b/engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java
index 5ccf29b..2ecea5e 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java
@@ -38,6 +38,7 @@ import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.rule.FactHandle;
import org.jvnet.hk2.annotations.Service;
import org.onap.holmes.common.api.stat.VesAlarm;
+import org.onap.holmes.common.dmaap.DmaapService;
import org.onap.holmes.engine.request.DeployRuleRequest;
import org.onap.holmes.common.api.entity.CorrelationRule;
import org.onap.holmes.common.exception.CorrelationException;
@@ -101,6 +102,7 @@ public class DroolsEngine {
for (CorrelationRule rule : rules) {
if (rule.getContent() != null) {
deployRuleFromDB(rule.getContent());
+ DmaapService.loopControlNames.put(rule.getPackageName(), rule.getClosedControlLoopName());
}
}
}
diff --git a/engine-d/src/test/java/org/onap/holmes/engine/manager/DroolsEngineTest.java b/engine-d/src/test/java/org/onap/holmes/engine/manager/DroolsEngineTest.java
index b57fa30..dd0b55d 100644
--- a/engine-d/src/test/java/org/onap/holmes/engine/manager/DroolsEngineTest.java
+++ b/engine-d/src/test/java/org/onap/holmes/engine/manager/DroolsEngineTest.java
@@ -88,6 +88,8 @@ public class DroolsEngineTest {
List<CorrelationRule> rules = new ArrayList<CorrelationRule>();
CorrelationRule rule = new CorrelationRule();
rule.setContent("content");
+ rule.setClosedControlLoopName("test");
+ rule.setPackageName("org.onap.holmes");
rules.add(rule);
expect(ruleMgtWrapper.queryRuleByEnable(anyInt())).andReturn(rules);