Fix Event Syntax 65/40865/1 v1.2.0
authorDaniel Cruz <dc443y@att.com>
Wed, 4 Apr 2018 02:09:58 +0000 (21:09 -0500)
committerDaniel Cruz <dc443y@att.com>
Wed, 4 Apr 2018 02:10:26 +0000 (21:10 -0500)
The "requestID" field was changed to "requestId" which brakes
the use cases since this does not conform to the events
DCAE will be sending. To avoid further issues with changed
variable names, all onset fields now have a serialized name
that will be used when serializing/deserializing with gson.

Issue-ID: POLICY-681
Change-Id: I731b0c83a9b6c9bbaae0312f76382d7f4644db8c
Signed-off-by: Daniel Cruz <dc443y@att.com>
controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java
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 d3f1786..eab04e2 100644 (file)
 
 package org.onap.policy.controlloop;
 
+import com.google.gson.annotations.SerializedName;
+
 import java.io.Serializable;
 import java.util.UUID;
 
 public abstract class ControlLoopEvent implements Serializable {
 
     private static final long serialVersionUID = 2391252138583119195L;
-
+    
+    @SerializedName("closedLoopControlName")
     private String closedLoopControlName;
+    
+    @SerializedName("version")
     private String version = "1.0.2";
+    
+    @SerializedName("requestID")
     private UUID requestId;
+    
+    @SerializedName("closedLoopEventClient")
     private String closedLoopEventClient;
+    
+    @SerializedName("target_type")
     private ControlLoopTargetType targetType;
+    
+    @SerializedName("target")
     private String target;
+    
+    @SerializedName("from")
     private String from;
+    
+    @SerializedName("policyScope")
     private String policyScope;
+    
+    @SerializedName("policyName")
     private String policyName;
+    
+    @SerializedName("policyVersion")
     private String policyVersion;
+    
+    @SerializedName("closedLoopEventStatus")
     private ControlLoopEventStatus closedLoopEventStatus;
 
     public ControlLoopEvent() {
index ec4fc47..b5ae50a 100644 (file)
@@ -29,8 +29,13 @@ import java.util.Map;
 public class VirtualControlLoopEvent extends ControlLoopEvent {
 
     private static final long serialVersionUID = -5752405682246066226L;
+    
+    @SerializedName("closedLoopAlarmStart")
     private Instant closedLoopAlarmStart;
+    
+    @SerializedName("closedLoopAlarmEnd")
     private Instant closedLoopAlarmEnd;
+    
     @SerializedName("AAI")
     private Map<String, String> aai = new HashMap<>();
 
index acb81f8..71a9015 100644 (file)
@@ -32,7 +32,11 @@ public class VirtualControlLoopNotification extends ControlLoopNotification {
 
     @SerializedName("AAI")
     private Map<String, String> aai = new HashMap<>();
+    
+    @SerializedName("closedLoopAlarmStart")
     private Instant closedLoopAlarmStart;
+    
+    @SerializedName("closedLoopAlarmEnd")
     private Instant closedLoopAlarmEnd;
 
     public VirtualControlLoopNotification() {}