diff options
author | saul.gill <saul.gill@est.tech> | 2023-01-23 17:44:13 +0000 |
---|---|---|
committer | saul.gill <saul.gill@est.tech> | 2023-01-26 09:27:28 +0000 |
commit | 73d0c089fe3e3019e8caa54a60a4c76de5edd72a (patch) | |
tree | 3197ed2af3da4a57abf8226c1cf21e6500a42444 /participant/participant-intermediary/src/main | |
parent | db615d9fed370c7896a638704d00807c19b6f5d3 (diff) |
Remove participantType and references
Issue-ID: POLICY-4538
Change-Id: Idf3f0308254a318b3e72aa8a234fd7c78f6ffd82
Signed-off-by: saul.gill <saul.gill@est.tech>
Diffstat (limited to 'participant/participant-intermediary/src/main')
3 files changed, 7 insertions, 29 deletions
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 49b16d23d..422fc3e23 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 @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021-2022 Nordix Foundation. + * Copyright (C) 2021-2023 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -58,7 +58,6 @@ import org.springframework.stereotype.Component; public class AutomationCompositionHandler { private static final Logger LOGGER = LoggerFactory.getLogger(AutomationCompositionHandler.class); - private final ToscaConceptIdentifier participantType; private final UUID participantId; private final ParticipantMessagePublisher publisher; @@ -78,7 +77,6 @@ public class AutomationCompositionHandler { * @param publisher the ParticipantMessage Publisher */ public AutomationCompositionHandler(ParticipantParameters parameters, ParticipantMessagePublisher publisher) { - this.participantType = parameters.getIntermediaryParameters().getParticipantType(); this.participantId = parameters.getIntermediaryParameters().getParticipantId(); this.publisher = publisher; } @@ -125,7 +123,6 @@ public class AutomationCompositionHandler { var automationCompositionStateChangeAck = new AutomationCompositionAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK); automationCompositionStateChangeAck.setParticipantId(participantId); - automationCompositionStateChangeAck.setParticipantType(participantType); automationCompositionStateChangeAck.setAutomationCompositionId(automationCompositionId); acElement.setOrderedState(orderedState); acElement.setState(newState); @@ -160,7 +157,6 @@ public class AutomationCompositionHandler { var automationCompositionAck = new AutomationCompositionAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK); automationCompositionAck.setParticipantId(participantId); - automationCompositionAck.setParticipantType(participantType); automationCompositionAck.setMessage("Automation composition " + stateChangeMsg.getAutomationCompositionId() + " does not use this participant " + participantId); automationCompositionAck.setResult(false); @@ -212,7 +208,7 @@ public class AutomationCompositionHandler { public void handleAutomationCompositionUpdate(AutomationCompositionUpdate updateMsg, List<AutomationCompositionElementDefinition> acElementDefinitions) { - if (!updateMsg.appliesTo(participantType, participantId)) { + if (!updateMsg.appliesTo(participantId)) { return; } @@ -234,7 +230,6 @@ public class AutomationCompositionHandler { var automationCompositionUpdateAck = new AutomationCompositionAck(ParticipantMessageType.AUTOMATION_COMPOSITION_UPDATE_ACK); automationCompositionUpdateAck.setParticipantId(participantId); - automationCompositionUpdateAck.setParticipantType(participantType); automationCompositionUpdateAck.setMessage("Automation composition " + updateMsg.getAutomationCompositionId() + " already defined on participant " + participantId); @@ -267,7 +262,7 @@ public class AutomationCompositionHandler { var acElementList = updateMsg.getParticipantUpdatesList().stream() .flatMap(participantUpdate -> participantUpdate.getAutomationCompositionElementList().stream()) - .filter(element -> participantType.equals(element.getParticipantType())).collect(Collectors.toList()); + .filter(element -> participantId.equals(element.getParticipantId())).collect(Collectors.toList()); handleAutomationCompositionElementUpdate(acElementList, acElementDefinitions, updateMsg.getStartPhase(), updateMsg.getAutomationCompositionId()); @@ -311,7 +306,7 @@ public class AutomationCompositionHandler { List<ParticipantUpdates> participantUpdates) { var acElementList = participantUpdates.stream() .flatMap(participantUpdate -> participantUpdate.getAutomationCompositionElementList().stream()) - .filter(element -> participantType.equals(element.getParticipantType())).collect(Collectors.toList()); + .filter(element -> participantId.equals(element.getParticipantId())).collect(Collectors.toList()); for (var element : acElementList) { elementsOnThisParticipant.put(element.getId(), element); @@ -393,7 +388,6 @@ public class AutomationCompositionHandler { var automationCompositionAck = new AutomationCompositionAck(ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK); automationCompositionAck.setParticipantId(participantId); - automationCompositionAck.setParticipantType(participantType); automationCompositionAck.setMessage("Automation composition is already in state " + orderedState); automationCompositionAck.setResult(false); automationCompositionAck.setAutomationCompositionId(automationComposition.getInstanceId()); 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 7e881b59d..f324cea0c 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 @@ -48,7 +48,6 @@ import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantSt 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.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -61,9 +60,6 @@ public class ParticipantHandler { private static final Logger LOGGER = LoggerFactory.getLogger(ParticipantHandler.class); @Getter - private final ToscaConceptIdentifier participantType; - - @Getter private final UUID participantId; private final AutomationCompositionHandler automationCompositionHandler; @@ -81,7 +77,6 @@ public class ParticipantHandler { */ public ParticipantHandler(ParticipantParameters parameters, ParticipantMessagePublisher publisher, AutomationCompositionHandler automationCompositionHandler) { - this.participantType = parameters.getIntermediaryParameters().getParticipantType(); this.participantId = parameters.getIntermediaryParameters().getParticipantId(); this.publisher = publisher; this.automationCompositionHandler = automationCompositionHandler; @@ -133,7 +128,7 @@ public class ParticipantHandler { * @return true if it applies, false otherwise */ public boolean appliesTo(ParticipantMessage participantMsg) { - return participantMsg.appliesTo(participantType, participantId); + return participantMsg.appliesTo(participantId); } /** @@ -143,7 +138,7 @@ public class ParticipantHandler { * @return true if it applies, false otherwise */ public boolean appliesTo(ParticipantAckMessage participantMsg) { - return participantMsg.appliesTo(participantType, participantId); + return participantMsg.appliesTo(participantId); } /** @@ -152,7 +147,6 @@ public class ParticipantHandler { public void sendParticipantRegister() { var participantRegister = new ParticipantRegister(); participantRegister.setParticipantId(participantId); - participantRegister.setParticipantType(participantType); participantRegister.setParticipantSupportedElementType(supportedAcElementTypes); publisher.sendParticipantRegister(participantRegister); @@ -176,7 +170,6 @@ public class ParticipantHandler { public void sendParticipantDeregister() { var participantDeregister = new ParticipantDeregister(); participantDeregister.setParticipantId(participantId); - participantDeregister.setParticipantType(participantType); publisher.sendParticipantDeregister(participantDeregister); } @@ -206,7 +199,7 @@ public class ParticipantHandler { if (!participantUpdateMsg.getParticipantDefinitionUpdates().isEmpty()) { // This message is to commission the automation composition for (var participantDefinition : participantUpdateMsg.getParticipantDefinitionUpdates()) { - if (participantDefinition.getParticipantType().equals(participantType)) { + if (participantDefinition.getParticipantId().equals(participantId)) { acElementDefsMap.get(participantUpdateMsg.getCompositionId()) .addAll(participantDefinition.getAutomationCompositionElementDefinitionList()); break; @@ -228,7 +221,6 @@ public class ParticipantHandler { participantUpdateAck.setMessage("Participant Update Ack message"); participantUpdateAck.setResult(true); participantUpdateAck.setParticipantId(participantId); - participantUpdateAck.setParticipantType(participantType); participantUpdateAck.setState(ParticipantState.ON_LINE); publisher.sendParticipantUpdateAck(participantUpdateAck); } @@ -246,7 +238,6 @@ public class ParticipantHandler { public ParticipantStatus makeHeartbeat(boolean responseToParticipantStatusReq) { var heartbeat = new ParticipantStatus(); heartbeat.setParticipantId(participantId); - heartbeat.setParticipantType(participantType); heartbeat.setState(ParticipantState.ON_LINE); heartbeat.setAutomationCompositionInfoList(getAutomationCompositionInfoList()); @@ -255,7 +246,6 @@ public class ParticipantHandler { for (var acElementDefsOnThisParticipant : acElementDefsMap.values()) { var participantDefinition = new ParticipantDefinition(); participantDefinition.setParticipantId(participantId); - participantDefinition.setParticipantType(participantType); participantDefinition.setAutomationCompositionElementDefinitionList(acElementDefsOnThisParticipant); participantDefinitionList.add(participantDefinition); } diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java index 8f32c6f9a..77a578ea8 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java @@ -31,7 +31,6 @@ import lombok.Setter; import org.onap.policy.clamp.models.acm.concepts.ParticipantSupportedElementType; import org.onap.policy.common.endpoints.parameters.TopicParameterGroup; import org.onap.policy.common.parameters.validation.ParameterGroupConstraint; -import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; /** * Class to hold all parameters needed for participant component. @@ -48,11 +47,6 @@ public class ParticipantIntermediaryParameters { @NotBlank private String description; - // The participant type of this participant - @NotNull - @Valid - private ToscaConceptIdentifier participantType; - // The time interval for periodic reporting of status to the CLAMP ACM server @Valid @Positive |