summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src
diff options
context:
space:
mode:
authorGuobiao Mo <guobiaomo@chinamobile.com>2018-09-28 12:40:15 -0700
committerGuobiao Mo <guobiaomo@chinamobile.com>2018-09-29 17:26:00 -0700
commit480e77e15e0da305d10374d12ad5e999f64f797d (patch)
treefa887f60da8b834f0335649ae660f2eb223b331c /holmes-actions/src
parentd00f96d02f8f44ca0fe84a1a38c726edf80128ce (diff)
Fix String compare
Issue-ID: HOLMES-172 Change-Id: Ie49b1088cb04dbf94b83830224bcd7464870e001 Signed-off-by: Guobiao Mo <guobiaomo@chinamobile.com>
Diffstat (limited to 'holmes-actions/src')
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java12
1 files changed, 7 insertions, 5 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 f19b89c..db57f3c 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
@@ -15,6 +15,7 @@
*/
package org.onap.holmes.common.dmaap;
+import java.util.Map.Entry;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@@ -186,12 +187,13 @@ public class DmaapService {
}
private void deleteRequestId(PolicyMsg policyMsg){
- String status = policyMsg.getClosedLoopEventStatus().toString();
- if(status == "ABATED"){
+ EVENT_STATUS status = policyMsg.getClosedLoopEventStatus();
+ if(EVENT_STATUS.ABATED.equals(status)) {
String requestId = policyMsg.getRequestID();
- for(String key: alarmUniqueRequestID.keySet()){
- if(alarmUniqueRequestID.get(key).equals(requestId)){
- alarmUniqueRequestID.remove(key);
+ for(Entry<String, String> kv: alarmUniqueRequestID.entrySet()) {
+ if(kv.getValue().equals(requestId)) {
+ alarmUniqueRequestID.remove(kv.getKey());
+ break;
}
}
log.info("Clear alarm, requestId deleted successful");