diff options
Diffstat (limited to 'participant')
14 files changed, 83 insertions, 16 deletions
diff --git a/participant/participant-impl/participant-impl-a1pms/src/test/resources/application-test.yaml b/participant/participant-impl/participant-impl-a1pms/src/test/resources/application-test.yaml index be33b5249..867357e93 100755 --- a/participant/participant-impl/participant-impl-a1pms/src/test/resources/application-test.yaml +++ b/participant/participant-impl/participant-impl-a1pms/src/test/resources/application-test.yaml @@ -21,4 +21,11 @@ participant: topicCommInfrastructure: dmaap servers: - localhost - topic: POLICY-ACRUNTIME-PARTICIPANT
\ No newline at end of file + topic: POLICY-ACRUNTIME-PARTICIPANT + participantSupportedElementTypes: + - + typeName: org.onap.policy.clamp.acm.HttpAutomationCompositionElement + typeVersion: 1.0.0 + - + typeName: org.onap.policy.clamp.acm.AutomationCompositionElement + typeVersion: 1.0.0 diff --git a/participant/participant-impl/participant-impl-http/src/main/resources/config/application.yaml b/participant/participant-impl/participant-impl-http/src/main/resources/config/application.yaml index 44cdf95a6..1f60ffc97 100644 --- a/participant/participant-impl/participant-impl-http/src/main/resources/config/application.yaml +++ b/participant/participant-impl/participant-impl-http/src/main/resources/config/application.yaml @@ -34,6 +34,13 @@ participant: servers: - ${topicServer:localhost} topicCommInfrastructure: dmaap + participantSupportedElementTypes: + - + typeName: org.onap.policy.clamp.acm.HttpAutomationCompositionElement + typeVersion: 1.0.0 + - + typeName: org.onap.policy.clamp.acm.AutomationCompositionElement + typeVersion: 1.0.0 management: endpoints: web: diff --git a/participant/participant-impl/participant-impl-http/src/test/resources/application-test.yaml b/participant/participant-impl/participant-impl-http/src/test/resources/application-test.yaml index 535508e2a..1effd4e4c 100644 --- a/participant/participant-impl/participant-impl-http/src/test/resources/application-test.yaml +++ b/participant/participant-impl/participant-impl-http/src/test/resources/application-test.yaml @@ -22,3 +22,8 @@ participant: servers: - localhost topic: POLICY-ACRUNTIME-PARTICIPANT + participantSupportedElementTypes: + - typeName: org.onap.policy.clamp.acm.HttpAutomationCompositionElement + typeVersion: 1.0.0 + - typeName: org.onap.policy.clamp.acm.AutomationCompositionElement + typeVersion: 1.0.0 diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml b/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml index 0158c2c63..a906cb6fa 100644 --- a/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml +++ b/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml @@ -30,15 +30,22 @@ participant: - topic: POLICY-ACRUNTIME-PARTICIPANT servers: - - ${topicServer:localhost} + - ${topicServer:localhost:30227} topicCommInfrastructure: dmaap fetchTimeout: 15000 topicSinks: - topic: POLICY-ACRUNTIME-PARTICIPANT servers: - - ${topicServer:localhost} + - ${topicServer:localhost:30227} topicCommInfrastructure: dmaap + participantSupportedElementTypes: + - + typeName: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement + typeVersion: 1.0.0 + - + typeName: org.onap.policy.clamp.acm.AutomationCompositionElement + typeVersion: 1.0.0 management: endpoints: diff --git a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.java b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.java index 97d2fbbd2..8a9619dce 100644 --- a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.java +++ b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.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"); @@ -21,6 +21,7 @@ package org.onap.policy.clamp.acm.participant.kubernetes.parameters; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -105,6 +106,7 @@ public class CommonTestData { map.put("participantId", getParticipantId()); map.put("participantType", getParticipantId()); map.put("clampAutomationCompositionTopics", getTopicParametersMap(false)); + map.put("participantSupportedElementTypes", new ArrayList<>()); } return map; diff --git a/participant/participant-impl/participant-impl-kubernetes/src/test/resources/application-test.yaml b/participant/participant-impl/participant-impl-kubernetes/src/test/resources/application-test.yaml index cd36f61e7..7fc792878 100644 --- a/participant/participant-impl/participant-impl-kubernetes/src/test/resources/application-test.yaml +++ b/participant/participant-impl/participant-impl-kubernetes/src/test/resources/application-test.yaml @@ -29,3 +29,10 @@ participant: - localhost topicCommInfrastructure: dmaap name: AutomationComposition Topics + participantSupportedElementTypes: + - + typeName: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement + typeVersion: 1.0.0 + - + typeName: org.onap.policy.clamp.acm.AutomationCompositionElement + typeVersion: 1.0.0 diff --git a/participant/participant-impl/participant-impl-policy/src/main/resources/META-INF/persistence.xml b/participant/participant-impl/participant-impl-policy/src/main/resources/META-INF/persistence.xml index 383bc7418..d5eae7390 100644 --- a/participant/participant-impl/participant-impl-policy/src/main/resources/META-INF/persistence.xml +++ b/participant/participant-impl/participant-impl-policy/src/main/resources/META-INF/persistence.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- ============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. @@ -52,11 +52,10 @@ <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate</class> <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaTopologyTemplate</class> <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaTrigger</class> - <class>org.onap.policy.clamp.acm.models.acm.persistence.concepts.JpaAutomationComposition</class> - <class>org.onap.policy.clamp.acm.models.acm.persistence.concepts.JpaAutomationCompositionElement</class> - <class>org.onap.policy.clamp.acm.models.acm.persistence.concepts.JpaParticipant</class> - <class>org.onap.policy.clamp.acm.models.acm.persistence.concepts.JpaParticipantStatistics</class> - <class>org.onap.policy.clamp.acm.models.acm.persistence.concepts.JpaAcElementStatistics</class> + <class>org.onap.policy.clamp.models.acm.persistence.concepts.JpaAutomationComposition</class> + <class>org.onap.policy.clamp.models.acm.persistence.concepts.JpaAutomationCompositionElement</class> + <class>org.onap.policy.clamp.models.acm.persistence.concepts.JpaParticipant</class> + <class>org.onap.policy.clamp.models.acm.persistence.concepts.JpaParticipantSupportedElementType</class> <properties> <property name="eclipselink.ddl-generation" value="drop-and-create-tables" /> <property name="eclipselink.ddl-generation.output-mode" value="database" /> diff --git a/participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml b/participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml index a1fea4d1b..6af516e71 100644 --- a/participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml +++ b/participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml @@ -52,6 +52,13 @@ participant: servers: - ${topicServer:localhost} topicCommInfrastructure: dmaap + participantSupportedElementTypes: + - + typeName: org.onap.policy.clamp.acm.PolicyAutomationCompositionElement + typeVersion: 1.0.0 + - + typeName: org.onap.policy.clamp.acm.AutomationCompositionElement + typeVersion: 1.0.0 management: endpoints: web: @@ -62,3 +69,4 @@ server: port: 8085 servlet: context-path: /onap/policy/clamp/acm/policyparticipant + diff --git a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/acm/participant/policy/main/parameters/CommonTestData.java b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/acm/participant/policy/main/parameters/CommonTestData.java index ac6451260..bfba15551 100644 --- a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/acm/participant/policy/main/parameters/CommonTestData.java +++ b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/acm/participant/policy/main/parameters/CommonTestData.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. @@ -20,6 +20,7 @@ package org.onap.policy.clamp.acm.participant.policy.main.parameters; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -123,6 +124,7 @@ public class CommonTestData { map.put("participantId", getParticipantId()); map.put("participantType", getParticipantId()); map.put("clampAutomationCompositionTopics", getTopicParametersMap(false)); + map.put("participantSupportedElementTypes", new ArrayList<>()); } return map; diff --git a/participant/participant-impl/participant-impl-policy/src/test/resources/application-test.yaml b/participant/participant-impl/participant-impl-policy/src/test/resources/application-test.yaml index 13ef55f10..434df0dfe 100644 --- a/participant/participant-impl/participant-impl-policy/src/test/resources/application-test.yaml +++ b/participant/participant-impl/participant-impl-policy/src/test/resources/application-test.yaml @@ -22,3 +22,10 @@ participant: servers: - localhost topic: POLICY-ACRUNTIME-PARTICIPANT + participantSupportedElementTypes: + - + typeName: org.onap.policy.clamp.acm.PolicyAutomationCompositionElement + typeVersion: 1.0.0 + - + typeName: org.onap.policy.clamp.acm.AutomationCompositionElement + typeVersion: 1.0.0 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 11f277885..9023d9460 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 @@ -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"); @@ -72,7 +72,7 @@ public class ParticipantMessagePublisher implements Publisher { public void sendParticipantStatus(final ParticipantStatus participantStatus) { validate(); topicSinkClient.send(participantStatus); - LOGGER.debug("Sent Participant Status message to CLAMP - {}", participantStatus); + LOGGER.info("Sent Participant Status message to CLAMP - {}", participantStatus); } /** @@ -84,7 +84,7 @@ public class ParticipantMessagePublisher implements Publisher { public void sendParticipantRegister(final ParticipantRegister participantRegister) { validate(); topicSinkClient.send(participantRegister); - LOGGER.debug("Sent Participant Register message to CLAMP - {}", participantRegister); + LOGGER.info("Sent Participant Register message to CLAMP - {}", participantRegister); } /** 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 6edf1ffd4..f9023be1a 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 @@ -35,6 +35,7 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDef 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.AutomationCompositionStateChange; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionUpdate; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantAckMessage; @@ -70,6 +71,8 @@ public class ParticipantHandler { private final Map<UUID, List<AutomationCompositionElementDefinition>> acElementDefsMap = new HashMap<>(); + private final List<ParticipantSupportedElementType> supportedAcElementTypes; + /** * Constructor, set the participant ID and sender. * @@ -82,6 +85,7 @@ public class ParticipantHandler { this.participantId = parameters.getIntermediaryParameters().getParticipantId(); this.publisher = publisher; this.automationCompositionHandler = automationCompositionHandler; + this.supportedAcElementTypes = parameters.getIntermediaryParameters().getParticipantSupportedElementTypes(); } /** @@ -92,6 +96,7 @@ public class ParticipantHandler { @Timed(value = "listener.participant_status_req", description = "PARTICIPANT_STATUS_REQ messages received") public void handleParticipantStatusReq(final ParticipantStatusReq participantStatusReqMsg) { var participantStatus = makeHeartbeat(true); + participantStatus.setParticipantSupportedElementType(this.supportedAcElementTypes); publisher.sendParticipantStatus(participantStatus); } @@ -148,6 +153,7 @@ public class ParticipantHandler { var participantRegister = new ParticipantRegister(); participantRegister.setParticipantId(participantId); participantRegister.setParticipantType(participantType); + participantRegister.setParticipantSupportedElementType(supportedAcElementTypes); publisher.sendParticipantRegister(participantRegister); } 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 dcbfd1b2e..953084890 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 @@ -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. @@ -20,12 +20,14 @@ package org.onap.policy.clamp.acm.participant.intermediary.parameters; +import java.util.List; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Positive; import lombok.Getter; 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; @@ -58,4 +60,9 @@ public class ParticipantIntermediaryParameters { @NotNull @ParameterGroupConstraint private TopicParameterGroup clampAutomationCompositionTopics; + + @NotNull + @Valid + private List<ParticipantSupportedElementType> participantSupportedElementTypes; + } diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java index 10c438f93..0e35c480b 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.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. @@ -21,7 +21,9 @@ package org.onap.policy.clamp.acm.participant.intermediary.main.parameters; import java.io.File; +import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -111,6 +113,7 @@ public class CommonTestData { map.put("participantType", getParticipantId()); map.put("reportingTimeIntervalMs", TIME_INTERVAL); map.put("clampAutomationCompositionTopics", getTopicParametersMap(false)); + map.put("participantSupportedElementTypes", new ArrayList<>()); return map; } |