summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper
diff options
context:
space:
mode:
authorShiwei Tian <tian.shiwei@zte.com.cn>2017-10-14 11:06:27 +0800
committerShiwei Tian <tian.shiwei@zte.com.cn>2017-10-14 11:06:27 +0800
commit049c1722681a7c0d564d625f2740cbc47c15a4be (patch)
tree505dee221b1fb2236cec3e9f754b7bc59c48b2cb /rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper
parent646a660b1a7828013006619b4f7ec2d2f2f02f36 (diff)
modify control loop name
Issue-ID: HOLMES-67 Change-Id: Ifa7f463855d598350c81c2aa82cce254dccba213 Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
Diffstat (limited to 'rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java
index 5c2a428..c1f1917 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java
@@ -73,9 +73,7 @@ public class RuleMgtWrapper {
if (ruleTemp != null) {
throw new CorrelationException("A rule with the same name already exists.");
}
-
- String packageName = deployRule2Engine(correlationRule);
- DmaapService.loopControlNames.put(packageName, ruleCreateRequest.getLoopControlName());
+ String packageName = deployRule2Engine(correlationRule, ruleCreateRequest.getLoopControlName());
correlationRule.setPackageName(packageName);
CorrelationRule result = null;
try {
@@ -206,6 +204,15 @@ public class RuleMgtWrapper {
return "";
}
+ private String deployRule2Engine(CorrelationRule correlationRule, String loopControlName)
+ throws CorrelationException {
+ if (engineWarpper.checkRuleFromEngine(correlationRules2CheckRule(correlationRule)) && (
+ correlationRule.getEnabled() == RuleMgtConstant.STATUS_RULE_OPEN)) {
+ return engineWarpper.deployEngine(correlationRules2DeployRule(correlationRule, loopControlName));
+ }
+ return "";
+ }
+
public RuleQueryListResponse getCorrelationRuleByCondition(
RuleQueryCondition ruleQueryCondition) throws CorrelationException {
List<CorrelationRule> correlationRule = correlationRuleQueryDao
@@ -245,6 +252,15 @@ public class RuleMgtWrapper {
return correlationDeployRule4Engine;
}
+ private CorrelationDeployRule4Engine correlationRules2DeployRule(
+ CorrelationRule correlationRule, String loopControlName) {
+ CorrelationDeployRule4Engine correlationDeployRule4Engine = new CorrelationDeployRule4Engine();
+ correlationDeployRule4Engine.setContent(correlationRule.getContent());
+ correlationDeployRule4Engine.setEngineId(correlationRule.getEngineID());
+ correlationDeployRule4Engine.setLoopControlName(loopControlName);
+ return correlationDeployRule4Engine;
+ }
+
private CorrelationCheckRule4Engine correlationRules2CheckRule(
CorrelationRule correlationRule) {
CorrelationCheckRule4Engine correlationCheckRule4Engine = new CorrelationCheckRule4Engine();