summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src
diff options
context:
space:
mode:
Diffstat (limited to 'holmes-actions/src')
-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;