aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2021-09-23 14:45:12 +0000
committerGerrit Code Review <gerrit@onap.org>2021-09-23 14:45:12 +0000
commit4143155d835d2fcb291143e6863147dedfe367f4 (patch)
treea7ff6b912c4363cd25be1a318d50fdae92dbbeec /models
parent60141eb41cd7f7a6ea0ee2a382081985ea8a24e4 (diff)
parent3b9768ebb116a49aed649927d162dbdcdfa7fffe (diff)
Merge "Fix startPhase in runtime and participants"
Diffstat (limited to 'models')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ParticipantUtils.java14
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdate.java1
2 files changed, 15 insertions, 0 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ParticipantUtils.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ParticipantUtils.java
index 05f5a4bb8..4c3dd4b06 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ParticipantUtils.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ParticipantUtils.java
@@ -57,6 +57,20 @@ public final class ParticipantUtils {
}
/**
+ * Finds startPhase from a map of properties.
+ *
+ * @param properties Map of properties
+ * @return startPhase
+ */
+ public static int findStartPhase(Map<String, Object> properties) {
+ var objParticipantType = properties.get("startPhase");
+ if (objParticipantType != null) {
+ return Integer.valueOf(objParticipantType.toString());
+ }
+ return 0;
+ }
+
+ /**
* Checks If NodeTemplate Is ControlLoopElement.
*
* @param nodeTemplate the ToscaNodeTemplate
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdate.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdate.java
index 42b9712e2..f8a47c7c9 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdate.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdate.java
@@ -40,6 +40,7 @@ public class ControlLoopUpdate extends ParticipantMessage {
// A list of ParticipantUpdates instances which carries details of an updated participant.
private List<ParticipantUpdates> participantUpdatesList = new ArrayList<>();
+ private Integer startPhase = 0;
/**
* Constructor for instantiating ControlLoopUpdate class with message name.