Rename ParticipantControlLoopUpdate message 16/122816/1
authorSirisha_Manchikanti <sirisha.manchikanti@est.tech>
Wed, 21 Jul 2021 15:45:11 +0000 (16:45 +0100)
committerSirisha_Manchikanti <sirisha.manchikanti@est.tech>
Wed, 21 Jul 2021 15:49:31 +0000 (16:49 +0100)
This commit has no logical changes considered, except renaming
ParticipantControlLoopUpdate message to ControlLoopUpdate message.

According to following wiki ParticipantControlLoopUpdate message is
renamed to ControlLoopUpdate message.
https://wiki.onap.org/display/DW/The+CLAMP+Control+Loop+Participant+Protocol

Issue-ID: POLICY-3416
Signed-off-by: Sirisha_Manchikanti <sirisha.manchikanti@est.tech>
Change-Id: I73f2b6797393e3352f98db2234ab63b833d7f212

17 files changed:
models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdate.java [moved from models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantControlLoopUpdate.java with 81% similarity]
models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantMessageType.java
models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdateTest.java [moved from models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantControlLoopUpdateTest.java with 89% similarity]
participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/endtoend/ParticipantDcaeTest.java [moved from participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/endtoend/PartecipantDcaeTest.java with 77% similarity]
participant/participant-impl/participant-impl-dcae/src/test/java/org/onap/policy/clamp/controlloop/participant/dcae/main/rest/TestListenerUtils.java
participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantPolicyTest.java
participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java
participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/endtoend/ParticipantSimulatorTest.java
participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/rest/TestListenerUtils.java
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/comm/ControlLoopUpdateListener.java
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java
runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java [moved from runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantControlLoopUpdatePublisher.java with 84% similarity]
runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java

@@ -27,14 +27,14 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop
 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 
 /**
- * Class to represent the PARTICIPANT_CONTROL_LOOP_UPDATE message that the control loop runtime sends to a participant.
+ * Class to represent the CONTROL_LOOP_UPDATE message that the control loop runtime sends to a participant.
  * When a participant receives this message, it creates the control loop elements contained in the message and sets them
  * to state PASSIVE. subsequent PARTICIPANT_CONTROL_LOOP_STATE_CHANGE messages are used to activate the control loops.
  */
 @Getter
 @Setter
 @ToString(callSuper = true)
