From 83b5318e545fbc72e3612c4300c4d738b0b577de Mon Sep 17 00:00:00 2001 From: Sirisha_Manchikanti Date: Tue, 31 Aug 2021 11:25:34 +0100 Subject: Send ToscaServiceTemplateFragment with policies, policy-types ToscaServiceTemplateFragment contains policies, policy-types and respective datatypes to be sent to Policy participant, and there on to Policy Framework to create new policies or policy-types that doesnot exist in the database. https://wiki.onap.org/display/DW/The+CLAMP+Policy+Framework+Participant Issue-ID: POLICY-3607 Signed-off-by: Sirisha_Manchikanti Change-Id: I2b98d7dc6946b0c27763f1a150d1bf4adca90a2f --- .../participant/intermediary/api/ParticipantIntermediaryApi.java | 7 ------- .../intermediary/api/impl/ParticipantIntermediaryApiImpl.java | 5 ----- .../participant/intermediary/handler/ParticipantHandler.java | 6 +----- 3 files changed, 1 insertion(+), 17 deletions(-) (limited to 'participant/participant-intermediary/src/main/java') diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/ParticipantIntermediaryApi.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/ParticipantIntermediaryApi.java index ed0aea4b3..2ca14fdea 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/ParticipantIntermediaryApi.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/ParticipantIntermediaryApi.java @@ -100,13 +100,6 @@ public interface ParticipantIntermediaryApi { */ Map getControlLoopElements(String name, String version); - /** - * Get ToscaServiceTemplate from the intermediary API. - * - * @return the control loop element - */ - ToscaServiceTemplate getToscaServiceTemplate(); - /** * Get control loop element from the intermediary API. * diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java index ded102f5a..f6d7cd161 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java @@ -121,11 +121,6 @@ public class ParticipantIntermediaryApiImpl implements ParticipantIntermediaryAp return null; } - @Override - public ToscaServiceTemplate getToscaServiceTemplate() { - return participantHandler.getToscaServiceTemplate(); - } - @Override public ControlLoopElement updateControlLoopElementState(UUID id, ControlLoopOrderedState currentState, ControlLoopState newState, ParticipantMessageType messageType) { diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java index 49ad6dab1..56fddd6ff 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java @@ -59,7 +59,6 @@ import org.onap.policy.clamp.controlloop.participant.intermediary.comm.Participa import org.onap.policy.clamp.controlloop.participant.intermediary.parameters.ParticipantParameters; import org.onap.policy.models.base.PfModelException; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; -import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -86,8 +85,6 @@ public class ParticipantHandler { private final List clElementDefsOnThisParticipant = new ArrayList<>(); - private ToscaServiceTemplate toscaServiceTemplate = new ToscaServiceTemplate(); - /** * Constructor, set the participant ID and sender. * @@ -292,8 +289,7 @@ public class ParticipantHandler { return; } - toscaServiceTemplate = participantUpdateMsg.getToscaServiceTemplate(); - if (toscaServiceTemplate != null) { + if (!participantUpdateMsg.getParticipantDefinitionUpdates().isEmpty()) { // This message is to commission the controlloop for (ParticipantDefinition participantDefinition : participantUpdateMsg.getParticipantDefinitionUpdates()) { if (participantDefinition.getParticipantId().equals(participantType)) { -- cgit 1.2.3-korg