summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src/main/java/org/onap
diff options
context:
space:
mode:
authorCongcong Peng <peng.congcong@zte.com.cn>2018-04-16 17:58:56 +0800
committerCongcong Peng <peng.congcong@zte.com.cn>2018-04-16 17:58:56 +0800
commitb6920b68810a4679257ed72437dd7152a0b291d0 (patch)
treeaecdd586ce0ced7060bba28e48f9753bf5c87c8e /holmes-actions/src/main/java/org/onap
parent3356fb82b20ebe7209522e4e009dd6aea5ed1802 (diff)
Remove RequestId
Issue-ID: HOLMES-100 Change-Id: I8cce9284ddb6de6d38b462314ecb0b07c8f22752 Signed-off-by: Congcong Peng <peng.congcong@zte.com.cn>
Diffstat (limited to 'holmes-actions/src/main/java/org/onap')
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
index c64bd59..f19b89c 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
@@ -47,6 +47,7 @@ public class DmaapService {
publisher.setUrl(DcaeConfigurationsCache.getPubSecInfo(dmaapConfigKey).getDmaapInfo()
.getTopicUrl());
publisher.publish(policyMsg);
+ deleteRequestId(policyMsg);
log.info("send policyMsg: " + GsonUtil.beanToJson(policyMsg));
} catch (CorrelationException e) {
log.error("Failed to publish the control loop event to DMaaP", e);
@@ -183,4 +184,17 @@ public class DmaapService {
}
return vmEntity;
}
+
+ private void deleteRequestId(PolicyMsg policyMsg){
+ String status = policyMsg.getClosedLoopEventStatus().toString();
+ if(status == "ABATED"){
+ String requestId = policyMsg.getRequestID();
+ for(String key: alarmUniqueRequestID.keySet()){
+ if(alarmUniqueRequestID.get(key).equals(requestId)){
+ alarmUniqueRequestID.remove(key);
+ }
+ }
+ log.info("Clear alarm, requestId deleted successful");
+ }
+ }
}