aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/events/src
diff options
context:
space:
mode:
authorRashmi Pujar <rashmi.pujar@bell.ca>2019-10-29 16:13:05 -0400
committerRashmi Pujar <rashmi.pujar@bell.ca>2019-11-04 10:11:21 -0500
commit73e3ea2f9183fc7ed6ba8c0f221e41a804fbe2c7 (patch)
treee1033b47c0c1d091bd90d215c44727a99d9dc341 /models-interactions/model-impl/events/src
parent18555714bf9d3204be552c8664f008ec31115479 (diff)
PNF support changes in policy/models
AAI Enrichment method for PNF target-type and unit tests. Addition of a hashmap field to ControlLoopEvent class to hold event specific parameters. Update CDS actor to include additional event parameters Issue-ID: POLICY-1187 Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca> Change-Id: Ie0ceb320943531de6e6bc8675844b29a358dfb7e
Diffstat (limited to 'models-interactions/model-impl/events/src')
-rw-r--r--models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java31
-rw-r--r--models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java1
-rw-r--r--models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java1
3 files changed, 10 insertions, 23 deletions
diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java
index 534e843f2..3ff7aa256 100644
--- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java
+++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java
@@ -23,6 +23,7 @@ package org.onap.policy.controlloop;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
+import java.util.Map;
import java.util.UUID;
import lombok.Getter;
import lombok.Setter;
@@ -33,45 +34,27 @@ 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 String targetType;
-
- @SerializedName("target")
+ private String closedLoopControlName;
+ private String version = "1.0.2";
+ private String closedLoopEventClient;
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;
+ private Map<String, String> additionalEventParams;
public ControlLoopEvent() {
}
/**
- * Construct an instace from an existing instance.
+ * Construct an instance from an existing instance.
*
* @param event the existing instance
*/
@@ -79,6 +62,7 @@ public abstract class ControlLoopEvent implements Serializable {
if (event == null) {
return;
}
+ this.version = event.version;
this.closedLoopControlName = event.closedLoopControlName;
this.requestId = event.requestId;
this.closedLoopEventClient = event.closedLoopEventClient;
@@ -89,6 +73,7 @@ public abstract class ControlLoopEvent implements Serializable {
this.policyName = event.policyName;
this.policyVersion = event.policyVersion;
this.closedLoopEventStatus = event.closedLoopEventStatus;
+ this.additionalEventParams = event.additionalEventParams;
}
public boolean isEventStatusValid() {
diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java
index 1ca182563..b79140a12 100644
--- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java
+++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java
@@ -26,4 +26,5 @@ public class ControlLoopTargetType {
public static final String VF = "VF";
public static final String VFC = "VFC";
public static final String VNF = "VNF";
+ public static final String PNF = "PNF";
}
diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java
index daf6bb814..ac700c866 100644
--- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java
+++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java
@@ -33,5 +33,6 @@ public class ControlLoopTargetTypeTest {
assertEquals("VF", ControlLoopTargetType.VF);
assertEquals("VFC", ControlLoopTargetType.VFC);
assertEquals("VNF", ControlLoopTargetType.VNF);
+ assertEquals("PNF", ControlLoopTargetType.PNF);
}
}