Fix Serialized Names of A&AI Subtag 89/36889/1
authordc443y <dc443y@att.com>
Tue, 20 Mar 2018 02:04:50 +0000 (21:04 -0500)
committerdc443y <dc443y@att.com>
Tue, 20 Mar 2018 02:13:56 +0000 (21:13 -0500)
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 <dc443y@att.com>
controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java
controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java

index c512b67..b5ce271 100644 (file)
@@ -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<String, String> aai = new HashMap<>();
 
        public VirtualControlLoopEvent() {
index c99e3a1..72d88df 100644 (file)
@@ -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<String, String> aai = new HashMap<>();
        private Instant closedLoopAlarmStart;
        private Instant closedLoopAlarmEnd;