diff options
author | saul.gill <saul.gill@est.tech> | 2023-02-02 11:40:29 +0000 |
---|---|---|
committer | saul.gill <saul.gill@est.tech> | 2023-02-02 11:40:35 +0000 |
commit | 9659c99c9c8b4b7ce33d7f48e61df44a03090186 (patch) | |
tree | d04b196466e12895183e95ac7885427ca5482e69 /participant/participant-intermediary/src/main | |
parent | 203a14a0c5397096f4b6918cd587248ea275e245 (diff) |
Refactor ParticipantUpdate to ParticipantPrime
Refactored ParticipantUpdateAck to ParticipantPrimeAck
Refactored ParticipantUpdate to ParticipantPrime
Refactored all associated tests and code
Issue-ID: POLICY-4548
Change-Id: I2265777add4e088173ec465603e26143e3f40070
Signed-off-by: saul.gill <saul.gill@est.tech>
Diffstat (limited to 'participant/participant-intermediary/src/main')
-rw-r--r-- | participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantMessagePublisher.java | 14 | ||||
-rw-r--r-- | participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantPrimeListener.java (renamed from participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantUpdateListener.java) | 14 | ||||
-rw-r--r-- | participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java | 48 |
3 files changed, 38 insertions, 38 deletions
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 b18875813..4c885fa26 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 @@ -28,9 +28,9 @@ 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.AutomationCompositionDeployAck; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregister; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrimeAck; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegister; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatus; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdateAck; import org.onap.policy.common.endpoints.event.comm.TopicSink; import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient; import org.slf4j.Logger; @@ -100,15 +100,15 @@ public class ParticipantMessagePublisher implements Publisher { } /** - * Method to send Participant Update Ack message to runtime. + * Method to send Participant Prime Ack message to runtime. * - * @param participantUpdateAck the Participant Update Ack + * @param participantPrimeAck the Participant Prime Ack */ - @Timed(value = "publisher.participant_update_ack", description = "PARTICIPANT_UPDATE_ACK messages published") - public void sendParticipantUpdateAck(final ParticipantUpdateAck participantUpdateAck) { + @Timed(value = "publisher.participant_prime_ack", description = "PARTICIPANT_PRIME_ACK messages published") + public void sendParticipantPrimeAck(final ParticipantPrimeAck participantPrimeAck) { validate(); - topicSinkClient.send(participantUpdateAck); - LOGGER.debug("Sent Participant Update Ack message to CLAMP - {}", participantUpdateAck); + topicSinkClient.send(participantPrimeAck); + LOGGER.debug("Sent Participant Prime Ack message to CLAMP - {}", participantPrimeAck); } /** diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantUpdateListener.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantPrimeListener.java index 19eb5fb30..e114c74f9 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantUpdateListener.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantPrimeListener.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2021-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. @@ -22,26 +22,26 @@ 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.ParticipantMessageType; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdate; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrime; import org.springframework.stereotype.Component; /** - * Listener for Participant Update messages sent by runtime. + * Listener for Participant Prime messages sent by runtime. */ @Component -public class ParticipantUpdateListener extends ParticipantListener<ParticipantUpdate> { +public class ParticipantPrimeListener extends ParticipantListener<ParticipantPrime> { /** * Constructs the object. * * @param participantHandler the handler for managing the state of the participant */ - public ParticipantUpdateListener(final ParticipantHandler participantHandler) { - super(ParticipantUpdate.class, participantHandler, participantHandler::handleParticipantUpdate); + public ParticipantPrimeListener(final ParticipantHandler participantHandler) { + super(ParticipantPrime.class, participantHandler, participantHandler::handleParticipantPrime); } @Override public String getType() { - return ParticipantMessageType.PARTICIPANT_UPDATE.name(); + return ParticipantMessageType.PARTICIPANT_PRIME.name(); } } 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 050d66d0b..3aae2c41a 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 @@ -42,12 +42,12 @@ import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantAc import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregister; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregisterAck; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessage; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrime; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrimeAck; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegister; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegisterAck; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatus; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatusReq; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdate; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdateAck; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -186,44 +186,44 @@ public class ParticipantHandler { } /** - * Handle a ParticipantUpdate message. + * Handle a ParticipantPrime message. * - * @param participantUpdateMsg the ParticipantUpdate message + * @param participantPrimeMsg the ParticipantPrime message */ - @Timed(value = "listener.participant_update", description = "PARTICIPANT_UPDATE messages received") - public void handleParticipantUpdate(ParticipantUpdate participantUpdateMsg) { - LOGGER.debug("ParticipantUpdate message received for participantId {}", - participantUpdateMsg.getParticipantId()); + @Timed(value = "listener.participant_prime", description = "PARTICIPANT_PRIME messages received") + public void handleParticipantPrime(ParticipantPrime participantPrimeMsg) { + LOGGER.debug("ParticipantPrime message received for participantId {}", + participantPrimeMsg.getParticipantId()); - acElementDefsMap.putIfAbsent(participantUpdateMsg.getCompositionId(), new ArrayList<>()); - if (!participantUpdateMsg.getParticipantDefinitionUpdates().isEmpty()) { + acElementDefsMap.putIfAbsent(participantPrimeMsg.getCompositionId(), new ArrayList<>()); + if (!participantPrimeMsg.getParticipantDefinitionUpdates().isEmpty()) { // This message is to commission the automation composition - for (var participantDefinition : participantUpdateMsg.getParticipantDefinitionUpdates()) { + for (var participantDefinition : participantPrimeMsg.getParticipantDefinitionUpdates()) { if (participantDefinition.getParticipantId().equals(participantId)) { - acElementDefsMap.get(participantUpdateMsg.getCompositionId()) + acElementDefsMap.get(participantPrimeMsg.getCompositionId()) .addAll(participantDefinition.getAutomationCompositionElementDefinitionList()); break; } } } else { // This message is to decommission the automation composition - acElementDefsMap.get(participantUpdateMsg.getCompositionId()).clear(); + acElementDefsMap.get(participantPrimeMsg.getCompositionId()).clear(); } - sendParticipantUpdateAck(participantUpdateMsg.getMessageId(), participantUpdateMsg.getCompositionId()); + sendParticipantPrimeAck(participantPrimeMsg.getMessageId(), participantPrimeMsg.getCompositionId()); } /** - * Method to send ParticipantUpdateAck message to automation composition runtime. + * Method to send ParticipantPrimeAck message to automation composition runtime. */ - public void sendParticipantUpdateAck(UUID messageId, UUID compositionId) { - var participantUpdateAck = new ParticipantUpdateAck(); - participantUpdateAck.setResponseTo(messageId); - participantUpdateAck.setCompositionId(compositionId); - participantUpdateAck.setMessage("Participant Update Ack message"); - participantUpdateAck.setResult(true); - participantUpdateAck.setParticipantId(participantId); - participantUpdateAck.setState(ParticipantState.ON_LINE); - publisher.sendParticipantUpdateAck(participantUpdateAck); + public void sendParticipantPrimeAck(UUID messageId, UUID compositionId) { + var participantPrimeAck = new ParticipantPrimeAck(); + participantPrimeAck.setResponseTo(messageId); + participantPrimeAck.setCompositionId(compositionId); + participantPrimeAck.setMessage("Participant Prime Ack message"); + participantPrimeAck.setResult(true); + participantPrimeAck.setParticipantId(participantId); + participantPrimeAck.setState(ParticipantState.ON_LINE); + publisher.sendParticipantPrimeAck(participantPrimeAck); } /** |