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/participant-intermediary/src | |
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/participant-intermediary/src')
4 files changed, 11 insertions, 11 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 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()); |