aboutsummaryrefslogtreecommitdiffstats
path: root/models/src/main/java
diff options
context:
space:
mode:
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>2023-05-18 16:47:10 +0100
committerLiam Fallon <liam.fallon@est.tech>2023-05-23 15:25:03 +0000
commit461bbdb67733552e78037bd96ca7efdfd3015e25 (patch)
treeefab4e35ea578f058879922588cd711d0e22d0ce /models/src/main/java
parent4539ab951ef81839d38641fa09f2cbd490d71a63 (diff)
Update AC Element properties on the DEPLOYED state
User can update the instance property values on DEPLOYED state. The runtime sends PROPERTY_UPDATE event to the participants and the updated values are stored on the runtime database. Participants can implement the update method to perform the required action. Issue-ID: POLICY-4682 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: Ic35fba669b5ffcf2c75d6deaa8c309d58e4026f0
Diffstat (limited to 'models/src/main/java')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java3
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java13
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/PropertiesUpdate.java61
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java3
4 files changed, 77 insertions, 3 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java
index 94aa07097..9dde703b6 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java
@@ -26,5 +26,6 @@ public enum DeployState {
UNDEPLOYED,
UNDEPLOYING,
DELETING,
- DELETED
+ DELETED,
+ UPDATING
}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
index 474bcd36f..e60a13202 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
@@ -100,5 +100,16 @@ public enum ParticipantMessageType {
/**
* Used by automation composition runtime to request for PARTICIPANT_STATUS message immediately.
*/
- PARTICIPANT_STATUS_REQ
+ PARTICIPANT_STATUS_REQ,
+
+ /**
+ * Used by automation composition runtime to send the element properties update to participant.
+ */
+ PROPERTIES_UPDATE,
+
+ /**
+ * Used by participant to acknowledge the receipt of PROPERTIES_UPDATE message
+ * from automation composition runtime.
+ */
+ PROPERTIES_UPDATE_ACK
}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/PropertiesUpdate.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/PropertiesUpdate.java
new file mode 100644
index 000000000..43573cc08
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/PropertiesUpdate.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2023 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.clamp.models.acm.messages.dmaap.participant;
+
+import java.util.ArrayList;
+import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantDeploy;
+import org.onap.policy.models.base.PfUtils;
+
+
+/**
+ * Class to represent the PROPERTIES_UPDATE message that the ACM runtime sends to a participant.
+ * The ACM Runtime sends updated automation composition element property values to Participants.
+ */
+@Getter
+@Setter
+@ToString(callSuper = true)
+public class PropertiesUpdate extends ParticipantMessage {
+
+ // A list of updates to AC element properties
+ private List<ParticipantDeploy> participantUpdatesList = new ArrayList<>();
+
+ /**
+ * Constructor for instantiating properties update class with message name.
+ *
+ */
+ public PropertiesUpdate() {
+ super(ParticipantMessageType.PROPERTIES_UPDATE);
+ }
+
+ /**
+ * Constructs the object, making a deep copy.
+ *
+ * @param source source from which to copy
+ */
+ public PropertiesUpdate(PropertiesUpdate source) {
+ super(source);
+ this.participantUpdatesList = PfUtils.mapList(source.participantUpdatesList, ParticipantDeploy::new);
+ }
+}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
index f4b57f1d1..318b36a19 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
@@ -24,5 +24,6 @@ public enum DeployOrder {
NONE,
UNDEPLOY,
DEPLOY,
- DELETE
+ DELETE,
+ UPDATE
}