aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-intermediary
diff options
context:
space:
mode:
Diffstat (limited to 'participant/participant-intermediary')
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/AutomationCompositionDeployListener.java (renamed from participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/AutomationCompositionUpdateListener.java)16
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java4
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java30
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java6
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java8
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java26
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java2
7 files changed, 46 insertions, 46 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/AutomationCompositionUpdateListener.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/AutomationCompositionDeployListener.java
index 6c5dc127d..412d26e2e 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/AutomationCompositionUpdateListener.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/AutomationCompositionDeployListener.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,28 +21,28 @@
package org.onap.policy.clamp.acm.participant.intermediary.comm;
import org.onap.policy.clamp.acm.participant.intermediary.handler.ParticipantHandler;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionUpdate;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeploy;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType;
import org.springframework.stereotype.Component;
/**
- * Listener for Automation Composition Update messages sent by ACM.
+ * Listener for Automation Composition Deploy messages sent by ACM.
*/
@Component
-public class AutomationCompositionUpdateListener extends ParticipantListener<AutomationCompositionUpdate> {
+public class AutomationCompositionDeployListener extends ParticipantListener<AutomationCompositionDeploy> {
/**
* Constructs the object.
*
* @param participantHandler the handler for managing the state of the participant
*/
- public AutomationCompositionUpdateListener(final ParticipantHandler participantHandler) {
- super(AutomationCompositionUpdate.class, participantHandler,
- participantHandler::handleAutomationCompositionUpdate);
+ public AutomationCompositionDeployListener(final ParticipantHandler participantHandler) {
+ super(AutomationCompositionDeploy.class, participantHandler,
+ participantHandler::handleAutomationCompositionDeploy);
}
@Override
public String getType() {
- return ParticipantMessageType.AUTOMATION_COMPOSITION_UPDATE.name();
+ return ParticipantMessageType.AUTOMATION_COMPOSITION_DEPLOY.name();
}
}
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java
index 9023d9460..b18875813 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java
@@ -26,7 +26,7 @@ import java.util.List;
import javax.ws.rs.core.Response.Status;
import org.onap.policy.clamp.acm.participant.intermediary.handler.Publisher;
import org.onap.policy.clamp.common.acm.exception.AutomationCompositionRuntimeException;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionAck;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeployAck;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregister;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegister;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatus;
@@ -118,7 +118,7 @@ public class ParticipantMessagePublisher implements Publisher {
*/
@Timed(value = "publisher.automation_composition_update_ack",
description = "AUTOMATION_COMPOSITION_UPDATE_ACK/AUTOMATION_COMPOSITION_STATECHANGE_ACK messages published")
- public void sendAutomationCompositionAck(final AutomationCompositionAck automationCompositionAck) {
+ public void sendAutomationCompositionAck(final AutomationCompositionDeployAck automationCompositionAck) {
validate();
topicSinkClient.send(automationCompositionAck);
LOGGER.debug("Sent AutomationComposition Update/StateChange Ack to runtime - {}", automationCompositionAck);
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java
index 422fc3e23..f2fd636e9 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java
@@ -32,17 +32,17 @@ import lombok.Getter;
import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationCompositionElementListener;
import org.onap.policy.clamp.acm.participant.intermediary.comm.ParticipantMessagePublisher;
import org.onap.policy.clamp.acm.participant.intermediary.parameters.ParticipantParameters;
+import org.onap.policy.clamp.models.acm.concepts.AcElementDeployAck;
import org.onap.policy.clamp.models.acm.concepts.AutomationComposition;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement;
-import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementAck;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState;
-import org.onap.policy.clamp.models.acm.concepts.ParticipantUpdates;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantDeploy;
import org.onap.policy.clamp.models.acm.concepts.ParticipantUtils;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionAck;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeploy;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeployAck;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionStateChange;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionUpdate;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
@@ -121,13 +121,13 @@ public class AutomationCompositionHandler {
var acElement = elementsOnThisParticipant.get(id);
if (acElement != null) {
var automationCompositionStateChangeAck =
- new AutomationCompositionAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK);
+ new AutomationCompositionDeployAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK);
automationCompositionStateChangeAck.setParticipantId(participantId);
automationCompositionStateChangeAck.setAutomationCompositionId(automationCompositionId);
acElement.setOrderedState(orderedState);
acElement.setState(newState);
automationCompositionStateChangeAck.getAutomationCompositionResultMap().put(acElement.getId(),
- new AutomationCompositionElementAck(newState, true,
+ new AcElementDeployAck(newState, null, true,
"Automation composition element {} state changed to {}\", id, newState)"));
LOGGER.debug("Automation composition element {} state changed to {}", id, newState);
automationCompositionStateChangeAck
@@ -155,7 +155,7 @@ public class AutomationCompositionHandler {
if (automationComposition == null) {
var automationCompositionAck =
- new AutomationCompositionAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK);
+ new AutomationCompositionDeployAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK);
automationCompositionAck.setParticipantId(participantId);
automationCompositionAck.setMessage("Automation composition " + stateChangeMsg.getAutomationCompositionId()
+ " does not use this participant " + participantId);
@@ -200,12 +200,12 @@ public class AutomationCompositionHandler {
}
/**
- * Handle a automation composition update message.
+ * Handle a automation composition Deploy message.
*
- * @param updateMsg the update message
+ * @param updateMsg the Deploy message
* @param acElementDefinitions the list of AutomationCompositionElementDefinition
*/
- public void handleAutomationCompositionUpdate(AutomationCompositionUpdate updateMsg,
+ public void handleAutomationCompositionDeploy(AutomationCompositionDeploy updateMsg,
List<AutomationCompositionElementDefinition> acElementDefinitions) {
if (!updateMsg.appliesTo(participantId)) {
@@ -219,7 +219,7 @@ public class AutomationCompositionHandler {
}
}
- private void handleAcUpdatePhase0(AutomationCompositionUpdate updateMsg,
+ private void handleAcUpdatePhase0(AutomationCompositionDeploy updateMsg,
List<AutomationCompositionElementDefinition> acElementDefinitions) {
var automationComposition = automationCompositionMap.get(updateMsg.getAutomationCompositionId());
@@ -228,7 +228,7 @@ public class AutomationCompositionHandler {
// elements to existing AutomationComposition has to be supported).
if (automationComposition != null) {
var automationCompositionUpdateAck =
- new AutomationCompositionAck(ParticipantMessageType.AUTOMATION_COMPOSITION_UPDATE_ACK);
+ new AutomationCompositionDeployAck(ParticipantMessageType.AUTOMATION_COMPOSITION_DEPLOY_ACK);
automationCompositionUpdateAck.setParticipantId(participantId);
automationCompositionUpdateAck.setMessage("Automation composition " + updateMsg.getAutomationCompositionId()
@@ -257,7 +257,7 @@ public class AutomationCompositionHandler {
updateMsg.getAutomationCompositionId());
}
- private void handleAcUpdatePhaseN(AutomationCompositionUpdate updateMsg,
+ private void handleAcUpdatePhaseN(AutomationCompositionDeploy updateMsg,
List<AutomationCompositionElementDefinition> acElementDefinitions) {
var acElementList = updateMsg.getParticipantUpdatesList().stream()
@@ -303,7 +303,7 @@ public class AutomationCompositionHandler {
}
private List<AutomationCompositionElement> storeElementsOnThisParticipant(
- List<ParticipantUpdates> participantUpdates) {
+ List<ParticipantDeploy> participantUpdates) {
var acElementList = participantUpdates.stream()
.flatMap(participantUpdate -> participantUpdate.getAutomationCompositionElementList().stream())
.filter(element -> participantId.equals(element.getParticipantId())).collect(Collectors.toList());
@@ -386,7 +386,7 @@ public class AutomationCompositionHandler {
if (orderedState.equals(automationComposition.getOrderedState())) {
var automationCompositionAck =
- new AutomationCompositionAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK);
+ new AutomationCompositionDeployAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK);
automationCompositionAck.setParticipantId(participantId);
automationCompositionAck.setMessage("Automation composition is already in state " + orderedState);
automationCompositionAck.setResult(false);
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java
index 75f2d81ab..050d66d0b 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java
@@ -36,8 +36,8 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionInfo;
import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition;
import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
import org.onap.policy.clamp.models.acm.concepts.ParticipantSupportedElementType;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeploy;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionStateChange;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionUpdate;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantAckMessage;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregister;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregisterAck;
@@ -103,8 +103,8 @@ public class ParticipantHandler {
@Timed(
value = "listener.automation_composition_update",
description = "AUTOMATION_COMPOSITION_UPDATE messages received")
- public void handleAutomationCompositionUpdate(AutomationCompositionUpdate updateMsg) {
- automationCompositionHandler.handleAutomationCompositionUpdate(updateMsg,
+ public void handleAutomationCompositionDeploy(AutomationCompositionDeploy updateMsg) {
+ automationCompositionHandler.handleAutomationCompositionDeploy(updateMsg,
acElementDefsMap.get(updateMsg.getCompositionId()));
}
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
index f8db70cc9..d9d99da4e 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.onap.policy.clamp.acm.participant.intermediary.main.parameters.CommonTestData;
import org.onap.policy.clamp.common.acm.exception.AutomationCompositionRuntimeException;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionAck;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeployAck;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregister;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegister;
@@ -59,8 +59,8 @@ class ParticipantCommTest {
var participantUpdateListener = new ParticipantUpdateListener(participantHandler);
assertEquals(ParticipantMessageType.PARTICIPANT_UPDATE.name(), participantUpdateListener.getType());
- var automationCompositionUpdateListener = new AutomationCompositionUpdateListener(participantHandler);
- assertEquals(ParticipantMessageType.AUTOMATION_COMPOSITION_UPDATE.name(),
+ var automationCompositionUpdateListener = new AutomationCompositionDeployListener(participantHandler);
+ assertEquals(ParticipantMessageType.AUTOMATION_COMPOSITION_DEPLOY.name(),
automationCompositionUpdateListener.getType());
var automationCompositionStateChangeListener = new AutomationCompositionStateChangeListener(participantHandler);
@@ -86,7 +86,7 @@ class ParticipantCommTest {
assertThrows(AutomationCompositionRuntimeException.class,
() -> participantMessagePublisher.sendParticipantDeregister(participantDeregister));
- var automationCompositionAck = Mockito.mock(AutomationCompositionAck.class);
+ var automationCompositionAck = Mockito.mock(AutomationCompositionDeployAck.class);
assertThrows(AutomationCompositionRuntimeException.class,
() -> participantMessagePublisher.sendAutomationCompositionAck(automationCompositionAck));
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java
index 6698ef9a8..ae8a8b2a0 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java
@@ -37,9 +37,9 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState;
-import org.onap.policy.clamp.models.acm.concepts.ParticipantUpdates;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantDeploy;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeploy;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionStateChange;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionUpdate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
import org.springframework.test.context.junit.jupiter.SpringExtension;
@@ -124,36 +124,36 @@ class AutomationCompositionHandlerTest {
var acd = new AutomationCompositionElementDefinition();
acd.setAcElementDefinitionId(definition);
- var updateMsg = new AutomationCompositionUpdate();
+ var updateMsg = new AutomationCompositionDeploy();
updateMsg.setAutomationCompositionId(UUID.randomUUID());
updateMsg.setMessageId(uuid);
updateMsg.setParticipantId(partecipantId);
updateMsg.setStartPhase(0);
var acElementDefinitions = List.of(acd);
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, acElementDefinitions));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, acElementDefinitions));
updateMsg.setStartPhase(1);
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, acElementDefinitions));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, acElementDefinitions));
ach.getAutomationCompositionMap().clear();
updateMsg.setStartPhase(0);
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, acElementDefinitions));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, acElementDefinitions));
updateMsg.setAutomationCompositionId(UUID.randomUUID());
- updateMsg.setParticipantUpdatesList(List.of(mock(ParticipantUpdates.class)));
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, acElementDefinitions));
+ updateMsg.setParticipantUpdatesList(List.of(mock(ParticipantDeploy.class)));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, acElementDefinitions));
updateMsg.setStartPhase(1);
- var participantUpdate = new ParticipantUpdates();
- participantUpdate.setParticipantId(partecipantId);
+ var participantDeploy = new ParticipantDeploy();
+ participantDeploy.setParticipantId(partecipantId);
var element = new AutomationCompositionElement();
element.setDefinition(definition);
- participantUpdate.setAutomationCompositionElementList(List.of(element));
- updateMsg.setParticipantUpdatesList(List.of(participantUpdate));
+ participantDeploy.setAutomationCompositionElementList(List.of(element));
+ updateMsg.setParticipantUpdatesList(List.of(participantDeploy));
var acd2 = new AutomationCompositionElementDefinition();
acd2.setAcElementDefinitionId(definition);
acd2.setAutomationCompositionElementToscaNodeTemplate(mock(ToscaNodeTemplate.class));
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, List.of(acd2)));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, List.of(acd2)));
}
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java
index dc04440ca..9f1bf29be 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java
@@ -97,7 +97,7 @@ class ParticipantHandlerTest {
void checkAppliesTo() {
var participantHandler = commonTestData.getMockParticipantHandler();
var participantAckMsg =
- new ParticipantAckMessage(ParticipantMessageType.AUTOMATION_COMPOSITION_UPDATE);
+ new ParticipantAckMessage(ParticipantMessageType.AUTOMATION_COMPOSITION_DEPLOY);
assertTrue(participantHandler.appliesTo(participantAckMsg));
var participantMsg =