From: Congcong Peng Date: Mon, 16 Apr 2018 09:58:56 +0000 (+0800) Subject: Remove RequestId X-Git-Tag: 1.2.0~18 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=holmes%2Fcommon.git;a=commitdiff_plain;h=b6920b68810a4679257ed72437dd7152a0b291d0 Remove RequestId Issue-ID: HOLMES-100 Change-Id: I8cce9284ddb6de6d38b462314ecb0b07c8f22752 Signed-off-by: Congcong Peng --- 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"); + } + } }