summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src/main
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-11-09 23:32:24 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2017-11-09 23:32:24 +0800
commitee62cd0ae490e27d461d50258805dc37c5de0d3b (patch)
treeacb8d2ed4bb2d3665dc35f5c08008737a14a793a /holmes-actions/src/main
parente53f898dc82f4a8b9172b6a4e7ec017500bee7ca (diff)
Fix Some Bugs
Change-Id: I44a9f439e61cc9c9e58af5d23674cdf42bfd156a Issue-ID: HOLMES-85 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'holmes-actions/src/main')
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java9
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java2
2 files changed, 8 insertions, 3 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 f2fd3a1..2651c97 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
@@ -72,8 +72,13 @@ public class DmaapService {
enrichVnfInfo(vmEntity, childAlarm, policyMsg);
policyMsg.setClosedLoopEventStatus(EVENT_STATUS.ONSET);
policyMsg.getAai().put("vserver.in-maint", String.valueOf(vmEntity.getInMaint()));
- policyMsg.getAai().put("vserver.is-closed-loop-disabled",
- String.valueOf(vmEntity.getClosedLoopDisable()));
+ try {
+ policyMsg.getAai().put("vserver.is-closed-loop-disabled",
+ Boolean.valueOf(vmEntity.getClosedLoopDisable()).booleanValue());
+ } catch (Exception e) {
+ log.error("Failed to parse the field \"is-closed-loop-disabled\". A boolean string (\"true\"/\"false\")"
+ + " is expected but the actual value is " + vmEntity.getClosedLoopDisable() + ".", e);
+ }
policyMsg.getAai().put("vserver.prov-status", vmEntity.getProvStatus());
policyMsg.getAai().put("vserver.resource-version", vmEntity.getResourceVersion());
} else {
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java
index 2ef25dc..6955d90 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java
@@ -41,7 +41,7 @@ public class PolicyMsg {
private String targetType = "VM";
private String target;
@JsonProperty(value = "AAI")
- private Map<String, String> aai = new HashMap<>();
+ private Map<String, Object> aai = new HashMap<>();
public static enum EVENT_STATUS {
ONSET, ABATED;