Refactor participantId as UUID 88/132988/1
authorFrancescoFioraEst <francesco.fiora@est.tech>
Tue, 17 Jan 2023 09:56:52 +0000 (09:56 +0000)
committerFrancescoFioraEst <francesco.fiora@est.tech>
Mon, 23 Jan 2023 15:22:35 +0000 (15:22 +0000)
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>
48 files changed:
models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElement.java
models/src/main/java/org/onap/policy/clamp/models/acm/concepts/Participant.java
models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantDefinition.java
models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantUpdates.java
models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantAckMessage.java
models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessage.java
models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElement.java
models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipant.java
models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/ParticipantProvider.java
models/src/main/java/org/onap/policy/clamp/models/acm/persistence/repository/ParticipantRepository.java
models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantTest.java
models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantTest.java
models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/ParticipantProviderTest.java
models/src/test/java/org/onap/policy/clamp/models/acm/utils/CommonTestData.java
packages/policy-clamp-tarball/src/main/resources/etc/A1pmsParticipantParameters.yaml
packages/policy-clamp-tarball/src/main/resources/etc/HttpParticipantParameters.yaml
packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml
packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.yaml
participant/participant-impl/participant-impl-a1pms/src/main/resources/config/application.yaml
participant/participant-impl/participant-impl-a1pms/src/test/resources/application-test.yaml
participant/participant-impl/participant-impl-http/src/main/resources/config/application.yaml
participant/participant-impl/participant-impl-http/src/test/resources/application-test.yaml
participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml
participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.java
participant/participant-impl/participant-impl-kubernetes/src/test/resources/application-test.yaml
participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml
participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/acm/participant/policy/main/parameters/CommonTestData.java
participant/participant-impl/participant-impl-policy/src/test/resources/application-test.yaml
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/parameters/ParticipantIntermediaryParameters.java
participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantStatusReqPublisher.java
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java
runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json
runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml
runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java
runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java
runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/CommonTestData.java
runtime-acm/src/test/resources/rest/acm/AutomationComposition.json
runtime-acm/src/test/resources/rest/acm/AutomationCompositionElementsNotFound.json
runtime-acm/src/test/resources/rest/acm/AutomationCompositionSmoke.json
runtime-acm/src/test/resources/rest/acm/AutomationCompositionUpdate.json

