aboutsummaryrefslogtreecommitdiffstats
path: root/models-pap/src/main/java/org/onap
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-10-31 17:39:47 -0400
committerJim Hahn <jrh3@att.com>2019-10-31 17:54:46 -0400
commit26515a637ffe517301453c3477cafbdac730735b (patch)
tree73d922a15bdac20fc829584ee7a96d27398e79a1 /models-pap/src/main/java/org/onap
parentdc1773e466f12dab993d1241a1a0b7ce36695713 (diff)
Change field names in policy notifications to match wiki
Field names looked like "policyType.name". Changed them to look like "policy-type", instead, to match the wiki for the notifications to be sent to DCAE. Change-Id: Ib3cef1712fd12a44db8acdcff2245d800b21137a Issue-ID: POLICY-2190 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-pap/src/main/java/org/onap')
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyNotification.java4
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyStatus.java31
2 files changed, 29 insertions, 6 deletions
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyNotification.java b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyNotification.java
index 1cdf254c4..0583edd62 100644
--- a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyNotification.java
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyNotification.java
@@ -31,13 +31,13 @@ public class PolicyNotification {
/**
* Status of policies that are being added to PDPs.
*/
- @SerializedName("added-policies")
+ @SerializedName("deployed-policies")
private List<PolicyStatus> added = new ArrayList<>();
/**
* Status of policies that are being deleted from PDPs.
*/
- @SerializedName("deleted-policies")
+ @SerializedName("undeployed-policies")
private List<PolicyStatus> deleted = new ArrayList<>();
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyStatus.java b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyStatus.java
index 2da4c3c68..427f168ea 100644
--- a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyStatus.java
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyStatus.java
@@ -29,10 +29,16 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifi
public class PolicyStatus {
@SerializedName("policy-type")
- private ToscaPolicyTypeIdentifier policyType;
+ private String policyTypeId;
+
+ @SerializedName("policy-type-version")
+ private String policyTypeVersion;
@SerializedName("policy-id")
- private ToscaPolicyIdentifier policy;
+ private String policyId;
+
+ @SerializedName("policy-version")
+ private String policyVersion;
/**
* Number of PDPs that have successfully added/deleted the policy.
@@ -53,8 +59,25 @@ public class PolicyStatus {
private int incompleteCount = 0;
+ /**
+ * Constructs the object.
+ *
+ * @param policyType policy type, from which the name and version are to be extracted
+ * @param policy policy identifier, from which the name and version are to be
+ * extracted
+ */
public PolicyStatus(ToscaPolicyTypeIdentifier policyType, ToscaPolicyIdentifier policy) {
- this.policyType = policyType;
- this.policy = policy;
+ this.policyTypeId = policyType.getName();
+ this.policyTypeVersion = policyType.getVersion();
+ this.policyId = policy.getName();
+ this.policyVersion = policy.getVersion();
+ }
+
+ public ToscaPolicyTypeIdentifier getPolicyType() {
+ return new ToscaPolicyTypeIdentifier(policyTypeId, policyTypeVersion);
+ }
+
+ public ToscaPolicyIdentifier getPolicy() {
+ return new ToscaPolicyIdentifier(policyId, policyVersion);
}
}