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 /runtime-acm/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 'runtime-acm/src/main')
4 files changed, 14 insertions, 22 deletions
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java index 53288d15e..b7e7644ef 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.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"); @@ -253,10 +253,10 @@ public class AutomationCompositionInstantiationProvider { subResult.addResult(new ObjectValidationResult(AUTOMATION_COMPOSITION_NODE_ELEMENT_TYPE, element.getDefinition().getName(), ValidationStatus.INVALID, "Participant with ID " + element.getParticipantId() + " is not registered")); - } else if (!p.getParticipantType().equals(element.getParticipantType())) { + } else if (!p.getParticipantId().equals(element.getParticipantId())) { subResult.addResult(new ObjectValidationResult(AUTOMATION_COMPOSITION_NODE_ELEMENT_TYPE, element.getDefinition().getName(), ValidationStatus.INVALID, - "Participant with ID " + element.getParticipantType() + " - " + element.getParticipantId() + "Participant with ID " + " - " + element.getParticipantId() + " is not registered")); } result.addResult(subResult); diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java index f58543684..75fed71e0 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java @@ -65,7 +65,7 @@ public class SupervisionParticipantHandler { saveParticipantStatus(participantRegisterMsg); participantRegisterAckPublisher.send(participantRegisterMsg.getMessageId(), - participantRegisterMsg.getParticipantId(), participantRegisterMsg.getParticipantType()); + participantRegisterMsg.getParticipantId()); } /** @@ -107,7 +107,6 @@ public class SupervisionParticipantHandler { ParticipantRegister registerMessage = (ParticipantRegister) participantMessage; var participant = new Participant(); participant.setParticipantId(participantMessage.getParticipantId()); - participant.setParticipantType(registerMessage.getParticipantType()); participant.setParticipantSupportedElementTypes(listToMap(registerMessage .getParticipantSupportedElementType())); participant.setParticipantState(ParticipantState.ON_LINE); diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java index 3cadff6ee..cbdba53ac 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021,2022 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. @@ -23,7 +23,6 @@ package org.onap.policy.clamp.acm.runtime.supervision.comm; import io.micrometer.core.annotation.Timed; import java.util.UUID; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegisterAck; -import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.springframework.stereotype.Component; /** @@ -37,13 +36,11 @@ public class ParticipantRegisterAckPublisher extends AbstractParticipantAckPubli * * @param responseTo the original request id in the request. * @param participantId the participant Id - * @param participantType the participant Type */ @Timed(value = "publisher.participant_register_ack", description = "PARTICIPANT_REGISTER_ACK messages published") - public void send(UUID responseTo, UUID participantId, ToscaConceptIdentifier participantType) { + public void send(UUID responseTo, UUID participantId) { var message = new ParticipantRegisterAck(); message.setParticipantId(participantId); - message.setParticipantType(participantType); message.setResponseTo(responseTo); message.setMessage("Participant Register Ack"); message.setResult(true); diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java index 504ddc28c..e4bfedd9d 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.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. * ================================================================================ @@ -34,7 +34,6 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantUtils; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdate; import org.onap.policy.clamp.models.acm.persistence.provider.AcDefinitionProvider; import org.onap.policy.clamp.models.acm.utils.AcmUtils; -import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -57,41 +56,38 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par */ @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published") public void sendComissioningBroadcast(AutomationCompositionDefinition acmDefinition) { - sendCommissioning(acmDefinition, null, null); + sendCommissioning(acmDefinition, null); } /** * Send ParticipantUpdate to Participant - * if participantType and participantId are null then message is broadcast. + * if participantId is null then message is broadcast. * - * @param participantType the ParticipantType * @param participantId the ParticipantId */ @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published") - public void sendCommissioning(ToscaConceptIdentifier participantType, UUID participantId) { + public void sendCommissioning(UUID participantId) { var list = acDefinitionProvider.getAllAcDefinitions(); if (list.isEmpty()) { LOGGER.warn("No tosca service template found, cannot send participantupdate"); } for (var acmDefinition : list) { - sendCommissioning(acmDefinition, participantType, participantId); + sendCommissioning(acmDefinition, participantId); } } /** * Send ParticipantUpdate to Participant - * if participantType and participantId are null then message is broadcast. + * if participantId is null then message is broadcast. * * @param acmDefinition the AutomationComposition Definition - * @param participantType the ParticipantType * @param participantId the ParticipantId */ @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published") public void sendCommissioning(AutomationCompositionDefinition acmDefinition, - ToscaConceptIdentifier participantType, UUID participantId) { + UUID participantId) { var message = new ParticipantUpdate(); message.setCompositionId(acmDefinition.getCompositionId()); - message.setParticipantType(participantType); message.setParticipantId(participantId); message.setTimestamp(Instant.now()); @@ -101,7 +97,7 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par if (ParticipantUtils.checkIfNodeTemplateIsAutomationCompositionElement(toscaInputEntry.getValue(), toscaServiceTemplate)) { AcmUtils.prepareParticipantDefinitionUpdate( - ParticipantUtils.findParticipantType(toscaInputEntry.getValue().getProperties()), + participantId, toscaInputEntry.getKey(), toscaInputEntry.getValue(), participantDefinitionUpdates); } } |