-public class ParticipantControlLoopUpdate extends ParticipantMessage {
+public class ControlLoopUpdate extends ParticipantMessage {
     // The control loop
     private ControlLoop controlLoop;
 
@@ -42,11 +42,11 @@ public class ParticipantControlLoopUpdate extends ParticipantMessage {
     private ToscaServiceTemplate controlLoopDefinition;
 
     /**
-     * Constructor for instantiating ParticipantControlLoopUpdate class with message name.
+     * Constructor for instantiating ControlLoopUpdate class with message name.
      *
      */
-    public ParticipantControlLoopUpdate() {
-        super(ParticipantMessageType.PARTICIPANT_CONTROL_LOOP_UPDATE);
+    public ControlLoopUpdate() {
+        super(ParticipantMessageType.CONTROL_LOOP_UPDATE);
     }
 
     /**
@@ -54,7 +54,7 @@ public class ParticipantControlLoopUpdate extends ParticipantMessage {
      *
      * @param source source from which to copy
      */
-    public ParticipantControlLoopUpdate(ParticipantControlLoopUpdate source) {
+    public ControlLoopUpdate(ControlLoopUpdate source) {
         super(source);
 
         this.controlLoop = new ControlLoop(source.controlLoop);
index 94d4846..22f5a17 100644 (file)
@@ -38,9 +38,9 @@ public enum ParticipantMessageType {
 
     /**
      * Used by controlloop runtime to update the controlloops running on participants, triggers a
-     * PARTICIPANT_STATUS message with the result of the PARTICIPANT_CONTROL_LOOP_UPDATE operation.
+     * PARTICIPANT_STATUS message with the result of the CONTROL_LOOP_UPDATE operation.
      */
-    PARTICIPANT_CONTROL_LOOP_UPDATE,
+    CONTROL_LOOP_UPDATE,
 
     /**
      * Used by controlloop runtime to change the state of controlloops in participants, triggers a
@@ -35,12 +35,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 /**
  * Test the copy constructor.
  */
-class ParticipantControlLoopUpdateTest {
+class ControlLoopUpdateTest {
     @Test
     void testCopyConstructor() {
-        assertThatThrownBy(() -> new ParticipantControlLoopUpdate(null)).isInstanceOf(NullPointerException.class);
+        assertThatThrownBy(() -> new ControlLoopUpdate(null)).isInstanceOf(NullPointerException.class);
 
-        ParticipantControlLoopUpdate orig = new ParticipantControlLoopUpdate();
+        ControlLoopUpdate orig = new ControlLoopUpdate();
         // verify with all values
         ToscaConceptIdentifier id = new ToscaConceptIdentifier();
         id.setName("id");
@@ -60,7 +60,7 @@ class ParticipantControlLoopUpdateTest {
         orig.setControlLoopDefinition(toscaServiceTemplate);
         orig.setControlLoop(controlLoop);
 
-        ParticipantControlLoopUpdate other = new ParticipantControlLoopUpdate(orig);
+        ControlLoopUpdate other = new ControlLoopUpdate(orig);
 
         assertEquals(removeVariableFields(orig.toString()), removeVariableFields(other.toString()));
 
@@ -32,8 +32,8 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockserver.integration.ClientAndServer;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopStateChange;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.participant.dcae.main.parameters.CommonTestData;
 import org.onap.policy.clamp.controlloop.participant.dcae.main.rest.TestListenerUtils;
 import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ControlLoopStateChangeListener;
@@ -50,7 +50,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
 @ExtendWith(SpringExtension.class)
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
 @TestPropertySource(locations = {"classpath:application_test.properties"})
-class PartecipantDcaeTest {
+class ParticipantDcaeTest {
 
     private static final CommInfrastructure INFRA = CommInfrastructure.NOOP;
     private static final String TOPIC = "my-topic";
@@ -124,53 +124,53 @@ class PartecipantDcaeTest {
 
     @Test
     void testControlLoopUpdateListener_ParticipantIdNoMatch() throws CoderException {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
-        participantControlLoopUpdateMsg.getParticipantId().setName("DummyName");
-        participantControlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
+        ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
+        controlLoopUpdateMsg.getParticipantId().setName("DummyName");
+        controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
 
         ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler);
-        clUpdateListener.onTopicEvent(INFRA, TOPIC, null, participantControlLoopUpdateMsg);
+        clUpdateListener.onTopicEvent(INFRA, TOPIC, null, controlLoopUpdateMsg);
 
         // Verify the content in participantHandler
-        assertNotEquals(participantControlLoopUpdateMsg.getParticipantId().getName(),
+        assertNotEquals(controlLoopUpdateMsg.getParticipantId().getName(),
                 participantHandler.getParticipantId().getName());
     }
 
     @Test
     void testControlLoopUpdateListenerPassive() throws CoderException {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
-        participantControlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
+        ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
+        controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
 
         ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler);
-        clUpdateListener.onTopicEvent(INFRA, TOPIC, null, participantControlLoopUpdateMsg);
+        clUpdateListener.onTopicEvent(INFRA, TOPIC, null, controlLoopUpdateMsg);
 
         // Verify the content in participantHandler
-        assertEquals(participantHandler.getParticipantId(), participantControlLoopUpdateMsg.getParticipantId());
+        assertEquals(participantHandler.getParticipantId(), controlLoopUpdateMsg.getParticipantId());
         assertEquals(1, participantHandler.getControlLoopHandler().getControlLoops().getControlLoopList().size());
     }
 
     @Test
     void testControlLoopUpdateListenerUninitialised() throws CoderException {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
-        participantControlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.UNINITIALISED);
+        ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
+        controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.UNINITIALISED);
 
         ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler);
-        clUpdateListener.onTopicEvent(INFRA, TOPIC, null, participantControlLoopUpdateMsg);
+        clUpdateListener.onTopicEvent(INFRA, TOPIC, null, controlLoopUpdateMsg);
 
         // Verify the content in participantHandler
-        assertEquals(participantHandler.getParticipantId(), participantControlLoopUpdateMsg.getParticipantId());
+        assertEquals(participantHandler.getParticipantId(), controlLoopUpdateMsg.getParticipantId());
         assertEquals(1, participantHandler.getControlLoopHandler().getControlLoops().getControlLoopList().size());
     }
 
     @Test
     void testControlLoopUpdateListenerString() throws CoderException {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
-        participantControlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.UNINITIALISED);
-
-        assertThat(participantControlLoopUpdateMsg.toString()).contains("state=UNINITIALISED");
-        ParticipantControlLoopUpdate copyParticipantControlLoopUpdateMsg =
-                TestListenerUtils.createCopyControlLoopUpdateMsg(participantControlLoopUpdateMsg);
-        assertThat(copyParticipantControlLoopUpdateMsg.toString()).contains("state=UNINITIALISED");
-        assertNotEquals(participantControlLoopUpdateMsg, copyParticipantControlLoopUpdateMsg);
+        ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
+        controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.UNINITIALISED);
+
+        assertThat(controlLoopUpdateMsg.toString()).contains("state=UNINITIALISED");
+        ControlLoopUpdate copyControlLoopUpdateMsg =
+                TestListenerUtils.createCopyControlLoopUpdateMsg(controlLoopUpdateMsg);
+        assertThat(copyControlLoopUpdateMsg.toString()).contains("state=UNINITIALISED");
+        assertNotEquals(controlLoopUpdateMsg, copyControlLoopUpdateMsg);
     }
 }
index 4579b52..7f8eb09 100644 (file)
@@ -30,8 +30,8 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop
 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.controlloop.concepts.ParticipantState;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopStateChange;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantHealthCheck;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantStateChange;
 import org.onap.policy.common.utils.coder.Coder;
@@ -137,10 +137,10 @@ public class TestListenerUtils {
     /**
      * Method to create ControlLoopUpdateMsg.
      *
-     * @return ParticipantControlLoopUpdate message
+     * @return ControlLoopUpdate message
      */
-    public static ParticipantControlLoopUpdate createControlLoopUpdateMsg() {
-        final ParticipantControlLoopUpdate clUpdateMsg = new ParticipantControlLoopUpdate();
+    public static ControlLoopUpdate createControlLoopUpdateMsg() {
+        final ControlLoopUpdate clUpdateMsg = new ControlLoopUpdate();
         ToscaConceptIdentifier controlLoopId = new ToscaConceptIdentifier();
         controlLoopId.setName("PMSHInstance0");
         controlLoopId.setVersion("1.0.0");
@@ -185,10 +185,10 @@ public class TestListenerUtils {
     /**
      * Method to create a deep copy of ControlLoopUpdateMsg.
      *
-     * @return ParticipantControlLoopUpdate message
+     * @return ControlLoopUpdate message
      */
-    public static ParticipantControlLoopUpdate createCopyControlLoopUpdateMsg(ParticipantControlLoopUpdate cpy) {
-        return new ParticipantControlLoopUpdate(cpy);
+    public static ControlLoopUpdate createCopyControlLoopUpdateMsg(ControlLoopUpdate cpy) {
+        return new ControlLoopUpdate(cpy);
     }
 
     /**
@@ -215,18 +215,18 @@ public class TestListenerUtils {
     }
 
     /**
-     * Method to create ParticipantControlLoopUpdate using the arguments passed.
+     * Method to create ControlLoopUpdate using the arguments passed.
      *
      * @param jsonFilePath the path of the controlloop content
      *
-     * @return ParticipantControlLoopUpdate message
+     * @return ControlLoopUpdate message
      * @throws CoderException exception while reading the file to object
      */
-    public static ParticipantControlLoopUpdate createParticipantClUpdateMsgFromJson(String jsonFilePath)
+    public static ControlLoopUpdate createParticipantClUpdateMsgFromJson(String jsonFilePath)
             throws CoderException {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg =
-                CODER.decode(new File(jsonFilePath), ParticipantControlLoopUpdate.class);
-        return participantControlLoopUpdateMsg;
+        ControlLoopUpdate controlLoopUpdateMsg =
+                CODER.decode(new File(jsonFilePath), ControlLoopUpdate.class);
+        return controlLoopUpdateMsg;
     }
 
     private static ToscaServiceTemplate testControlLoopRead() {
index 45674f4..a66252d 100644 (file)
@@ -26,8 +26,8 @@ import static org.junit.Assert.assertNotNull;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopStateChange;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate;
 import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ControlLoopStateChangeListener;
 import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ControlLoopUpdateListener;
@@ -55,16 +55,16 @@ class ParticipantPolicyTest {
 
     @Test
     void testUpdatePolicyTypes() {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
-        participantControlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
+        ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
+        controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
 
         // Verify that the ToscaServicetemplate has policy_types
-        assertNotNull(participantControlLoopUpdateMsg.getControlLoopDefinition().getPolicyTypes());
+        assertNotNull(controlLoopUpdateMsg.getControlLoopDefinition().getPolicyTypes());
 
         synchronized (lockit) {
             ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler);
 
-            clUpdateListener.onTopicEvent(INFRA, TOPIC, null, participantControlLoopUpdateMsg);
+            clUpdateListener.onTopicEvent(INFRA, TOPIC, null, controlLoopUpdateMsg);
         }
         // Verify the result of GET participants with what is stored
         assertEquals("org.onap.PM_Policy", participantHandler.getParticipantId().getName());
@@ -72,20 +72,20 @@ class ParticipantPolicyTest {
 
     @Test
     void testUpdatePolicies() throws Exception {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
-        participantControlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
+        ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
+        controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
 
         // Add policies to the toscaServiceTemplate
-        TestListenerUtils.addPoliciesToToscaServiceTemplate(participantControlLoopUpdateMsg.getControlLoopDefinition());
+        TestListenerUtils.addPoliciesToToscaServiceTemplate(controlLoopUpdateMsg.getControlLoopDefinition());
 
         // Verify that the ToscaServicetemplate has policies
         assertNotNull(
-                participantControlLoopUpdateMsg.getControlLoopDefinition().getToscaTopologyTemplate().getPolicies());
+                controlLoopUpdateMsg.getControlLoopDefinition().getToscaTopologyTemplate().getPolicies());
 
         synchronized (lockit) {
             ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler);
 
-            clUpdateListener.onTopicEvent(INFRA, TOPIC, null, participantControlLoopUpdateMsg);
+            clUpdateListener.onTopicEvent(INFRA, TOPIC, null, controlLoopUpdateMsg);
         }
         // Verify the result of GET participants with what is stored
         assertEquals("org.onap.PM_Policy", participantHandler.getParticipantId().getName());
@@ -93,20 +93,20 @@ class ParticipantPolicyTest {
 
     @Test
     void testDeletePoliciesAndPolicyTypes() throws Exception {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
-        participantControlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
+        ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg();
+        controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
 
         // Add policies to the toscaServiceTemplate
-        TestListenerUtils.addPoliciesToToscaServiceTemplate(participantControlLoopUpdateMsg.getControlLoopDefinition());
+        TestListenerUtils.addPoliciesToToscaServiceTemplate(controlLoopUpdateMsg.getControlLoopDefinition());
 
         // Verify that the ToscaServicetemplate has policies
         assertNotNull(
-                participantControlLoopUpdateMsg.getControlLoopDefinition().getToscaTopologyTemplate().getPolicies());
+                controlLoopUpdateMsg.getControlLoopDefinition().getToscaTopologyTemplate().getPolicies());
 
         synchronized (lockit) {
             ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler);
 
-            clUpdateListener.onTopicEvent(INFRA, TOPIC, null, participantControlLoopUpdateMsg);
+            clUpdateListener.onTopicEvent(INFRA, TOPIC, null, controlLoopUpdateMsg);
         }
         // Verify the result of GET participants with what is stored
         assertEquals("org.onap.PM_Policy", participantHandler.getParticipantId().getName());
index d439c9d..6b1b7e3 100644 (file)
@@ -35,8 +35,8 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop
 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.controlloop.concepts.ParticipantState;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopStateChange;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantHealthCheck;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantStateChange;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate;
@@ -149,10 +149,10 @@ public class TestListenerUtils {
     /**
      * Method to create ControlLoopUpdateMsg.
      *
-     * @return ParticipantControlLoopUpdate message
+     * @return ControlLoopUpdate message
      */
-    public static ParticipantControlLoopUpdate createControlLoopUpdateMsg() {
-        final ParticipantControlLoopUpdate clUpdateMsg = new ParticipantControlLoopUpdate();
+    public static ControlLoopUpdate createControlLoopUpdateMsg() {
+        final ControlLoopUpdate clUpdateMsg = new ControlLoopUpdate();
         ToscaConceptIdentifier controlLoopId = new ToscaConceptIdentifier();
         controlLoopId.setName("PMSHInstance0");
         controlLoopId.setVersion("1.0.0");
@@ -257,18 +257,18 @@ public class TestListenerUtils {
     }
 
     /**
-     * Method to create ParticipantControlLoopUpdate using the arguments passed.
+     * Method to create ControlLoopUpdate using the arguments passed.
      *
      * @param jsonFilePath the path of the controlloop content
      *
-     * @return ParticipantControlLoopUpdate message
+     * @return ControlLoopUpdate message
      * @throws CoderException exception while reading the file to object
      */
-    public static ParticipantControlLoopUpdate createParticipantClUpdateMsgFromJson(String jsonFilePath)
+    public static ControlLoopUpdate createParticipantClUpdateMsgFromJson(String jsonFilePath)
             throws CoderException {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg =
-                CODER.decode(new File(jsonFilePath), ParticipantControlLoopUpdate.class);
-        return participantControlLoopUpdateMsg;
+        ControlLoopUpdate controlLoopUpdateMsg =
+                CODER.decode(new File(jsonFilePath), ControlLoopUpdate.class);
+        return controlLoopUpdateMsg;
     }
 
     private static ToscaServiceTemplate testControlLoopRead() {
index 0b63c39..beb50da 100644 (file)
@@ -36,7 +36,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.rest.TypedSimpleResponse;
 import org.onap.policy.clamp.controlloop.participant.intermediary.api.ParticipantIntermediaryApi;
 import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ControlLoopUpdateListener;
@@ -103,10 +103,10 @@ class ParticipantSimulatorTest {
                 ControlLoopUpdateListener clUpdateListener =
                         new ControlLoopUpdateListener(participantHandler);
 
-                ParticipantControlLoopUpdate participantControlLoopUpdateMsg =
+                ControlLoopUpdate controlLoopUpdateMsg =
                         TestListenerUtils.createControlLoopUpdateMsg();
-                participantControlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
-                clUpdateListener.onTopicEvent(INFRA, TOPIC, null, participantControlLoopUpdateMsg);
+                controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE);
+                clUpdateListener.onTopicEvent(INFRA, TOPIC, null, controlLoopUpdateMsg);
 
             }
         }
index 8aa40cb..2c0c450 100644 (file)
@@ -34,8 +34,8 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop
 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.controlloop.concepts.ParticipantState;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopStateChange;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantStateChange;
 import org.onap.policy.clamp.controlloop.participant.simulator.main.parameters.CommonTestData;
 import org.onap.policy.common.utils.coder.Coder;
@@ -140,10 +140,10 @@ public class TestListenerUtils {
     /**
      * Method to create ControlLoopUpdateMsg.
      *
-     * @return ParticipantControlLoopUpdate message
+     * @return ControlLoopUpdate message
      */
-    public static ParticipantControlLoopUpdate createControlLoopUpdateMsg() {
-        final ParticipantControlLoopUpdate clUpdateMsg = new ParticipantControlLoopUpdate();
+    public static ControlLoopUpdate createControlLoopUpdateMsg() {
+        final ControlLoopUpdate clUpdateMsg = new ControlLoopUpdate();
         ToscaConceptIdentifier controlLoopId = new ToscaConceptIdentifier("PMSHInstance0", "1.0.0");
         ToscaConceptIdentifier participantId = new ToscaConceptIdentifier("org.onap.PM_CDS_Blueprint", "1.0.0");
 
@@ -183,18 +183,18 @@ public class TestListenerUtils {
     }
 
     /**
-     * Method to create ParticipantControlLoopUpdate using the arguments passed.
+     * Method to create ControlLoopUpdate using the arguments passed.
      *
      * @param jsonFilePath the path of the controlloop content
      *
-     * @return ParticipantControlLoopUpdate message
+     * @return ControlLoopUpdate message
      * @throws CoderException exception while reading the file to object
      */
-    public static ParticipantControlLoopUpdate createParticipantClUpdateMsgFromJson(String jsonFilePath)
+    public static ControlLoopUpdate createParticipantClUpdateMsgFromJson(String jsonFilePath)
             throws CoderException {
-        ParticipantControlLoopUpdate participantControlLoopUpdateMsg =
-                CODER.decode(new File(jsonFilePath), ParticipantControlLoopUpdate.class);
-        return participantControlLoopUpdateMsg;
+        ControlLoopUpdate controlLoopUpdateMsg =
+                CODER.decode(new File(jsonFilePath), ControlLoopUpdate.class);
+        return controlLoopUpdateMsg;
     }
 
     private static ToscaServiceTemplate testControlLoopRead() {
index d15643e..56bc1fd 100644 (file)
@@ -20,7 +20,7 @@
 
 package org.onap.policy.clamp.controlloop.participant.intermediary.comm;
 
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.participant.intermediary.handler.ParticipantHandler;
 import org.springframework.stereotype.Component;
 
@@ -28,7 +28,7 @@ import org.springframework.stereotype.Component;
  * Listener for Control Loop Update messages sent by CLAMP.
  */
 @Component
-public class ControlLoopUpdateListener extends ParticipantListener<ParticipantControlLoopUpdate> {
+public class ControlLoopUpdateListener extends ParticipantListener<ControlLoopUpdate> {
 
     /**
      * Constructs the object.
@@ -36,6 +36,6 @@ public class ControlLoopUpdateListener extends ParticipantListener<ParticipantCo
      * @param participantHandler the handler for managing the state of the participant
      */
     public ControlLoopUpdateListener(final ParticipantHandler participantHandler) {
-        super(ParticipantControlLoopUpdate.class, participantHandler, participantHandler::handleControlLoopUpdate);
+        super(ControlLoopUpdate.class, participantHandler, participantHandler::handleControlLoopUpdate);
     }
 }
index 50048ff..7ef9fa1 100644 (file)
@@ -34,8 +34,8 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop
 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.controlloop.concepts.ControlLoops;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopStateChange;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantResponseDetails;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantResponseStatus;
 import org.onap.policy.clamp.controlloop.participant.intermediary.api.ControlLoopElementListener;
@@ -177,7 +177,7 @@ public class ControlLoopHandler {
      *
      * @param updateMsg the update message
      */
-    public void handleControlLoopUpdate(ParticipantControlLoopUpdate updateMsg) {
+    public void handleControlLoopUpdate(ControlLoopUpdate updateMsg) {
 
         if (!updateMsg.appliesTo(participantType, participantId)) {
             return;
index 0aa5367..3867489 100644 (file)
@@ -129,7 +129,7 @@ public class IntermediaryActivator extends ServiceManagerContainer implements Cl
         msgDispatcher.register(ParticipantMessageType.PARTICIPANT_CONTROL_LOOP_STATE_CHANGE.name(),
                 applicationContext.getBean(ControlLoopStateChangeListener.class));
 
-        msgDispatcher.register(ParticipantMessageType.PARTICIPANT_CONTROL_LOOP_UPDATE.name(),
+        msgDispatcher.register(ParticipantMessageType.CONTROL_LOOP_UPDATE.name(),
                 applicationContext.getBean(ControlLoopUpdateListener.class));
 
         msgDispatcher.register(ParticipantMessageType.PARTICIPANT_REGISTER_ACK.name(),
index a8913c1..27b5389 100644 (file)
@@ -32,8 +32,8 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantHealthStatus;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState;
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantStatistics;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopStateChange;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantDeregister;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantDeregisterAck;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantHealthCheck;
@@ -153,7 +153,7 @@ public class ParticipantHandler implements Closeable {
      *
      * @param updateMsg the update message
      */
-    public void handleControlLoopUpdate(ParticipantControlLoopUpdate updateMsg) {
+    public void handleControlLoopUpdate(ControlLoopUpdate updateMsg) {
         controlLoopHandler.handleControlLoopUpdate(updateMsg);
     }
 
index 5e94d29..baf0b17 100644 (file)
@@ -36,8 +36,8 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant;
 import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ControlLoopProvider;
 import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ParticipantProvider;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopStateChange;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantDeregister;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantDeregisterAck;
 import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantMessageType;
@@ -49,8 +49,8 @@ import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.Parti
 import org.onap.policy.clamp.controlloop.runtime.commissioning.CommissioningProvider;
 import org.onap.policy.clamp.controlloop.runtime.main.parameters.ClRuntimeParameterGroup;
 import org.onap.policy.clamp.controlloop.runtime.monitoring.MonitoringProvider;
+import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ControlLoopUpdatePublisher;
 import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantControlLoopStateChangePublisher;
-import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantControlLoopUpdatePublisher;
 import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantDeregisterAckPublisher;
 import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantRegisterAckPublisher;
 import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantStateChangePublisher;
@@ -88,7 +88,7 @@ public class SupervisionHandler {
     private final CommissioningProvider commissioningProvider;
 
     // Publishers for participant communication
-    private final ParticipantControlLoopUpdatePublisher controlLoopUpdatePublisher;
+    private final ControlLoopUpdatePublisher controlLoopUpdatePublisher;
     private final ParticipantControlLoopStateChangePublisher controlLoopStateChangePublisher;
     private final ParticipantRegisterAckPublisher participantRegisterAckPublisher;
     private final ParticipantDeregisterAckPublisher participantDeregisterAckPublisher;
@@ -291,13 +291,13 @@ public class SupervisionHandler {
     }
 
     private void sendControlLoopUpdate(ControlLoop controlLoop) throws PfModelException {
-        var pclu = new ParticipantControlLoopUpdate();
-        pclu.setControlLoopId(controlLoop.getKey().asIdentifier());
-        pclu.setControlLoop(controlLoop);
+        var controlLoopUpdateMsg = new ControlLoopUpdate();
+        controlLoopUpdateMsg.setControlLoopId(controlLoop.getKey().asIdentifier());
+        controlLoopUpdateMsg.setControlLoop(controlLoop);
         // TODO: We should look up the correct TOSCA node template here for the control loop
         // Tiny hack implemented to return the tosca service template entry from the database and be passed onto dmaap
-        pclu.setControlLoopDefinition(commissioningProvider.getToscaServiceTemplate(null, null));
-        controlLoopUpdatePublisher.send(pclu);
+        controlLoopUpdateMsg.setControlLoopDefinition(commissioningProvider.getToscaServiceTemplate(null, null));
+        controlLoopUpdatePublisher.send(controlLoopUpdateMsg);
     }
 
     private void sendControlLoopStateChange(ControlLoop controlLoop) {
 package org.onap.policy.clamp.controlloop.runtime.supervision.comm;
 
 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop;
-import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantControlLoopUpdate;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate;
 import org.onap.policy.clamp.controlloop.runtime.commissioning.CommissioningProvider;
 import org.onap.policy.models.base.PfModelException;
 import org.springframework.stereotype.Component;
 
 /**
- * This class is used to send ParticipantControlLoopUpdate messages to participants on DMaaP.
+ * This class is used to send ControlLoopUpdate messages to participants on DMaaP.
  */
 @Component
-public class ParticipantControlLoopUpdatePublisher extends AbstractParticipantPublisher<ParticipantControlLoopUpdate> {
+public class ControlLoopUpdatePublisher extends AbstractParticipantPublisher<ControlLoopUpdate> {
 
     private final CommissioningProvider commissioningProvider;
 
@@ -39,7 +39,7 @@ public class ParticipantControlLoopUpdatePublisher extends AbstractParticipantPu
      *
      * @param commissioningProvider the CommissioningProvider
      */
-    public ParticipantControlLoopUpdatePublisher(CommissioningProvider commissioningProvider) {
+    public ControlLoopUpdatePublisher(CommissioningProvider commissioningProvider) {
         this.commissioningProvider = commissioningProvider;
     }
 
@@ -50,7 +50,7 @@ public class ParticipantControlLoopUpdatePublisher extends AbstractParticipantPu
      * @throws PfModelException on errors getting the Control Loop Definition
      */
     public void send(ControlLoop controlLoop) throws PfModelException {
-        var pclu = new ParticipantControlLoopUpdate();
+        var pclu = new ControlLoopUpdate();
         pclu.setControlLoopId(controlLoop.getKey().asIdentifier());
         pclu.setControlLoop(controlLoop);
         // TODO: We should look up the correct TOSCA node template here for the control loop
index b474b0c..9fd1ea3 100644 (file)
@@ -43,8 +43,8 @@ import org.onap.policy.clamp.controlloop.runtime.commissioning.CommissioningProv
 import org.onap.policy.clamp.controlloop.runtime.main.parameters.ClRuntimeParameterGroup;
 import org.onap.policy.clamp.controlloop.runtime.monitoring.MonitoringProvider;
 import org.onap.policy.clamp.controlloop.runtime.supervision.SupervisionHandler;
+import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ControlLoopUpdatePublisher;
 import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantControlLoopStateChangePublisher;
-import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantControlLoopUpdatePublisher;
 import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantDeregisterAckPublisher;
 import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantRegisterAckPublisher;
 import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantUpdatePublisher;
@@ -113,7 +113,7 @@ class ControlLoopInstantiationProviderTest {
         var monitoringProvider =
                 new MonitoringProvider(participantStatisticsProvider, clElementStatisticsProvider, clProvider);
         var participantProvider = new ParticipantProvider(controlLoopParameters.getDatabaseProviderParameters());
-        var controlLoopUpdatePublisher = Mockito.mock(ParticipantControlLoopUpdatePublisher.class);
+        var controlLoopUpdatePublisher = Mockito.mock(ControlLoopUpdatePublisher.class);
         var controlLoopStateChangePublisher = Mockito.mock(ParticipantControlLoopStateChangePublisher.class);
         var participantRegisterAckPublisher = Mockito.mock(ParticipantRegisterAckPublisher.class);
         var participantDeregisterAckPublisher = Mockito.mock(ParticipantDeregisterAckPublisher.class);
index 305850c..ad6d7cc 100644 (file)
@@ -90,7 +90,7 @@ class SupervisionMessagesTest extends CommonRestController {
         var monitoringProvider =
                 new MonitoringProvider(participantStatisticsProvider, clElementStatisticsProvider, clProvider);
         var participantProvider = new ParticipantProvider(controlLoopParameters.getDatabaseProviderParameters());
-        var controlLoopUpdatePublisher = Mockito.mock(ParticipantControlLoopUpdatePublisher.class);
+        var controlLoopUpdatePublisher = Mockito.mock(ControlLoopUpdatePublisher.class);
         var controlLoopStateChangePublisher = Mockito.mock(ParticipantControlLoopStateChangePublisher.class);
         var participantRegisterAckPublisher = Mockito.mock(ParticipantRegisterAckPublisher.class);
         var participantDeregisterAckPublisher = Mockito.mock(ParticipantDeregisterAckPublisher.class);