diff options
author | dc443y <dc443y@att.com> | 2018-03-19 21:04:50 -0500 |
---|---|---|
committer | dc443y <dc443y@att.com> | 2018-03-19 21:13:56 -0500 |
commit | 6718f2da899b21b4adc7d004a4e592039645d75a (patch) | |
tree | e7ad2a157d0a0fd20421a9759ef50402d6a4715c /controlloop/common | |
parent | 4bd2be340326877feb7985f3cc043d5d5aa26f83 (diff) |
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 <dc443y@att.com>
Diffstat (limited to 'controlloop/common')
2 files changed, 6 insertions, 0 deletions
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<String, String> 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<String, String> aai = new HashMap<>(); private Instant closedLoopAlarmStart; private Instant closedLoopAlarmEnd; |