summaryrefslogtreecommitdiffstats
path: root/runtime-controlloop
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2021-07-23 08:23:27 +0000
committerGerrit Code Review <gerrit@onap.org>2021-07-23 08:23:27 +0000
commit096c230515b1dc2f773e8742725c9e78444ee4f3 (patch)
tree4969648e8d643465cfc2dcf9a9d3a95220c4068d /runtime-controlloop
parent9218688ef4ad609319a15310c1a87058d042adc1 (diff)
parent22a633cd19d236a6e73d849b3198f654ceb0fc48 (diff)
Merge "Rename ParticipantControlLoopUpdate message"
Diffstat (limited to 'runtime-controlloop')
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java16
-rw-r--r--runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java (renamed from runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantControlLoopUpdatePublisher.java)10
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java4
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java2
4 files changed, 16 insertions, 16 deletions
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
index 5e94d293e..baf0b176d 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java
@@ -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) {
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantControlLoopUpdatePublisher.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java
index 8d40c5e69..e562343ff 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantControlLoopUpdatePublisher.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java
@@ -21,16 +21,16 @@
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
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
index b474b0cdf..9fd1ea35f 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
@@ -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);
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
index 305850cbd..ad6d7ccd6 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
@@ -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);