From 3b9768ebb116a49aed649927d162dbdcdfa7fffe Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Wed, 22 Sep 2021 09:31:25 +0100 Subject: Fix startPhase in runtime and participants Issue-ID: POLICY-3677 Change-Id: I78635928086cc39fc3539925052e06b657b249c2 Signed-off-by: FrancescoFioraEst --- .../models/controlloop/concepts/ParticipantUtils.java | 14 ++++++++++++++ .../messages/dmaap/participant/ControlLoopUpdate.java | 1 + 2 files changed, 15 insertions(+) (limited to 'models') 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 @@ -56,6 +56,20 @@ public final class ParticipantUtils { return null; } + /** + * Finds startPhase from a map of properties. + * + * @param properties Map of properties + * @return startPhase + */ + public static int findStartPhase(Map properties) { + var objParticipantType = properties.get("startPhase"); + if (objParticipantType != null) { + return Integer.valueOf(objParticipantType.toString()); + } + return 0; + } + /** * Checks If NodeTemplate Is ControlLoopElement. * 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 participantUpdatesList = new ArrayList<>(); + private Integer startPhase = 0; /** * Constructor for instantiating ControlLoopUpdate class with message name. -- cgit 1.2.3-korg