index e5c85dd..bea2278 100644 (file)
@@ -50,7 +50,7 @@ public class AutomationCompositionElement {
     private ToscaConceptIdentifier participantType = new ToscaConceptIdentifier(PfConceptKey.getNullKey());
 
     @NonNull
-    private ToscaConceptIdentifier participantId = new ToscaConceptIdentifier(PfConceptKey.getNullKey());
+    private UUID participantId = UUID.randomUUID();
 
     @NonNull
     private AutomationCompositionState state = AutomationCompositionState.UNINITIALISED;
@@ -75,7 +75,7 @@ public class AutomationCompositionElement {
         this.id = otherElement.id;
         this.definition = new ToscaConceptIdentifier(otherElement.definition);
         this.participantType = new ToscaConceptIdentifier(otherElement.participantType);
-        this.participantId = new ToscaConceptIdentifier(otherElement.participantId);
+        this.participantId = otherElement.participantId;
         this.state = otherElement.state;
         this.orderedState = otherElement.orderedState;
         this.toscaServiceTemplateFragment = otherElement.toscaServiceTemplateFragment;
index 56c0183..4741baf 100644 (file)
@@ -26,22 +26,18 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 import lombok.NonNull;
-import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
 
 /**
  * Class to represent details of a running participant instance.
  */
 @NoArgsConstructor
 @Data
-@EqualsAndHashCode(callSuper = true)
-public class Participant extends ToscaEntity implements Comparable<Participant> {
+@EqualsAndHashCode
+public class Participant {
 
     @NonNull
     private UUID participantId;
-    @NonNull
-    private ToscaConceptIdentifier definition = new ToscaConceptIdentifier(PfConceptKey.getNullKey());
 
     @NonNull
     private ParticipantState participantState = ParticipantState.ON_LINE;
@@ -52,29 +48,12 @@ public class Participant extends ToscaEntity implements Comparable<Participant>
     @NonNull
     private Map<UUID, ParticipantSupportedElementType> participantSupportedElementTypes;
 
-    @Override
-    public String getType() {
-        return definition.getName();
-    }
-
-    @Override
-    public String getTypeVersion() {
-        return definition.getVersion();
-    }
-
-    @Override
-    public int compareTo(final Participant other) {
-        return compareNameVersion(this, other);
-    }
-
     /**
      * Copy constructor.
      *
      * @param otherParticipant the participant to copy from
      */
     public Participant(Participant otherParticipant) {
-        super(otherParticipant);
-        this.definition = new ToscaConceptIdentifier(otherParticipant.definition);
         this.participantState = otherParticipant.participantState;
         this.participantType = otherParticipant.participantType;
         this.participantId = otherParticipant.participantId;
index 949a7c4..aff6198 100644 (file)
@@ -22,6 +22,7 @@ package org.onap.policy.clamp.models.acm.concepts;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 import lombok.Data;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
@@ -38,7 +39,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 @ToString
 public class ParticipantDefinition {
 
-    private ToscaConceptIdentifier participantId;
+    private UUID participantId;
 
     private ToscaConceptIdentifier participantType;
 
index 1872a61..031fd5c 100644 (file)
@@ -22,12 +22,12 @@ package org.onap.policy.clamp.models.acm.concepts;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 import lombok.Data;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.ToString;
 import org.onap.policy.models.base.PfUtils;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
 /**
  * Class to represent a participant definition update instance.
@@ -38,7 +38,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 @ToString
 public class ParticipantUpdates {
 
-    private ToscaConceptIdentifier participantId;
+    private UUID participantId;
 
     // List of AutomationCompositionElement values for a particular participant
     private List<AutomationCompositionElement> automationCompositionElementList = new ArrayList<>();
index c6d5690..8d847f8 100644 (file)
@@ -55,7 +55,7 @@ public class ParticipantAckMessage {
     /**
      * Participant ID, or {@code null} for messages from participants.
      */
-    private ToscaConceptIdentifier participantId;
+    private UUID participantId;
 
     /**
      * Participant State, or {@code null} for messages from participants.
@@ -94,7 +94,7 @@ public class ParticipantAckMessage {
      * @return {@code true} if this message applies to this participant, {@code false} otherwise
      */
     public boolean appliesTo(@NonNull final ToscaConceptIdentifier participantType,
-            @NonNull final ToscaConceptIdentifier participantId) {
+            @NonNull final UUID participantId) {
         // Broadcast message to all participants
         if (this.participantType == null) {
             return true;
index c1ef4b4..525dab7 100644 (file)
@@ -55,7 +55,7 @@ public class ParticipantMessage {
     /**
      * Participant ID, or {@code null} for messages from participants.
      */
-    private ToscaConceptIdentifier participantId;
+    private UUID participantId;
 
     /**
      * Automation Composition ID, or {@code null} for messages to participants.
@@ -94,7 +94,7 @@ public class ParticipantMessage {
      * @return {@code true} if this message applies to this participant, {@code false} otherwise
      */
     public boolean appliesTo(@NonNull final ToscaConceptIdentifier participantType,
-            @NonNull final ToscaConceptIdentifier participantId) {
+            @NonNull final UUID participantId) {
         // Broadcast message to all participants
         if (this.participantType == null) {
             return true;
index 79576f6..23fc0a9 100644 (file)
@@ -85,11 +85,9 @@ public class JpaAutomationCompositionElement extends Validated
     @AttributeOverride(name = "version", column = @Column(name = "participant_type_version"))
     private PfConceptKey participantType;
 
+    @Column
     @NotNull
-    @AttributeOverride(name = "name",    column = @Column(name = "participant_name"))
-    @AttributeOverride(name = "version", column = @Column(name = "participant_version"))
-    private PfConceptKey participantId;
-    // @formatter:on
+    private String participantId;
 
     @Column
     @NotNull
@@ -154,7 +152,7 @@ public class JpaAutomationCompositionElement extends Validated
         this.instanceId = copyConcept.instanceId;
         this.definition = new PfConceptKey(copyConcept.definition);
         this.participantType = new PfConceptKey(copyConcept.participantType);
-        this.participantId = new PfConceptKey(copyConcept.participantId);
+        this.participantId = copyConcept.participantId;
         this.state = copyConcept.state;
         this.orderedState = copyConcept.orderedState;
         this.description = copyConcept.description;
@@ -177,7 +175,7 @@ public class JpaAutomationCompositionElement extends Validated
         element.setId(UUID.fromString(elementId));
         element.setDefinition(new ToscaConceptIdentifier(definition));
         element.setParticipantType(new ToscaConceptIdentifier(participantType));
-        element.setParticipantId(new ToscaConceptIdentifier(participantId));
+        element.setParticipantId(UUID.fromString(participantId));
         element.setState(state);
         element.setOrderedState(orderedState != null ? orderedState : state.asOrderedState());
         element.setDescription(description);
@@ -190,7 +188,7 @@ public class JpaAutomationCompositionElement extends Validated
     public void fromAuthorative(@NonNull final AutomationCompositionElement element) {
         this.definition = element.getDefinition().asConceptKey();
         this.participantType = element.getParticipantType().asConceptKey();
-        this.participantId = element.getParticipantId().asConceptKey();
+        this.participantId = element.getParticipantId().toString();
         this.state = element.getState();
         this.orderedState = element.getOrderedState();
         this.description = element.getDescription();
index 7d043ac..b7e95cf 100644 (file)
@@ -28,10 +28,10 @@ import java.util.UUID;
 import javax.persistence.AttributeOverride;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.ForeignKey;
+import javax.persistence.Id;
 import javax.persistence.Inheritance;
 import javax.persistence.InheritanceType;
 import javax.persistence.JoinColumn;
@@ -46,10 +46,8 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
 import org.onap.policy.common.parameters.annotations.NotNull;
 import org.onap.policy.common.parameters.annotations.Valid;
 import org.onap.policy.models.base.PfAuthorative;
-import org.onap.policy.models.base.PfConcept;
 import org.onap.policy.models.base.PfConceptKey;
-import org.onap.policy.models.base.PfKey;
-import org.onap.policy.models.base.validation.annotations.VerifyKey;
+import org.onap.policy.models.base.Validated;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
 /**
@@ -62,28 +60,16 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
 @Data
 @EqualsAndHashCode(callSuper = false)
-public class JpaParticipant extends PfConcept implements PfAuthorative<Participant>, Serializable {
+public class JpaParticipant extends Validated
+        implements PfAuthorative<Participant>, Comparable<JpaParticipant>, Serializable {
     private static final long serialVersionUID = -4697758484642403483L;
 
-    @Column
+    @Id
     @NotNull
     private String participantId;
 
-    @EmbeddedId
-    @VerifyKey
-    @NotNull
-    private PfConceptKey key;
-
-    // @formatter:off
-    @VerifyKey
     @NotNull
-    @AttributeOverride(name = "name",    column = @Column(name = "definition_name"))
-    @AttributeOverride(name = "version", column = @Column(name = "definition_version"))
-    private PfConceptKey definition;
-    // @formatter:on
-
-    @NotNull
-    @AttributeOverride(name = "name",    column = @Column(name = "participant_type_name"))
+    @AttributeOverride(name = "name", column = @Column(name = "participant_type_name"))
     @AttributeOverride(name = "version", column = @Column(name = "participant_type_version"))
     private PfConceptKey participantType;
 
@@ -104,36 +90,20 @@ public class JpaParticipant extends PfConcept implements PfAuthorative<Participa
      * The Default Constructor creates a {@link JpaParticipant} object with a null key.
      */
     public JpaParticipant() {
-        this(new PfConceptKey());
-    }
-
-    /**
-     * The Key Constructor creates a {@link JpaParticipant} object with the given concept key.
-     *
-     * @param key the key
-     */
-    public JpaParticipant(@NonNull final PfConceptKey key) {
-        this(UUID.randomUUID().toString(), key, new PfConceptKey(), ParticipantState.ON_LINE, new ArrayList<>());
+        this(UUID.randomUUID().toString(), ParticipantState.ON_LINE, new ArrayList<>());
     }
 
     /**
      * The Key Constructor creates a {@link JpaParticipant} object with all mandatory fields.
      *
      * @param participantId the participant id
-     * @param key the key
-     * @param definition the TOSCA definition of the participant
      * @param participantState the state of the participant
      */
-    public JpaParticipant(@NotNull String participantId,
-                          @NonNull final PfConceptKey key,
-                          @NonNull final PfConceptKey definition,
-                          @NonNull final ParticipantState participantState,
-                          @NonNull final List<JpaParticipantSupportedElementType> supportedAcElementTypes) {
-        this.key = key;
-        this.definition = definition;
-        this.participantState = participantState;
+    public JpaParticipant(@NonNull String participantId, @NonNull final ParticipantState participantState,
+            @NonNull final List<JpaParticipantSupportedElementType> supportedElements) {
         this.participantId = participantId;
-        this.supportedElements = supportedAcElementTypes;
+        this.participantState = participantState;
+        this.supportedElements = supportedElements;
     }
 
     /**
@@ -142,9 +112,6 @@ public class JpaParticipant extends PfConcept implements PfAuthorative<Participa
      * @param copyConcept the concept to copy from
      */
     public JpaParticipant(@NonNull final JpaParticipant copyConcept) {
-        super(copyConcept);
-        this.key = new PfConceptKey(copyConcept.key);
-        this.definition = new PfConceptKey(copyConcept.definition);
         this.participantState = copyConcept.participantState;
         this.description = copyConcept.description;
         this.participantType = copyConcept.participantType;
@@ -165,11 +132,7 @@ public class JpaParticipant extends PfConcept implements PfAuthorative<Participa
     public Participant toAuthorative() {
         var participant = new Participant();
 
-        participant.setName(key.getName());
-        participant.setVersion(key.getVersion());
-        participant.setDefinition(new ToscaConceptIdentifier(definition));
         participant.setParticipantState(participantState);
-        participant.setDescription(description);
         participant.setParticipantType(new ToscaConceptIdentifier(participantType));
         participant.setParticipantId(UUID.fromString(participantId));
         participant.setParticipantSupportedElementTypes(new LinkedHashMap<>(this.supportedElements.size()));
@@ -183,13 +146,7 @@ public class JpaParticipant extends PfConcept implements PfAuthorative<Participa
 
     @Override
     public void fromAuthorative(@NonNull final Participant participant) {
-        if (this.key == null || this.getKey().isNullKey()) {
-            this.setKey(new PfConceptKey(participant.getName(), participant.getVersion()));
-        }
-
-        this.definition = participant.getDefinition().asConceptKey();
         this.setParticipantState(participant.getParticipantState());
-        this.setDescription(participant.getDescription());
         this.participantType = participant.getParticipantType().asConceptKey();
         this.participantId = participant.getParticipantId().toString();
         this.supportedElements = new ArrayList<>(participant.getParticipantSupportedElementTypes().size());
@@ -203,42 +160,15 @@ public class JpaParticipant extends PfConcept implements PfAuthorative<Participa
     }
 
     @Override
-    public List<PfKey> getKeys() {
-        List<PfKey> keyList = getKey().getKeys();
-
-        keyList.add(definition);
-        keyList.add(participantType);
-
-        return keyList;
-    }
-
-    @Override
-    public void clean() {
-        key.clean();
-        definition.clean();
-        description = (description == null ? null : description.trim());
-        participantType.clean();
-    }
-
-    @Override
-    public int compareTo(final PfConcept otherConcept) {
-        if (otherConcept == null) {
+    public int compareTo(final JpaParticipant other) {
+        if (other == null) {
             return -1;
         }
-        if (this == otherConcept) {
+        if (this == other) {
             return 0;
         }
-        if (getClass() != otherConcept.getClass()) {
-            return getClass().getName().compareTo(otherConcept.getClass().getName());
-        }
-
-        final JpaParticipant other = (JpaParticipant) otherConcept;
-        int result = key.compareTo(other.key);
-        if (result != 0) {
-            return result;
-        }
 
-        result = definition.compareTo(other.definition);
+        var result = participantId.compareTo(other.participantId);
         if (result != 0) {
             return result;
         }
index fa8979d..7b8ebc0 100644 (file)
@@ -29,9 +29,7 @@ import lombok.RequiredArgsConstructor;
 import org.onap.policy.clamp.models.acm.concepts.Participant;
 import org.onap.policy.clamp.models.acm.persistence.concepts.JpaParticipant;
 import org.onap.policy.clamp.models.acm.persistence.repository.ParticipantRepository;
-import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -60,11 +58,10 @@ public class ParticipantProvider {
      *
      * @param participantId the id of the participant to get
      * @return the participant found
-     * @throws PfModelException on errors getting participant
      */
     @Transactional(readOnly = true)
     public Participant getParticipantById(UUID participantId) {
-        var participant = participantRepository.findByParticipantId(participantId.toString());
+        var participant = participantRepository.findById(participantId.toString());
         if (participant.isEmpty()) {
             throw new PfModelRuntimeException(Status.NOT_FOUND,
                 "Participant Not Found with ID: " + participantId);
@@ -80,8 +77,8 @@ public class ParticipantProvider {
      * @return the participant found
      */
     @Transactional(readOnly = true)
-    public Optional<Participant> findParticipant(@NonNull final ToscaConceptIdentifier participantId) {
-        return participantRepository.findById(participantId.asConceptKey()).map(JpaParticipant::toAuthorative);
+    public Optional<Participant> findParticipant(@NonNull final UUID participantId) {
+        return participantRepository.findById(participantId.toString()).map(JpaParticipant::toAuthorative);
     }
 
     /**
@@ -91,7 +88,6 @@ public class ParticipantProvider {
      * @return the participant created
      */
     public Participant saveParticipant(@NonNull final Participant participant) {
-        participant.setParticipantId(UUID.randomUUID());
         var result = participantRepository
             .save(ProviderUtils.getJpaAndValidate(participant, JpaParticipant::new, "participant"));
 
@@ -120,7 +116,7 @@ public class ParticipantProvider {
      * @return the participant deleted
      */
     public Participant deleteParticipant(@NonNull final UUID participantId) {
-        var jpaDeleteParticipantOpt = participantRepository.findByParticipantId(participantId.toString());
+        var jpaDeleteParticipantOpt = participantRepository.findById(participantId.toString());
 
         if (jpaDeleteParticipantOpt.isEmpty()) {
             String errorMessage =
index b448731..310d998 100644 (file)
 
 package org.onap.policy.clamp.models.acm.persistence.repository;
 
-import java.util.Optional;
 import org.onap.policy.clamp.models.acm.persistence.concepts.JpaParticipant;
-import org.onap.policy.models.base.PfConceptKey;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
 
 @Repository
-public interface ParticipantRepository extends JpaRepository<JpaParticipant, PfConceptKey> {
+public interface ParticipantRepository extends JpaRepository<JpaParticipant, String> {
 
-    Optional<JpaParticipant> findByParticipantId(String participantId);
 }
index f6eb3e0..0ae1a90 100644 (file)
@@ -27,22 +27,9 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import org.junit.jupiter.api.Test;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
+import org.onap.policy.clamp.models.acm.utils.CommonTestData;
 
 class ParticipantTest {
-    @Test
-    void testParticipant() {
-
-        Participant p0 = new Participant();
-        p0.setDefinition(new ToscaConceptIdentifier("dfName", "1.2.3"));
-        assertEquals("dfName", p0.getType());
-        assertEquals("1.2.3", p0.getTypeVersion());
-
-        Participant p1 = new Participant(p0);
-        assertEquals(p0, p1);
-
-        assertEquals(0, p0.compareTo(p1));
-    }
 
     @Test
     void testParticipantLombok() {
@@ -57,11 +44,8 @@ class ParticipantTest {
 
         Participant p1 = new Participant();
 
-        p1.setDefinition(new ToscaConceptIdentifier("defName", "0.0.1"));
-        p1.setDescription("Description");
-        p1.setName("Name");
+        p1.setParticipantId(CommonTestData.getParticipantId());
         p1.setParticipantState(ParticipantState.ON_LINE);
-        p1.setVersion("0.0.1");
 
         assertThat(p1.toString()).contains("Participant(");
         assertNotEquals(0, p1.hashCode());
@@ -73,7 +57,6 @@ class ParticipantTest {
         Participant p2 = new Participant();
 
         // @formatter:off
-        assertThatThrownBy(() -> p2.setDefinition(null)).      isInstanceOf(NullPointerException.class);
         assertThatThrownBy(() -> p2.setParticipantState(null)).isInstanceOf(NullPointerException.class);
         // @formatter:on
 
index b798fb0..f293085 100644 (file)
@@ -28,13 +28,11 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.UUID;
 import org.junit.jupiter.api.Test;
 import org.onap.policy.clamp.models.acm.concepts.Participant;
 import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
-import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
 /**
@@ -42,71 +40,34 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
  */
 class JpaParticipantTest {
 
-    private static final String NULL_KEY_ERROR = "key is marked .*ull but is null";
+    private static final String NULL_KEY_ERROR = "participantId is marked .*ull but is null";
 
     @Test
     void testJpaParticipantConstructor() {
         assertThatThrownBy(() -> new JpaParticipant((JpaParticipant) null))
             .hasMessageMatching("copyConcept is marked .*ull but is null");
 
-        assertThatThrownBy(() -> new JpaParticipant((PfConceptKey) null)).hasMessageMatching(NULL_KEY_ERROR);
+        assertThatThrownBy(() -> new JpaParticipant(null, null, null)).hasMessageMatching(NULL_KEY_ERROR);
 
-        assertThatThrownBy(() -> new JpaParticipant(null, null, null, null, null)).hasMessageMatching(NULL_KEY_ERROR);
-
-        assertThatThrownBy(() -> new JpaParticipant(null, null, null, null, null))
-            .hasMessageMatching(NULL_KEY_ERROR);
-
-        assertThatThrownBy(() -> new JpaParticipant(null, null, null, ParticipantState.ON_LINE, null))
-            .hasMessageMatching(NULL_KEY_ERROR);
-
-        assertThatThrownBy(
-            () -> new JpaParticipant(null, null, null, ParticipantState.ON_LINE, null))
-            .hasMessageMatching(NULL_KEY_ERROR);
-
-        assertThatThrownBy(() -> new JpaParticipant(null, null, new PfConceptKey(), null, null))
-            .hasMessageMatching(NULL_KEY_ERROR);
-
-        assertThatThrownBy(() -> new JpaParticipant(null, null, new PfConceptKey(), null, null))
+        assertThatThrownBy(() -> new JpaParticipant(null, ParticipantState.ON_LINE, new ArrayList<>()))
             .hasMessageMatching(NULL_KEY_ERROR);
 
-        assertThatThrownBy(() -> new JpaParticipant(null, null, new PfConceptKey(), ParticipantState.ON_LINE, null))
-            .hasMessageMatching(NULL_KEY_ERROR);
-
-        assertThatThrownBy(() -> new JpaParticipant(null, null, new PfConceptKey(), ParticipantState.ON_LINE, null))
-            .hasMessageMatching(NULL_KEY_ERROR);
-
-        assertThatThrownBy(() -> new JpaParticipant(null, new PfConceptKey(), null, null, null))
-            .hasMessageMatching("definition is marked .*ull but is null");
-
-        assertThatThrownBy(() -> new JpaParticipant(null, new PfConceptKey(), null, null, null))
-            .hasMessageMatching("definition is marked .*ull but is null");
-
-        assertThatThrownBy(() -> new JpaParticipant(null, new PfConceptKey(), null, ParticipantState.ON_LINE, null))
-            .hasMessageMatching("definition is marked .*ull but is null");
-
-        assertThatThrownBy(() -> new JpaParticipant(null, new PfConceptKey(), null, ParticipantState.ON_LINE, null
-        )).hasMessageMatching("definition is marked .*ull but is null");
-
-        assertThatThrownBy(() -> new JpaParticipant(null, new PfConceptKey(), new PfConceptKey(), null, null))
+        assertThatThrownBy(() -> new JpaParticipant(UUID.randomUUID().toString(), null, new ArrayList<>()))
             .hasMessageMatching("participantState is marked .*ull but is null");
 
-        assertThatThrownBy(
-            () -> new JpaParticipant(null, new PfConceptKey(), new PfConceptKey(), null, null))
-            .hasMessageMatching("participantState is marked .*ull but is null");
+        assertThatThrownBy(() -> new JpaParticipant(UUID.randomUUID().toString(), ParticipantState.ON_LINE, null))
+            .hasMessageMatching("supportedElements is marked .*ull but is null");
 
         assertNotNull(new JpaParticipant());
-        assertNotNull(new JpaParticipant((new PfConceptKey())));
-        assertNotNull(new JpaParticipant(null, new PfConceptKey(), new PfConceptKey(),
-            ParticipantState.ON_LINE, new ArrayList<>()));
-        assertNotNull(new JpaParticipant(UUID.randomUUID().toString(), new PfConceptKey(),
-            new PfConceptKey(), ParticipantState.ON_LINE, new ArrayList<>()));
+        assertNotNull(new JpaParticipant(UUID.randomUUID().toString(), ParticipantState.ON_LINE, new ArrayList<>()));
+
     }
 
     @Test
     void testJpaParticipant() {
-        JpaParticipant testJpaParticipant = createJpaParticipantInstance();
+        var testJpaParticipant = createJpaParticipantInstance();
 
-        Participant participant = createParticipantInstance();
+        var participant = createParticipantInstance();
 
         participant.setParticipantId(testJpaParticipant.toAuthorative().getParticipantId());
 
@@ -117,38 +78,19 @@ class JpaParticipantTest {
 
         assertThatThrownBy(() -> new JpaParticipant((JpaParticipant) null)).isInstanceOf(NullPointerException.class);
 
-        JpaParticipant testJpaParticipantFa = new JpaParticipant();
-        testJpaParticipantFa.setKey(null);
+        var testJpaParticipantFa = new JpaParticipant();
         testJpaParticipantFa.fromAuthorative(participant);
         testJpaParticipantFa.setParticipantId(testJpaParticipant.getParticipantId());
         assertEquals(testJpaParticipant, testJpaParticipantFa);
-        testJpaParticipantFa.setKey(PfConceptKey.getNullKey());
-        testJpaParticipantFa.fromAuthorative(participant);
-        assertEquals(testJpaParticipant, testJpaParticipantFa);
-        testJpaParticipantFa.setKey(new PfConceptKey("participant", "0.0.1"));
-        testJpaParticipantFa.fromAuthorative(participant);
-        assertEquals(testJpaParticipant, testJpaParticipantFa);
-
-        assertEquals("participant", testJpaParticipant.getKey().getName());
-        assertEquals("participant", new JpaParticipant(createJpaParticipantInstance()).getKey().getName());
-        assertEquals("participant",
-            ((PfConceptKey) new JpaParticipant(createJpaParticipantInstance()).getKeys().get(0)).getName());
-
-        testJpaParticipant.clean();
-        assertEquals("participant", testJpaParticipant.getKey().getName());
 
-        testJpaParticipant.setDescription("   A Message   ");
-        testJpaParticipant.clean();
-        assertEquals("A Message", testJpaParticipant.getDescription());
-
-        JpaParticipant testJpaParticipant2 = new JpaParticipant(testJpaParticipant);
+        var testJpaParticipant2 = new JpaParticipant(testJpaParticipant);
         testJpaParticipant2.setParticipantId(testJpaParticipant.getParticipantId());
         assertEquals(testJpaParticipant, testJpaParticipant2);
     }
 
     @Test
     void testJpaParticipantValidation() {
-        JpaParticipant testJpaParticipant = createJpaParticipantInstance();
+        var testJpaParticipant = createJpaParticipantInstance();
 
         assertThatThrownBy(() -> testJpaParticipant.validate(null))
             .hasMessageMatching("fieldName is marked .*ull but is null");
@@ -158,32 +100,22 @@ class JpaParticipantTest {
 
     @Test
     void testJpaParticipantCompareTo() {
-        JpaParticipant testJpaParticipant = createJpaParticipantInstance();
+        var testJpaParticipant = createJpaParticipantInstance();
 
-        JpaParticipant otherJpaParticipant = new JpaParticipant(testJpaParticipant);
+        var otherJpaParticipant = new JpaParticipant(testJpaParticipant);
         otherJpaParticipant.setParticipantId(testJpaParticipant.getParticipantId());
         assertEquals(0, testJpaParticipant.compareTo(otherJpaParticipant));
         assertEquals(-1, testJpaParticipant.compareTo(null));
         assertEquals(0, testJpaParticipant.compareTo(testJpaParticipant));
         assertNotEquals(0, testJpaParticipant.compareTo(new DummyJpaParticipantChild()));
 
-        testJpaParticipant.setKey(new PfConceptKey("BadValue", "0.0.1"));
-        assertNotEquals(0, testJpaParticipant.compareTo(otherJpaParticipant));
-        testJpaParticipant.setKey(new PfConceptKey("participant", "0.0.1"));
-        assertEquals(0, testJpaParticipant.compareTo(otherJpaParticipant));
-
-        testJpaParticipant.setDefinition(new PfConceptKey("BadValue", "0.0.1"));
-        assertNotEquals(0, testJpaParticipant.compareTo(otherJpaParticipant));
-        testJpaParticipant.setDefinition(new PfConceptKey("participantDefinitionName", "0.0.1"));
-        assertEquals(0, testJpaParticipant.compareTo(otherJpaParticipant));
-
         testJpaParticipant.setParticipantState(ParticipantState.OFF_LINE);
         assertNotEquals(0, testJpaParticipant.compareTo(otherJpaParticipant));
         testJpaParticipant.setParticipantState(ParticipantState.ON_LINE);
         assertEquals(0, testJpaParticipant.compareTo(otherJpaParticipant));
         assertEquals(testJpaParticipant, new JpaParticipant(testJpaParticipant));
 
-        JpaParticipant newJpaParticipant = new JpaParticipant(testJpaParticipant);
+        var newJpaParticipant = new JpaParticipant(testJpaParticipant);
         newJpaParticipant.setParticipantId(testJpaParticipant.getParticipantId());
         assertEquals(testJpaParticipant, newJpaParticipant);
     }
@@ -191,7 +123,7 @@ class JpaParticipantTest {
     @Test
     void testJpaParticipantLombok() {
         assertNotNull(new Participant());
-        JpaParticipant p0 = new JpaParticipant();
+        var p0 = new JpaParticipant();
 
         assertThat(p0.toString()).contains("JpaParticipant(");
         assertThat(p0.hashCode()).isNotZero();
@@ -199,11 +131,7 @@ class JpaParticipantTest {
         assertNotEquals(null, p0);
 
 
-        JpaParticipant p1 = new JpaParticipant();
-
-        p1.setDefinition(new PfConceptKey("defName", "0.0.1"));
-        p1.setDescription("Description");
-        p1.setKey(new PfConceptKey("participant", "0.0.1"));
+        var p1 = new JpaParticipant();
         p1.setParticipantState(ParticipantState.ON_LINE);
 
         assertThat(p1.toString()).contains("Participant(");
@@ -213,28 +141,24 @@ class JpaParticipantTest {
 
         assertNotEquals(p1, p0);
 
-        JpaParticipant p2 = new JpaParticipant();
+        var p2 = new JpaParticipant();
         p2.setParticipantId(p0.getParticipantId());
         assertEquals(p2, p0);
     }
 
     private JpaParticipant createJpaParticipantInstance() {
-        Participant testParticipant = createParticipantInstance();
-        JpaParticipant testJpaParticipant = new JpaParticipant();
-        testJpaParticipant.setKey(null);
+        var testParticipant = createParticipantInstance();
+        var testJpaParticipant = new JpaParticipant();
         testParticipant.setParticipantId(UUID.fromString(testJpaParticipant.getParticipantId()));
         testJpaParticipant.fromAuthorative(testParticipant);
-        testJpaParticipant.setKey(PfConceptKey.getNullKey());
         testJpaParticipant.fromAuthorative(testParticipant);
 
         return testJpaParticipant;
     }
 
     private Participant createParticipantInstance() {
-        Participant testParticipant = new Participant();
-        testParticipant.setName("participant");
-        testParticipant.setVersion("0.0.1");
-        testParticipant.setDefinition(new ToscaConceptIdentifier("participantDefinitionName", "0.0.1"));
+        var testParticipant = new Participant();
+        testParticipant.setParticipantId(UUID.randomUUID());
         testParticipant.setParticipantType(new ToscaConceptIdentifier("participantTypeName", "0.0.1"));
         testParticipant.setParticipantSupportedElementTypes(new LinkedHashMap<>());
 
index 325272b..a40d1cc 100644 (file)
@@ -38,22 +38,20 @@ import org.onap.policy.clamp.models.acm.persistence.repository.ParticipantReposi
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
-import org.onap.policy.models.base.PfConceptKey;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
 class ParticipantProviderTest {
 
     private static final Coder CODER = new StandardCoder();
     private static final String PARTICIPANT_JSON = "src/test/resources/providers/TestParticipant.json";
     private static final String LIST_IS_NULL = ".*. is marked .*ull but is null";
-    private static final ToscaConceptIdentifier INVALID_ID = new ToscaConceptIdentifier("invalid_name", "1.0.1");
+    private static final UUID INVALID_ID = UUID.randomUUID();
 
     private final List<Participant> inputParticipants = new ArrayList<>();
     private List<JpaParticipant> jpaParticipantList;
     private final String originalJson = ResourceUtils.getResourceAsString(PARTICIPANT_JSON);
 
     @BeforeEach
-    void beforeSetupDao() throws Exception {
+    void beforeSetup() throws Exception {
         inputParticipants.add(CODER.decode(originalJson, Participant.class));
         jpaParticipantList = ProviderUtils.getJpaAndValidateList(inputParticipants, JpaParticipant::new, "participant");
     }
@@ -62,7 +60,7 @@ class ParticipantProviderTest {
     void testParticipantSave() {
         var participantRepository = mock(ParticipantRepository.class);
         for (var participant : jpaParticipantList) {
-            when(participantRepository.getById(new PfConceptKey(participant.getName(), participant.getVersion())))
+            when(participantRepository.getById(participant.getParticipantId()))
                 .thenReturn(participant);
         }
         var participantProvider = new ParticipantProvider(participantRepository);
@@ -71,7 +69,7 @@ class ParticipantProviderTest {
 
         when(participantRepository.save(any())).thenReturn(jpaParticipantList.get(0));
 
-        Participant savedParticipant = participantProvider.saveParticipant(inputParticipants.get(0));
+        var savedParticipant = participantProvider.saveParticipant(inputParticipants.get(0));
         savedParticipant.setParticipantId(inputParticipants.get(0).getParticipantId());
 
         assertThat(savedParticipant).usingRecursiveComparison().isEqualTo(inputParticipants.get(0));
@@ -81,7 +79,7 @@ class ParticipantProviderTest {
     void testParticipantUpdate() {
         var participantRepository = mock(ParticipantRepository.class);
         for (var participant : jpaParticipantList) {
-            when(participantRepository.getById(new PfConceptKey(participant.getName(), participant.getVersion())))
+            when(participantRepository.getById(participant.getParticipantId()))
                 .thenReturn(participant);
         }
         var participantProvider = new ParticipantProvider(participantRepository);
@@ -91,7 +89,7 @@ class ParticipantProviderTest {
 
         when(participantRepository.save(any())).thenReturn(jpaParticipantList.get(0));
 
-        Participant updatedParticipant = participantProvider.updateParticipant(inputParticipants.get(0));
+        var updatedParticipant = participantProvider.updateParticipant(inputParticipants.get(0));
         updatedParticipant.setParticipantId(inputParticipants.get(0).getParticipantId());
         assertThat(updatedParticipant).usingRecursiveComparison().isEqualTo(inputParticipants.get(0));
     }
@@ -106,7 +104,7 @@ class ParticipantProviderTest {
         when(participantRepository.findAll()).thenReturn(jpaParticipantList);
         assertThat(participantProvider.getParticipants()).hasSize(inputParticipants.size());
 
-        when(participantRepository.findByParticipantId(any())).thenReturn(
+        when(participantRepository.findById(any())).thenReturn(
             Optional.ofNullable(jpaParticipantList.get(0)));
 
         var participant = participantProvider.getParticipantById(inputParticipants.get(0)
@@ -120,15 +118,14 @@ class ParticipantProviderTest {
         var participantRepository = mock(ParticipantRepository.class);
         var participantProvider = new ParticipantProvider(participantRepository);
 
-        var participantId = UUID.randomUUID();
+        var participantId = inputParticipants.get(0).getParticipantId();
         assertThatThrownBy(() -> participantProvider.deleteParticipant(participantId))
             .hasMessageMatching(".*.failed, participant does not exist");
 
-        when(participantRepository.findByParticipantId(participantId.toString()))
+        when(participantRepository.findById(participantId.toString()))
             .thenReturn(Optional.of(jpaParticipantList.get(0)));
 
-        Participant deletedParticipant =
-            participantProvider.deleteParticipant(participantId);
+        var deletedParticipant = participantProvider.deleteParticipant(participantId);
         assertThat(inputParticipants.get(0)).usingRecursiveComparison().isEqualTo(deletedParticipant);
     }
 }
index 0d47fa6..88ace17 100644 (file)
@@ -20,8 +20,7 @@
 
 package org.onap.policy.clamp.models.acm.utils;
 
-import org.onap.policy.models.base.PfConceptKey;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
+import java.util.UUID;
 
 /**
  * Class to hold/create all parameters for test cases.
@@ -29,14 +28,14 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
  */
 public class CommonTestData {
 
-    public static final ToscaConceptIdentifier PARTCICIPANT_ID = new ToscaConceptIdentifier("id", "1.2.3");
+    public static final UUID PARTCICIPANT_ID = UUID.randomUUID();
 
     /**
      * Returns participantId for test cases.
      *
      * @return participant Id
      */
-    public static ToscaConceptIdentifier getParticipantId() {
+    public static UUID getParticipantId() {
         return PARTCICIPANT_ID;
     }
 
@@ -45,16 +44,16 @@ public class CommonTestData {
      *
      * @return participant Id
      */
-    public static PfConceptKey getJpaParticipantId() {
-        return PARTCICIPANT_ID.asConceptKey();
+    public static String getJpaParticipantId() {
+        return PARTCICIPANT_ID.toString();
     }
 
     /**
-     * Returns second participantId for test cases.
+     * Returns random participantId for test cases.
      *
      * @return participant Id
      */
-    public static ToscaConceptIdentifier getRndParticipantId() {
-        return new ToscaConceptIdentifier("idDiff", "1.2.3");
+    public static UUID getRndParticipantId() {
+        return UUID.randomUUID();
     }
 }
index 54a5924..54bb437 100755 (executable)
@@ -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
index 41c9f99..b31a160 100644 (file)
@@ -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
index 06a1b7c..531a9cd 100644 (file)
@@ -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
index 9cd06ad..7cdefd3 100644 (file)
@@ -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
index fcc2057..9c4e437 100755 (executable)
@@ -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
index 867357e..ced319c 100755 (executable)
@@ -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
index 1f60ffc..a7015d9 100644 (file)
@@ -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
index 1effd4e..bf429df 100644 (file)
@@ -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
index a906cb6..de9794d 100644 (file)
@@ -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
index 8a9619d..3b74066 100644 (file)
@@ -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.
index 7fc7928..62cef60 100644 (file)
@@ -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
index 6af516e..e7b59be 100644 (file)
@@ -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
index b69c5c3..925214e 100644 (file)
@@ -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");
     }
 }
index 434df0d..7a366f6 100644 (file)
@@ -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
index 568ab8a..49b16d2 100644 (file)
@@ -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
index f9023be..7e881b5 100644 (file)
@@ -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;
index 9530848..8f32c6f 100644 (file)
@@ -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;
index b7d66be..4570384 100644 (file)
@@ -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());
index 099c0e7..53288d1 100644 (file)
@@ -243,7 +243,7 @@ public class AutomationCompositionInstantiationProvider {
         var result = new BeanValidationResult("AutomationComposition", automationComposition);
 
         var participantMap = participants.stream()
-                .collect(Collectors.toMap(participant -> participant.getKey().asIdentifier(), Function.identity()));
+                .collect(Collectors.toMap(participant -> participant.getParticipantId(), Function.identity()));
 
         for (var element : automationComposition.getElements().values()) {
 
index 617f756..18a8e8a 100644 (file)
@@ -23,12 +23,11 @@ package org.onap.policy.clamp.acm.runtime.participants;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
+import lombok.RequiredArgsConstructor;
 import org.onap.policy.clamp.acm.runtime.supervision.comm.ParticipantStatusReqPublisher;
-import org.onap.policy.clamp.models.acm.concepts.Participant;
 import org.onap.policy.clamp.models.acm.concepts.ParticipantInformation;
 import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
 import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -36,25 +35,20 @@ import org.springframework.transaction.annotation.Transactional;
 
 @Service
 @Transactional
+@RequiredArgsConstructor
 public class AcmParticipantProvider {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(AcmParticipantProvider.class);
     private final ParticipantProvider participantProvider;
     private final ParticipantStatusReqPublisher participantStatusReqPublisher;
 
-    public AcmParticipantProvider(ParticipantProvider participantProvider,
-                                  ParticipantStatusReqPublisher participantStatusReqPublisher) {
-        this.participantProvider = participantProvider;
-        this.participantStatusReqPublisher = participantStatusReqPublisher;
-    }
-
     /**
      * Get all participants.
      *
      * @return A list of available participants
      */
     public List<ParticipantInformation> getAllParticipants() {
-        List<Participant> participants = this.participantProvider.getParticipants();
+        var participants = this.participantProvider.getParticipants();
 
         List<ParticipantInformation> participantInformationList = new ArrayList<>();
         participants.forEach(participant -> {
@@ -72,8 +66,8 @@ public class AcmParticipantProvider {
      * @return The participant
      */
     public ParticipantInformation getParticipantById(UUID participantId) {
-        Participant participant = this.participantProvider.getParticipantById(participantId);
-        ParticipantInformation participantInformation = new ParticipantInformation();
+        var participant = this.participantProvider.getParticipantById(participantId);
+        var participantInformation = new ParticipantInformation();
         participantInformation.setParticipant(participant);
         return participantInformation;
     }
@@ -84,11 +78,10 @@ public class AcmParticipantProvider {
      * @param participantId The UUID of the participant to send request to
      */
     public void sendParticipantStatusRequest(UUID participantId) {
-        Participant participant = this.participantProvider.getParticipantById(participantId);
-        ToscaConceptIdentifier id = participant.getKey().asIdentifier();
+        var participant = this.participantProvider.getParticipantById(participantId);
 
         LOGGER.debug("Requesting Participant Status Now ParticipantStatusReq");
-        participantStatusReqPublisher.send(id);
+        participantStatusReqPublisher.send(participantId);
         participant.setParticipantState(ParticipantState.OFF_LINE);
         participantProvider.updateParticipant(participant);
     }
@@ -98,6 +91,6 @@ public class AcmParticipantProvider {
      *
      */
     public void sendAllParticipantStatusRequest() {
-        this.participantStatusReqPublisher.send((ToscaConceptIdentifier) null);
+        this.participantStatusReqPublisher.send((UUID) null);
     }
 }
index 6f0f5cc..f585436 100644 (file)
@@ -106,9 +106,7 @@ public class SupervisionParticipantHandler {
         if (participantOpt.isEmpty()) {
             ParticipantRegister registerMessage = (ParticipantRegister) participantMessage;
             var participant = new Participant();
-            participant.setName(registerMessage.getParticipantId().getName());
-            participant.setVersion(registerMessage.getParticipantId().getVersion());
-            participant.setDefinition(registerMessage.getParticipantId());
+            participant.setParticipantId(participantMessage.getParticipantId());
             participant.setParticipantType(registerMessage.getParticipantType());
             participant.setParticipantSupportedElementTypes(listToMap(registerMessage
                 .getParticipantSupportedElementType()));
index f758c98..0e5aab5 100644 (file)
@@ -36,7 +36,6 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantUtils;
 import org.onap.policy.clamp.models.acm.persistence.provider.AcDefinitionProvider;
 import org.onap.policy.clamp.models.acm.persistence.provider.AutomationCompositionProvider;
 import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
-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;
@@ -50,7 +49,7 @@ public class SupervisionScanner {
     private static final Logger LOGGER = LoggerFactory.getLogger(SupervisionScanner.class);
 
     private final HandleCounter<UUID> automationCompositionCounter = new HandleCounter<>();
-    private final HandleCounter<ToscaConceptIdentifier> participantStatusCounter = new HandleCounter<>();
+    private final HandleCounter<UUID> participantStatusCounter = new HandleCounter<>();
 
     private final Map<UUID, Integer> phaseMap = new HashMap<>();
 
@@ -118,7 +117,7 @@ public class SupervisionScanner {
     }
 
     private void scanParticipantStatus(Participant participant) {
-        var id = participant.getKey().asIdentifier();
+        var id = participant.getParticipantId();
         if (participantStatusCounter.isFault(id)) {
             LOGGER.debug("report Participant fault");
             return;
@@ -135,7 +134,7 @@ public class SupervisionScanner {
     /**
      * handle participant Status message.
      */
-    public void handleParticipantStatus(ToscaConceptIdentifier id) {
+    public void handleParticipantStatus(UUID id) {
         participantStatusCounter.clear(id);
     }
 
index bd8f2b5..3cadff6 100644 (file)
@@ -40,7 +40,7 @@ public class ParticipantRegisterAckPublisher extends AbstractParticipantAckPubli
      * @param participantType the participant Type
      */
     @Timed(value = "publisher.participant_register_ack", description = "PARTICIPANT_REGISTER_ACK messages published")
-    public void send(UUID responseTo, ToscaConceptIdentifier participantId, ToscaConceptIdentifier participantType) {
+    public void send(UUID responseTo, UUID participantId, ToscaConceptIdentifier participantType) {
         var message = new ParticipantRegisterAck();
         message.setParticipantId(participantId);
         message.setParticipantType(participantType);
index d1f183e..db69cda 100644 (file)
@@ -22,8 +22,8 @@ package org.onap.policy.clamp.acm.runtime.supervision.comm;
 
 import io.micrometer.core.annotation.Timed;
 import java.time.Instant;
+import java.util.UUID;
 import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatusReq;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
@@ -39,7 +39,7 @@ public class ParticipantStatusReqPublisher extends AbstractParticipantPublisher<
      * @param participantId the participant Id
      */
     @Timed(value = "publisher.participant_status_req", description = "PARTICIPANT_STATUS_REQ messages published")
-    public void send(ToscaConceptIdentifier participantId) {
+    public void send(UUID participantId) {
         ParticipantStatusReq message = new ParticipantStatusReq();
         message.setParticipantId(participantId);
         message.setTimestamp(Instant.now());
index af90238..504ddc2 100644 (file)
@@ -68,7 +68,7 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par
      * @param participantId the ParticipantId
      */
     @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published")
-    public void sendCommissioning(ToscaConceptIdentifier participantType, ToscaConceptIdentifier participantId) {
+    public void sendCommissioning(ToscaConceptIdentifier participantType, UUID participantId) {
         var list = acDefinitionProvider.getAllAcDefinitions();
         if (list.isEmpty()) {
             LOGGER.warn("No tosca service template found, cannot send participantupdate");
@@ -88,7 +88,7 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par
      */
     @Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published")
     public void sendCommissioning(AutomationCompositionDefinition acmDefinition,
-            ToscaConceptIdentifier participantType, ToscaConceptIdentifier participantId) {
+            ToscaConceptIdentifier participantType, UUID participantId) {
         var message = new ParticipantUpdate();
         message.setCompositionId(acmDefinition.getCompositionId());
         message.setParticipantType(participantType);
index 55b99b2..a1d0a99 100644 (file)
                         "name": "org.onap.policy.clamp.acm.HttpParticipant",
                         "version": "2.3.4"
                     },
-                    "participantId": {
-                        "name": "HttpParticipant0",
-                        "version": "1.0.0"
-                    },
+                    "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
                     "state": "UNINITIALISED",
                     "orderedState": "UNINITIALISED",
                     "description": "Sink Automation Composition Element for the Demo",
                         "name": "org.onap.policy.clamp.acm.HttpParticipant",
                         "version": "2.3.4"
                     },
-                    "participantId": {
-                        "name": "HttpParticipant0",
-                        "version": "1.0.0"
-                    },
+                    "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
                     "state": "UNINITIALISED",
                     "orderedState": "UNINITIALISED",
                     "description": "Bridge Automation Composition Element for the Demo",
                         "name": "org.onap.policy.clamp.acm.HttpParticipant",
                         "version": "2.3.4"
                     },
-                    "participantId": {
-                        "name": "HttpParticipant0",
-                        "version": "1.0.0"
-                    },
+                    "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
                     "state": "UNINITIALISED",
                     "orderedState": "UNINITIALISED",
                     "description": "Starter Automation Composition Element for the Demo",
index 3fa6506..3b007fd 100644 (file)
@@ -11,9 +11,7 @@ automationCompositionList:
       participantType:
         name: org.onap.policy.clamp.acm.HttpParticipant
         version: 2.3.4
-      participantId:
-        name: HttpParticipant0
-        version: 1.0.0
+      participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01
       state: UNINITIALISED
       orderedState: UNINITIALISED
       description: Sink Automation Composition Element for the Demo
@@ -26,9 +24,7 @@ automationCompositionList:
       participantType:
         name: org.onap.policy.clamp.acm.HttpParticipant
         version: 2.3.4
-      participantId:
-        name: HttpParticipant0
-        version: 1.0.0
+      participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01
       state: UNINITIALISED
       orderedState: UNINITIALISED
       description: Bridge Automation Composition Element for the Demo
@@ -41,9 +37,7 @@ automationCompositionList:
       participantType:
         name: org.onap.policy.clamp.acm.HttpParticipant
         version: 2.3.4
-      participantId:
-        name: HttpParticipant0
-        version: 1.0.0
+      participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01
       state: UNINITIALISED
       orderedState: UNINITIALISED
       description: Starter Automation Composition Element for the Demo
index 4516ccd..1db95e4 100644 (file)
@@ -20,6 +20,7 @@
 
 package org.onap.policy.clamp.acm.runtime.supervision;
 
+import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
@@ -257,7 +258,7 @@ class SupervisionHandlerTest {
                 mock(ParticipantUpdatePublisher.class), AutomationCompositionOrderedState.PASSIVE,
                 AutomationCompositionState.UNINITIALISED);
 
-        handler.handleParticipantMessage(participantUpdateAckMessage);
+        assertThatCode(() -> handler.handleParticipantMessage(participantUpdateAckMessage)).doesNotThrowAnyException();
     }
 
     @Test
index 93f15f6..683dd53 100644 (file)
@@ -130,7 +130,7 @@ class SupervisionScannerTest {
             automationCompositionStateChangePublisher, automationCompositionUpdatePublisher, participantProvider,
             acRuntimeParameterGroup);
 
-        supervisionScanner.handleParticipantStatus(participant.getKey().asIdentifier());
+        supervisionScanner.handleParticipantStatus(participant.getParticipantId());
         supervisionScanner.run(true);
         verify(automationCompositionProvider, times(0)).updateAutomationComposition(any(AutomationComposition.class));
     }
@@ -182,7 +182,6 @@ class SupervisionScannerTest {
 
         var participant = CommonTestData.createParticipant(PARTICIPANT_TYPE, CommonTestData.getParticipantId());
         participant.setParticipantState(ParticipantState.OFF_LINE);
-        participant.setDefinition(new ToscaConceptIdentifier("unknown", "0.0.0"));
         var participantProvider = mock(ParticipantProvider.class);
         when(participantProvider.getParticipants()).thenReturn(List.of(participant));
 
@@ -193,9 +192,9 @@ class SupervisionScannerTest {
             automationCompositionStateChangePublisher, automationCompositionUpdatePublisher, participantProvider,
             acRuntimeParameterGroup);
 
-        supervisionScanner.handleParticipantStatus(participant.getKey().asIdentifier());
+        supervisionScanner.handleParticipantStatus(participant.getParticipantId());
         supervisionScanner.run(true);
-        verify(participantProvider, times(0)).updateParticipant(any());
+        verify(participantProvider, times(0)).saveParticipant(any());
 
         supervisionScanner.run(true);
         verify(participantProvider, times(1)).updateParticipant(any());
index 195afdc..7d80228 100644 (file)
@@ -21,6 +21,7 @@
 package org.onap.policy.clamp.acm.runtime.util;
 
 import java.util.List;
+import java.util.UUID;
 import javax.ws.rs.core.Response.Status;
 import org.onap.policy.clamp.acm.runtime.main.parameters.AcRuntimeParameterGroup;
 import org.onap.policy.clamp.common.acm.exception.AutomationCompositionRuntimeException;
@@ -76,13 +77,13 @@ public class CommonTestData {
     public static List<Participant> createParticipants() {
         var participant1 = createParticipant(
             new ToscaConceptIdentifier("org.onap.policy.clamp.acm.KubernetesParticipant", "2.3.4"),
-            new ToscaConceptIdentifier("K8sParticipant0", "1.0.0"));
+            UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c02"));
         var participant2 = createParticipant(
             new ToscaConceptIdentifier("org.onap.policy.clamp.acm.HttpParticipant", "2.3.4"),
-            new ToscaConceptIdentifier("HttpParticipant0", "1.0.0"));
+            UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c01"));
         var participant3 = createParticipant(
             new ToscaConceptIdentifier("org.onap.policy.clamp.acm.PolicyParticipant", "2.3.1"),
-            new ToscaConceptIdentifier("org.onap.PM_Policy", "1.0.0"));
+            UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c03"));
         return List.of(participant1, participant2, participant3);
     }
 
@@ -94,16 +95,14 @@ public class CommonTestData {
      * @return a new Participant
      */
     public static Participant createParticipant(ToscaConceptIdentifier participantType,
-            ToscaConceptIdentifier participantId) {
+        UUID participantId) {
         var participant = new Participant();
-        participant.setDefinition(participantId);
+        participant.setParticipantId(participantId);
         participant.setParticipantType(participantType);
-        participant.setName(participantId.getName());
-        participant.setVersion(participantId.getVersion());
         return participant;
     }
 
-    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");
     }
 }
index a754de9..77078e6 100644 (file)
                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"
                 "name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"
                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"
index ccfd587..80facb2 100644 (file)
                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"
index 0fe9671..e66f3f6 100644 (file)
                 "name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"
                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"
                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "participantId": {
-                "name": "K8sParticipant0t",
-                "version": "1.0.0"
-            },
+            "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c02",
             "participantType": {
                 "name": "org.onap.policy.clamp.acm.KubernetesParticipant",
                 "version": "2.3.4"
index 75dbed7..d0372a3 100644 (file)
                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"
                 "name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"
                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
                 "version": "1.2.3"
             },
-            "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"