aboutsummaryrefslogtreecommitdiffstats
path: root/models/src/main/java
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2021-09-22 09:31:25 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2021-09-22 15:29:39 +0000
commit3b9768ebb116a49aed649927d162dbdcdfa7fffe (patch)
treef5f4026adfa7832cc0bb466c620040ac69b5365e /models/src/main/java
parentb428105b44d0504b05a0b93894bef97e5ab7e8b4 (diff)
Fix startPhase in runtime and participants
Issue-ID: POLICY-3677 Change-Id: I78635928086cc39fc3539925052e06b657b249c2 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'models/src/main/java')
-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.