From 6718f2da899b21b4adc7d004a4e592039645d75a Mon Sep 17 00:00:00 2001 From: dc443y Date: Mon, 19 Mar 2018 21:04:50 -0500 Subject: Fix Serialized Names of A&AI Subtag Onset events received from DCAE contain an "AAI" subtag that is capitalized. The casing of the AAI variable was changed to lower case which was making the gson serializer unable to deserialze a simulated onset event that matches the casing DCAE uses, which resulted in Policy rejecting the events because they appear to be missing "AAI". A serialized name was added to preserve the lower cased variable as sonar wants but will also allow onsets with capitalized AAI subtags to be processed by the rules engine. Issue-ID: POLICY-681 Change-Id: Ia37694f606b3fb0898d6c4dadea7c48c5372e64e Signed-off-by: dc443y --- .../main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java | 3 +++ .../org/onap/policy/controlloop/VirtualControlLoopNotification.java | 3 +++ 2 files changed, 6 insertions(+) (limited to 'controlloop/common/model-impl/events/src/main/java') diff --git a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java index c512b6796..b5ce27112 100644 --- a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java +++ b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java @@ -24,6 +24,8 @@ import java.time.Instant; import java.util.HashMap; import java.util.Map; +import com.google.gson.annotations.SerializedName; + public class VirtualControlLoopEvent extends ControlLoopEvent { /** @@ -32,6 +34,7 @@ public class VirtualControlLoopEvent extends ControlLoopEvent { private static final long serialVersionUID = -5752405682246066226L; private Instant closedLoopAlarmStart; private Instant closedLoopAlarmEnd; + @SerializedName("AAI") private Map aai = new HashMap<>(); public VirtualControlLoopEvent() { diff --git a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java index c99e3a1b0..72d88df92 100644 --- a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java +++ b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java @@ -24,6 +24,8 @@ import java.time.Instant; import java.util.HashMap; import java.util.Map; +import com.google.gson.annotations.SerializedName; + public class VirtualControlLoopNotification extends ControlLoopNotification { /** @@ -31,6 +33,7 @@ public class VirtualControlLoopNotification extends ControlLoopNotification { */ private static final long serialVersionUID = 5354756047932144017L; + @SerializedName("AAI") private Map aai = new HashMap<>(); private Instant closedLoopAlarmStart; private Instant closedLoopAlarmEnd; -- cgit 1.2.3-korg