diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-01-17 09:56:52 +0000 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-01-23 15:22:35 +0000 |
commit | c5e57c1b1cd0e778ebf47edd20fd9a340471ab72 (patch) | |
tree | f567d2bc52cf070bcccb83bad0f4ab5f70d2415f /participant | |
parent | a263a250f7185fd9ddc4b600d96452fdbf21fffb (diff) |
Refactor participantId as UUID
As part of endpoint refactoring, refactor participantId as UUID in ACM.
Issue-ID: POLICY-4521
Change-Id: I8ac652d9b2fadf9ce3220febb9c2c3ac0d3786cc
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant')
14 files changed, 35 insertions, 42 deletions
diff --git a/participant/participant-impl/participant-impl-a1pms/src/main/resources/config/application.yaml b/participant/participant-impl/participant-impl-a1pms/src/main/resources/config/application.yaml index fcc2057b2..9c4e4370a 100755 --- a/participant/participant-impl/participant-impl-a1pms/src/main/resources/config/application.yaml +++ b/participant/participant-impl/participant-impl-a1pms/src/main/resources/config/application.yaml @@ -25,9 +25,7 @@ participant: intermediaryParameters: reportingTimeIntervalMs: 120000 description: Participant Description - participantId: - name: A1PMSParticipant0 - version: 1.0.0 + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c00 participantType: name: org.onap.policy.clamp.acm.A1PMSParticipant version: 2.3.4 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 867357e93..ced319cfc 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 @@ -2,9 +2,7 @@ participant: intermediaryParameters: reportingTimeInterval: 120000 description: Participant Description - participantId: - name: A1PMSParticipant0 - version: 1.0.0 + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c00 participantType: name: org.onap.policy.clamp.acm.A1PMSParticipant version: 2.3.4 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 1f60ffc97..a7015d95c 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 @@ -16,9 +16,7 @@ participant: intermediaryParameters: reportingTimeIntervalMs: 120000 description: Participant Description - participantId: - name: HttpParticipant0 - version: 1.0.0 + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01 participantType: name: org.onap.policy.clamp.acm.HttpParticipant version: 2.3.4 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 1effd4e4c..bf429df02 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 @@ -2,9 +2,7 @@ participant: intermediaryParameters: reportingTimeInterval: 120000 description: Participant Description - participantId: - version: 1.0.0 - name: HttpParticipant0 + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01 participantType: version: 2.3.4 name: org.onap.clamp.acm.HttpParticipant 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 a906cb6fa..de9794d3c 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 @@ -19,9 +19,7 @@ participant: intermediaryParameters: reportingTimeIntervalMs: 120000 description: Participant Description - participantId: - name: K8sParticipant0 - version: 1.0.0 + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c02 participantType: name: org.onap.policy.clamp.acm.KubernetesParticipant version: 2.3.4 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 8a9619dce..3b74066bd 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 @@ -104,7 +104,7 @@ public class CommonTestData { map.put("reportingTimeIntervalMs", TIME_INTERVAL); map.put("description", DESCRIPTION); map.put("participantId", getParticipantId()); - map.put("participantType", getParticipantId()); + map.put("participantType", getParticipantType()); map.put("clampAutomationCompositionTopics", getTopicParametersMap(false)); map.put("participantSupportedElementTypes", new ArrayList<>()); } @@ -113,17 +113,25 @@ public class CommonTestData { } /** - * Returns participantId for test cases. + * Returns participantType for test cases. * - * @return participant Id + * @return participant Type */ - public static ToscaConceptIdentifier getParticipantId() { - final ToscaConceptIdentifier participantId = new ToscaConceptIdentifier(); + public static ToscaConceptIdentifier getParticipantType() { + final var participantId = new ToscaConceptIdentifier(); participantId.setName("K8sParticipant0"); participantId.setVersion("1.0.0"); return participantId; } + /** + * Returns participantId for test cases. + * + * @return participant Id + */ + public static UUID getParticipantId() { + return UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c02"); + } /** * Returns a property map for a TopicParameters map for test cases. 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 7fc792878..62cef60c4 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 @@ -8,9 +8,7 @@ participant: name: Participant parameters description: Participant Description reportingTimeInterval: 120000 - participantId: - name: K8sParticipant0 - version: 1.0.0 + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c02 participantType: version: 2.3.4 name: org.onap.k8s.acm.K8SAutomationCompositionParticipant 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 6af516e71..e7b59bef4 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 @@ -32,9 +32,7 @@ participant: intermediaryParameters: reportingTimeIntervalMs: 120000 description: Participant Description - participantId: - name: org.onap.PM_Policy - version: 1.0.0 + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c03 participantType: name: org.onap.policy.clamp.acm.PolicyParticipant version: 2.3.1 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 b69c5c353..925214ec1 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 @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.TreeMap; +import java.util.UUID; import org.onap.policy.common.endpoints.parameters.TopicParameters; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.CoderException; @@ -173,7 +174,7 @@ public class CommonTestData { * * @return participant Id */ - public static ToscaConceptIdentifier getParticipantId() { - return new ToscaConceptIdentifier("org.onap.PM_Policy", "1.0.0"); + public static UUID getParticipantId() { + return UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c03"); } } 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 434df0dfe..7a366f611 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 @@ -2,9 +2,7 @@ participant: intermediaryParameters: reportingTimeInterval: 120000 description: Participant Description - participantId: - version: 1.0.0 - name: org.onap.PM_Policy + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c03 participantType: version: 1.0.0 name: org.onap.PM_CDS_Blueprint 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 568ab8a36..49b16d23d 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 @@ -59,7 +59,7 @@ public class AutomationCompositionHandler { private static final Logger LOGGER = LoggerFactory.getLogger(AutomationCompositionHandler.class); private final ToscaConceptIdentifier participantType; - private final ToscaConceptIdentifier participantId; + private final UUID participantId; private final ParticipantMessagePublisher publisher; @Getter 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 f9023be1a..7e881b59d 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 @@ -64,7 +64,7 @@ public class ParticipantHandler { private final ToscaConceptIdentifier participantType; @Getter - private final ToscaConceptIdentifier participantId; + private final UUID participantId; private final AutomationCompositionHandler automationCompositionHandler; private final ParticipantMessagePublisher publisher; 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 953084890..8f32c6f9a 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 @@ -21,6 +21,7 @@ package org.onap.policy.clamp.acm.participant.intermediary.parameters; import java.util.List; +import java.util.UUID; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -42,7 +43,7 @@ public class ParticipantIntermediaryParameters { // The ID and description of this participant @NotNull @Valid - private ToscaConceptIdentifier participantId; + private UUID participantId; @NotBlank private String description; 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 b7d66bec6..45703848e 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 @@ -61,8 +61,7 @@ public class CommonTestData { private static final Object lockit = new Object(); public static final UUID AC_ID_0 = UUID.randomUUID(); public static final UUID AC_ID_1 = UUID.randomUUID(); - public static final ToscaConceptIdentifier PARTCICIPANT_ID = - new ToscaConceptIdentifier("org.onap.PM_Policy", "0.0.0"); + public static final UUID PARTCICIPANT_ID = UUID.randomUUID(); /** * Get ParticipantIntermediaryParameters. @@ -155,12 +154,12 @@ public class CommonTestData { * * @return participant Id */ - public static ToscaConceptIdentifier getParticipantId() { + public static UUID getParticipantId() { return PARTCICIPANT_ID; } - public static ToscaConceptIdentifier getRndParticipantId() { - return new ToscaConceptIdentifier("diff", "0.0.0"); + public static UUID getRndParticipantId() { + return UUID.randomUUID(); } public static ToscaConceptIdentifier getDefinition() { @@ -269,7 +268,7 @@ public class CommonTestData { * @return a map suitable for elementsOnThisParticipant */ public Map<UUID, AutomationCompositionElement> setAutomationCompositionElementTest(UUID uuid, - ToscaConceptIdentifier definition, ToscaConceptIdentifier participantId) { + ToscaConceptIdentifier definition, UUID participantId) { var acElement = new AutomationCompositionElement(); acElement.setId(uuid); acElement.setParticipantId(participantId); @@ -289,7 +288,7 @@ public class CommonTestData { * @return a AutomationCompositionHander with elements */ public AutomationCompositionHandler setTestAutomationCompositionHandler(ToscaConceptIdentifier definition, - UUID uuid, ToscaConceptIdentifier participantId) { + UUID uuid, UUID participantId) { var ach = getMockAutomationCompositionHandler(); var key = getTestAutomationCompositionMap().keySet().iterator().next(); @@ -311,7 +310,7 @@ public class CommonTestData { * @param state a AutomationCompositionOrderedState * @return a AutomationCompositionStateChange */ - public AutomationCompositionStateChange getStateChange(ToscaConceptIdentifier participantId, UUID uuid, + public AutomationCompositionStateChange getStateChange(UUID participantId, UUID uuid, AutomationCompositionOrderedState state) { var stateChange = new AutomationCompositionStateChange(); stateChange.setAutomationCompositionId(UUID.randomUUID()); |