diff options
Diffstat (limited to 'participant/participant-impl/participant-impl-dcae')
2 files changed, 9 insertions, 6 deletions
diff --git a/participant/participant-impl/participant-impl-dcae/src/main/java/org/onap/policy/clamp/controlloop/participant/dcae/main/handler/ControlLoopElementHandler.java b/participant/participant-impl/participant-impl-dcae/src/main/java/org/onap/policy/clamp/controlloop/participant/dcae/main/handler/ControlLoopElementHandler.java index b80fbfb5b..221635db0 100644 --- a/participant/participant-impl/participant-impl-dcae/src/main/java/org/onap/policy/clamp/controlloop/participant/dcae/main/handler/ControlLoopElementHandler.java +++ b/participant/participant-impl/participant-impl-dcae/src/main/java/org/onap/policy/clamp/controlloop/participant/dcae/main/handler/ControlLoopElementHandler.java @@ -30,6 +30,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ClElementSt import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElement; import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState; import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopState; +import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantMessageType; import org.onap.policy.clamp.controlloop.participant.dcae.httpclient.ClampHttpClient; import org.onap.policy.clamp.controlloop.participant.dcae.httpclient.ConsulDcaeHttpClient; import org.onap.policy.clamp.controlloop.participant.dcae.main.parameters.ParticipantDcaeParameters; @@ -99,14 +100,16 @@ public class ControlLoopElementHandler implements ControlLoopElementListener { if (loop != null) { clampClient.undeploy(LOOP); intermediaryApi.updateControlLoopElementState(controlLoopElementId, newState, - ControlLoopState.UNINITIALISED); + ControlLoopState.UNINITIALISED, ParticipantMessageType.CONTROL_LOOP_STATE_CHANGE); } break; case PASSIVE: - intermediaryApi.updateControlLoopElementState(controlLoopElementId, newState, ControlLoopState.PASSIVE); + intermediaryApi.updateControlLoopElementState(controlLoopElementId, newState, ControlLoopState.PASSIVE, + ParticipantMessageType.CONTROL_LOOP_STATE_CHANGE); break; case RUNNING: - intermediaryApi.updateControlLoopElementState(controlLoopElementId, newState, ControlLoopState.RUNNING); + intermediaryApi.updateControlLoopElementState(controlLoopElementId, newState, ControlLoopState.RUNNING, + ParticipantMessageType.CONTROL_LOOP_STATE_CHANGE); break; default: LOGGER.debug("Unknown orderedstate {}", newState); @@ -157,7 +160,7 @@ public class ControlLoopElementHandler implements ControlLoopElementListener { String status = ClampHttpClient.getStatusCode(loop); if (MICROSERVICE_INSTALLED_SUCCESSFULLY.equals(status)) { intermediaryApi.updateControlLoopElementState(element.getId(), element.getOrderedState(), - ControlLoopState.PASSIVE); + ControlLoopState.PASSIVE, ParticipantMessageType.CONTROL_LOOP_UPDATE); deployedFlag = true; break; } @@ -165,7 +168,7 @@ public class ControlLoopElementHandler implements ControlLoopElementListener { if (!deployedFlag) { LOGGER.warn("DCAE is not deployed properly, ClElement state will be UNINITIALISED2PASSIVE"); intermediaryApi.updateControlLoopElementState(element.getId(), element.getOrderedState(), - ControlLoopState.UNINITIALISED2PASSIVE); + ControlLoopState.UNINITIALISED2PASSIVE, ParticipantMessageType.CONTROL_LOOP_UPDATE); } } } catch (PfModelException e) { diff --git a/participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/rest/TestListenerUtils.java b/participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/rest/TestListenerUtils.java index c6dd927da..febdf6b08 100644 --- a/participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/rest/TestListenerUtils.java +++ b/participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/rest/TestListenerUtils.java @@ -51,7 +51,7 @@ public class TestListenerUtils { private static final YamlJsonTranslator yamlTranslator = new YamlJsonTranslator(); private static final Coder CODER = new StandardCoder(); private static final String TOSCA_TEMPLATE_YAML = "examples/controlloop/PMSubscriptionHandling.yaml"; - private static final String CONTROL_LOOP_ELEMENT = "ControlLoopElement"; + private static final String CONTROL_LOOP_ELEMENT = "org.onap.policy.clamp.controlloop.ControlLoopElement"; /** * Method to create a controlLoop from a yaml file. |