* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
* You may obtain a copy of the License at\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
* You may obtain a copy of the License at\r
* Unless required by applicable law or agreed to in writing, software\r
* distributed under the License is distributed on an "AS IS" BASIS,\r
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
* Unless required by applicable law or agreed to in writing, software\r
* distributed under the License is distributed on an "AS IS" BASIS,\r
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
import javax.annotation.PostConstruct;\r
import javax.inject.Inject;\r
import javax.inject.Singleton;\r
import javax.annotation.PostConstruct;\r
import javax.inject.Inject;\r
import javax.inject.Singleton;\r
import lombok.extern.slf4j.Slf4j;\r
import org.jvnet.hk2.annotations.Service;\r
import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;\r
import lombok.extern.slf4j.Slf4j;\r
import org.jvnet.hk2.annotations.Service;\r
import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;\r
import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;\r
import org.onap.holmes.rulemgt.bolt.enginebolt.EngineWrapper;\r
import org.onap.holmes.rulemgt.db.CorrelationRuleQueryDao;\r
import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;\r
import org.onap.holmes.rulemgt.bolt.enginebolt.EngineWrapper;\r
import org.onap.holmes.rulemgt.db.CorrelationRuleQueryDao;\r
if (ruleTemp != null) {\r
throw new CorrelationException("A rule with the same name already exists.");\r
}\r
if (ruleTemp != null) {\r
throw new CorrelationException("A rule with the same name already exists.");\r
}\r
log.error("When adding rules, can not get engine instance ip");\r
}\r
String packageName = deployRule2Engine(correlationRule, ip);\r
log.error("When adding rules, can not get engine instance ip");\r
}\r
String packageName = deployRule2Engine(correlationRule, ip);\r
String tempContent = ruleCreateRequest.getContent();\r
CorrelationRule correlationRule = new CorrelationRule();\r
String ruleId = "rule_" + System.currentTimeMillis();\r
String tempContent = ruleCreateRequest.getContent();\r
CorrelationRule correlationRule = new CorrelationRule();\r
String ruleId = "rule_" + System.currentTimeMillis();\r
CorrelationRule correlationRule = new CorrelationRule();\r
String description = ruleUpdateRequest.getDescription() == null ? "" : ruleUpdateRequest.getDescription();\r
correlationRule.setRid(ruleUpdateRequest.getRuleId());\r
CorrelationRule correlationRule = new CorrelationRule();\r
String description = ruleUpdateRequest.getDescription() == null ? "" : ruleUpdateRequest.getDescription();\r
correlationRule.setRid(ruleUpdateRequest.getRuleId());\r
\r
public String deployRule2Engine(CorrelationRule correlationRule, String ip)\r
throws CorrelationException {\r
\r
public String deployRule2Engine(CorrelationRule correlationRule, String ip)\r
throws CorrelationException {\r
correlationRule.getEnabled() == RuleMgtConstant.STATUS_RULE_OPEN)) {\r
return engineWarpper.deployEngine(correlationRules2DeployRule(correlationRule), ip);\r
}\r
correlationRule.getEnabled() == RuleMgtConstant.STATUS_RULE_OPEN)) {\r
return engineWarpper.deployEngine(correlationRules2DeployRule(correlationRule), ip);\r
}\r
CorrelationRule correlationRule) {\r
CorrelationCheckRule4Engine correlationCheckRule4Engine = new CorrelationCheckRule4Engine();\r
correlationCheckRule4Engine.setContent(correlationRule.getContent());\r
CorrelationRule correlationRule) {\r
CorrelationCheckRule4Engine correlationCheckRule4Engine = new CorrelationCheckRule4Engine();\r
correlationCheckRule4Engine.setContent(correlationRule.getContent());\r