diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2022-08-12 10:42:36 +0800 |
---|---|---|
committer | Guangrong Fu <fu.guangrong@zte.com.cn> | 2022-08-12 10:42:40 +0800 |
commit | 0138ee36fd9fa7f5b4d33d45ec1bc1aa0c9c4e45 (patch) | |
tree | f42cfef4cea1461f6b66663277b2ac725cd9a92e /rules/mdons-rule.drl | |
parent | 857c9da5ed2a2775ac7426d97a99195d671c21b5 (diff) |
Replaced ServiceLocator with SpringContextUtil
Issue-ID: HOLMES-511
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Change-Id: I0f881f66766c8d084424111f0529895c94565ad0
Diffstat (limited to 'rules/mdons-rule.drl')
-rw-r--r-- | rules/mdons-rule.drl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rules/mdons-rule.drl b/rules/mdons-rule.drl index 4b7dc01..9f4d6ed 100644 --- a/rules/mdons-rule.drl +++ b/rules/mdons-rule.drl @@ -8,7 +8,7 @@ import org.onap.holmes.common.exception.CorrelationException; import org.onap.holmes.common.dmaap.entity.PolicyMsg;
import org.onap.holmes.common.dmaap.DmaapService;
import org.onap.holmes.common.utils.DroolsLog;
-import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;
+import org.onap.holmes.common.utils.SpringContextUtil;
import org.onap.holmes.common.dmaap.store.UniqueRequestIdCache;
@@ -51,7 +51,7 @@ function PolicyMsg createPolicyMsg(VesAlarm alarm, String serviceInstanceId, Str m.setTarget("vserver.vserver-name");
m.setAai(getAaiObjectPolicy(serviceName, serviceInstanceId));
- ServiceLocatorHolder.getLocator().getService(UniqueRequestIdCache.class).put(alarm.getEventId(), m.getRequestID());
+ SpringContextUtil.getBean(UniqueRequestIdCache.class).put(alarm.getEventId(), m.getRequestID());
return m;
}
@@ -74,7 +74,7 @@ rule "Process Alarms MSA" Map<String, String> map = processAlarm($a.getSourceId() + "-XPDR1");
for(Map.Entry<String,String> entry : map.entrySet()){
PolicyMsg msg = createPolicyMsg($a, entry.getKey(), entry.getValue());
- DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ DmaapService dmaapService = SpringContextUtil.getBean(DmaapService.class);
dmaapService.publishPolicyMsg(msg, "dcae_cl_out");
DroolsLog.printInfo("Published to policy=" + msg.toString());
@@ -94,7 +94,7 @@ rule "Process Alarms TAPI" Map<String, String> map = processAlarm($a.getEventId());
for(Map.Entry<String,String> entry : map.entrySet()){
PolicyMsg msg = createPolicyMsg($a, entry.getKey(), entry.getValue());
- DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ DmaapService dmaapService = SpringContextUtil.getBean(DmaapService.class);
dmaapService.publishPolicyMsg(msg, "dcae_cl_out");
DroolsLog.printInfo("Published to policy=" + msg.toString());
|