diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2017-11-09 23:32:24 +0800 |
---|---|---|
committer | Guangrong Fu <fu.guangrong@zte.com.cn> | 2017-11-09 23:32:24 +0800 |
commit | ee62cd0ae490e27d461d50258805dc37c5de0d3b (patch) | |
tree | acb8d2ed4bb2d3665dc35f5c08008737a14a793a | |
parent | e53f898dc82f4a8b9172b6a4e7ec017500bee7ca (diff) |
Fix Some Bugs
Change-Id: I44a9f439e61cc9c9e58af5d23674cdf42bfd156a
Issue-ID: HOLMES-85
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
-rw-r--r-- | holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java | 9 | ||||
-rw-r--r-- | holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java | 2 |
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;
|