aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/events/src/main
diff options
context:
space:
mode:
authorDaniel Cruz <dc443y@att.com>2018-04-03 21:09:58 -0500
committerDaniel Cruz <dc443y@att.com>2018-04-03 21:10:26 -0500
commit1b456572b4a1b34651c3fb81749af543b624fa7e (patch)
tree854a0cdaa5161a9bc2a9a755ec6e4518957de0d3 /controlloop/common/model-impl/events/src/main
parentf93d15969c332a284cae83c86d749cc66e6ced98 (diff)
Fix Event Syntaxv1.2.0
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>
Diffstat (limited to 'controlloop/common/model-impl/events/src/main')
-rw-r--r--controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java25
-rw-r--r--controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java5
-rw-r--r--controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java4
3 files changed, 33 insertions, 1 deletions
diff --git a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java
index d3f1786c7..eab04e22e 100644
--- a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java
+++ b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java
@@ -20,23 +20,46 @@
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() {
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 ec4fc47dd..b5ae50ac8 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
@@ -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<>();
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 acb81f8ba..71a901505 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
@@ -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() {}