diff options
Diffstat (limited to 'models/src/main/java')
11 files changed, 190 insertions, 40 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementDeploy.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementDeploy.java new file mode 100644 index 000000000..6b6eda319 --- /dev/null +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementDeploy.java @@ -0,0 +1,67 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2023 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.clamp.models.acm.concepts; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.function.UnaryOperator; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.NonNull; +import lombok.ToString; +import org.onap.policy.clamp.models.acm.messages.rest.instantiation.DeployOrder; +import org.onap.policy.models.base.PfConceptKey; +import org.onap.policy.models.base.PfUtils; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; +import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; + +/** + * Class to represent a automation composition instance to send for deploy. + */ +@NoArgsConstructor +@Data +@ToString +public class AcElementDeploy { + + @NonNull + private ToscaConceptIdentifier definition = new ToscaConceptIdentifier(PfConceptKey.getNullKey()); + + @NonNull + private DeployOrder orderedState = DeployOrder.DEPLOY; + + private ToscaServiceTemplate toscaServiceTemplateFragment; + + // A map indexed by the property name. Each map entry is the serialized value of the property, + // which can be deserialized into an instance of the type of the property. + private Map<String, Object> properties = new LinkedHashMap<>(); + + /** + * Copy constructor, does a deep copy but as all fields here are immutable, it's just a regular copy. + * + * @param otherElement the other element to copy from + */ + public AcElementDeploy(final AcElementDeploy otherElement) { + this.definition = new ToscaConceptIdentifier(otherElement.definition); + this.orderedState = otherElement.orderedState; + this.toscaServiceTemplateFragment = otherElement.toscaServiceTemplateFragment; + this.properties = PfUtils.mapMap(otherElement.properties, UnaryOperator.identity()); + } +} diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementAck.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementDeployAck.java index b100f28c0..2db1555bf 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementAck.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementDeployAck.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,11 +29,14 @@ import lombok.ToString; @Setter @AllArgsConstructor @ToString -public class AutomationCompositionElementAck { +public class AcElementDeployAck { // State of the AutomationCompositionElement private AutomationCompositionState state; + // State of the AutomationCompositionElement + private DeployState deployState; + // Result: Success/Fail. private Boolean result; diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationComposition.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationComposition.java index 83c51eadb..18a62ae94 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationComposition.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationComposition.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021-2022 Nordix Foundation. + * Copyright (C) 2021-2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,6 +49,12 @@ public class AutomationComposition extends ToscaEntity implements Comparable<Aut @NonNull private AutomationCompositionOrderedState orderedState = AutomationCompositionOrderedState.UNINITIALISED; + @NonNull + private DeployState deployState = DeployState.UNDEPLOYED; + + @NonNull + private LockState lockState = LockState.LOCKED; + private Map<UUID, AutomationCompositionElement> elements; @NonNull @@ -65,6 +71,8 @@ public class AutomationComposition extends ToscaEntity implements Comparable<Aut this.compositionId = otherAutomationComposition.compositionId; this.state = otherAutomationComposition.state; this.orderedState = otherAutomationComposition.orderedState; + this.deployState = otherAutomationComposition.deployState; + this.lockState = otherAutomationComposition.lockState; this.elements = PfUtils.mapMap(otherAutomationComposition.elements, AutomationCompositionElement::new); this.primed = otherAutomationComposition.primed; } diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElement.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElement.java index b153ef508..ab234f604 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElement.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElement.java @@ -53,6 +53,12 @@ public class AutomationCompositionElement { private AutomationCompositionState state = AutomationCompositionState.UNINITIALISED; @NonNull + private DeployState deployState = DeployState.UNDEPLOYED; + + @NonNull + private LockState lockState = LockState.LOCKED; + + @NonNull private AutomationCompositionOrderedState orderedState = AutomationCompositionOrderedState.UNINITIALISED; private ToscaServiceTemplate toscaServiceTemplateFragment; @@ -77,5 +83,7 @@ public class AutomationCompositionElement { this.toscaServiceTemplateFragment = otherElement.toscaServiceTemplateFragment; this.description = otherElement.description; this.properties = PfUtils.mapMap(otherElement.properties, UnaryOperator.identity()); + this.deployState = otherElement.deployState; + this.lockState = otherElement.lockState; } } diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantUpdates.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantDeploy.java index 031fd5c02..337a09d17 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantUpdates.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantDeploy.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,27 +30,31 @@ import lombok.ToString; import org.onap.policy.models.base.PfUtils; /** - * Class to represent a participant definition update instance. + * Class to represent a participant definition instance for Deploy. */ @Getter @NoArgsConstructor @Data @ToString -public class ParticipantUpdates { +public class ParticipantDeploy { private UUID participantId; // List of AutomationCompositionElement values for a particular participant private List<AutomationCompositionElement> automationCompositionElementList = new ArrayList<>(); + // List of Automation Composition Element Deploy for a particular participant + private List<AcElementDeploy> acElementList = new ArrayList<>(); + /** * Copy constructor, does a deep copy but as all fields here are immutable, it's just a regular copy. * - * @param participantUpdates the participant with updates to copy from + * @param copyConstructor the participant with updates to copy from */ - public ParticipantUpdates(final ParticipantUpdates participantUpdates) { - this.participantId = participantUpdates.participantId; + public ParticipantDeploy(final ParticipantDeploy copyConstructor) { + this.participantId = copyConstructor.participantId; this.automationCompositionElementList = PfUtils.mapList( - participantUpdates.automationCompositionElementList, AutomationCompositionElement::new); + copyConstructor.automationCompositionElementList, AutomationCompositionElement::new); + this.acElementList = PfUtils.mapList(copyConstructor.acElementList, AcElementDeploy::new); } } diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionUpdate.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionDeploy.java index 6bc79f67e..f0ba43f2a 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionUpdate.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionDeploy.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021-2022 Nordix Foundation. + * Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,11 +25,11 @@ import java.util.List; import lombok.Getter; import lombok.Setter; import lombok.ToString; -import org.onap.policy.clamp.models.acm.concepts.ParticipantUpdates; +import org.onap.policy.clamp.models.acm.concepts.ParticipantDeploy; import org.onap.policy.models.base.PfUtils; /** - * Class to represent the AUTOMATION_COMPOSITION_UPDATE message that the automation composition runtime sends to a + * Class to represent the AUTOMATION_COMPOSITION_DEPLOY message that the automation composition runtime sends to a * participant. When a participant receives this message, it creates the automation composition elements contained in * the message and sets them to state PASSIVE. subsequent AUTOMATION_COMPOSITION_STATE_CHANGE messages are used to * activate the automation compositions. @@ -37,18 +37,18 @@ import org.onap.policy.models.base.PfUtils; @Getter @Setter @ToString(callSuper = true) -public class AutomationCompositionUpdate extends ParticipantMessage { +public class AutomationCompositionDeploy extends ParticipantMessage { // A list of ParticipantUpdates instances which carries details of an updated participant. - private List<ParticipantUpdates> participantUpdatesList = new ArrayList<>(); + private List<ParticipantDeploy> participantUpdatesList = new ArrayList<>(); private Integer startPhase = 0; /** * Constructor for instantiating class with message name. * */ - public AutomationCompositionUpdate() { - super(ParticipantMessageType.AUTOMATION_COMPOSITION_UPDATE); + public AutomationCompositionDeploy() { + super(ParticipantMessageType.AUTOMATION_COMPOSITION_DEPLOY); } /** @@ -56,9 +56,9 @@ public class AutomationCompositionUpdate extends ParticipantMessage { * * @param source source from which to copy */ - public AutomationCompositionUpdate(AutomationCompositionUpdate source) { + public AutomationCompositionDeploy(AutomationCompositionDeploy source) { super(source); this.startPhase = source.startPhase; - this.participantUpdatesList = PfUtils.mapList(source.participantUpdatesList, ParticipantUpdates::new); + this.participantUpdatesList = PfUtils.mapList(source.participantUpdatesList, ParticipantDeploy::new); } } diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionAck.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionDeployAck.java index c1ec67c83..8d52955cc 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionAck.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionDeployAck.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021-2022 Nordix Foundation. + * Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ import java.util.function.UnaryOperator; import lombok.Getter; import lombok.Setter; import lombok.ToString; -import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementAck; +import org.onap.policy.clamp.models.acm.concepts.AcElementDeployAck; import org.onap.policy.models.base.PfUtils; /** @@ -38,20 +38,20 @@ import org.onap.policy.models.base.PfUtils; @Getter @Setter @ToString(callSuper = true) -public class AutomationCompositionAck extends ParticipantAckMessage { +public class AutomationCompositionDeployAck extends ParticipantAckMessage { private UUID automationCompositionId; private Integer startPhase; // A map with AutomationCompositionElementID as its key, and a pair of result and message as value per // AutomationCompositionElement. - private Map<UUID, AutomationCompositionElementAck> automationCompositionResultMap = new LinkedHashMap<>(); + private Map<UUID, AcElementDeployAck> automationCompositionResultMap = new LinkedHashMap<>(); /** * Constructor for instantiating ParticipantRegisterAck class with message name. * */ - public AutomationCompositionAck(final ParticipantMessageType messageType) { + public AutomationCompositionDeployAck(final ParticipantMessageType messageType) { super(messageType); } @@ -60,9 +60,10 @@ public class AutomationCompositionAck extends ParticipantAckMessage { * * @param source source from which to copy */ - public AutomationCompositionAck(final AutomationCompositionAck source) { + public AutomationCompositionDeployAck(final AutomationCompositionDeployAck source) { super(source); this.automationCompositionId = source.automationCompositionId; + this.startPhase = source.startPhase; this.automationCompositionResultMap = PfUtils.mapMap(source.automationCompositionResultMap, UnaryOperator.identity()); } diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java index 4f6bcdbf3..502896188 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java @@ -37,10 +37,10 @@ public enum ParticipantMessageType { PARTICIPANT_STATE_CHANGE, /** - * Used by acm runtime to update the automation compositions running on participants, triggers a - * PARTICIPANT_STATUS message with the result of the AUTOMATION_COMPOSITION_UPDATE operation. + * Used by acm runtime to deploy the automation compositions running on participants, triggers a + * PARTICIPANT_STATUS message with the result of the AUTOMATION_COMPOSITION_DEPLOY operation. */ - AUTOMATION_COMPOSITION_UPDATE, + AUTOMATION_COMPOSITION_DEPLOY, /** * Used by acm runtime to change the state of automation compositions in participants, triggers a @@ -86,10 +86,10 @@ public enum ParticipantMessageType { PARTICIPANT_UPDATE_ACK, /** - * Used by participant to acknowledge the receipt of AUTOMATION_COMPOSITION_UPDATE message + * Used by participant to acknowledge the receipt of AUTOMATION_COMPOSITION_DEPLOY message * from automation composition runtime. */ - AUTOMATION_COMPOSITION_UPDATE_ACK, + AUTOMATION_COMPOSITION_DEPLOY_ACK, /** * Used by participant to acknowledge the receipt of AUTOMATION_COMPOSITION_STATE_CHANGE message diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationComposition.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationComposition.java index f9cc880d0..00f83122d 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationComposition.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationComposition.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021-2022 Nordix Foundation. + * Copyright (C) 2021-2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,8 @@ import org.apache.commons.lang3.ObjectUtils; import org.onap.policy.clamp.models.acm.concepts.AutomationComposition; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState; +import org.onap.policy.clamp.models.acm.concepts.DeployState; +import org.onap.policy.clamp.models.acm.concepts.LockState; import org.onap.policy.common.parameters.annotations.NotNull; import org.onap.policy.common.parameters.annotations.Valid; import org.onap.policy.models.base.PfAuthorative; @@ -88,6 +90,14 @@ public class JpaAutomationComposition extends Validated private AutomationCompositionOrderedState orderedState; @Column + @NotNull + private DeployState deployState; + + @Column + @NotNull + private LockState lockState; + + @Column private String description; @Column(columnDefinition = "TINYINT DEFAULT 1") @@ -103,7 +113,7 @@ public class JpaAutomationComposition extends Validated */ public JpaAutomationComposition() { this(UUID.randomUUID().toString(), new PfConceptKey(), UUID.randomUUID().toString(), - AutomationCompositionState.UNINITIALISED, new ArrayList<>()); + AutomationCompositionState.UNINITIALISED, new ArrayList<>(), DeployState.UNDEPLOYED, LockState.LOCKED); } /** @@ -117,12 +127,15 @@ public class JpaAutomationComposition extends Validated */ public JpaAutomationComposition(@NonNull final String instanceId, @NonNull final PfConceptKey key, @NonNull final String compositionId, @NonNull final AutomationCompositionState state, - @NonNull final List<JpaAutomationCompositionElement> elements) { + @NonNull final List<JpaAutomationCompositionElement> elements, + @NonNull final DeployState deployState, @NonNull final LockState lockState) { this.instanceId = instanceId; this.name = key.getName(); this.version = key.getVersion(); this.compositionId = compositionId; this.state = state; + this.deployState = deployState; + this.lockState = lockState; this.elements = elements; } @@ -138,6 +151,8 @@ public class JpaAutomationComposition extends Validated this.compositionId = copyConcept.compositionId; this.state = copyConcept.state; this.orderedState = copyConcept.orderedState; + this.deployState = copyConcept.deployState; + this.lockState = copyConcept.lockState; this.description = copyConcept.description; this.elements = PfUtils.mapList(copyConcept.elements, JpaAutomationCompositionElement::new); this.primed = copyConcept.primed; @@ -162,6 +177,8 @@ public class JpaAutomationComposition extends Validated automationComposition.setCompositionId(UUID.fromString(compositionId)); automationComposition.setState(state); automationComposition.setOrderedState(orderedState != null ? orderedState : state.asOrderedState()); + automationComposition.setDeployState(deployState); + automationComposition.setLockState(lockState); automationComposition.setDescription(description); automationComposition.setPrimed(primed); automationComposition.setElements(new LinkedHashMap<>(this.elements.size())); @@ -180,6 +197,8 @@ public class JpaAutomationComposition extends Validated this.compositionId = automationComposition.getCompositionId().toString(); this.state = automationComposition.getState(); this.orderedState = automationComposition.getOrderedState(); + this.deployState = automationComposition.getDeployState(); + this.lockState = automationComposition.getLockState(); this.description = automationComposition.getDescription(); this.primed = automationComposition.getPrimed(); @@ -231,6 +250,16 @@ public class JpaAutomationComposition extends Validated return result; } + result = ObjectUtils.compare(deployState, other.deployState); + if (result != 0) { + return result; + } + + result = ObjectUtils.compare(lockState, other.lockState); + if (result != 0) { + return result; + } + result = ObjectUtils.compare(description, other.description); if (result != 0) { return result; diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElement.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElement.java index 743bb7fd3..4020243bb 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElement.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElement.java @@ -42,6 +42,8 @@ import org.apache.commons.lang3.ObjectUtils; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState; +import org.onap.policy.clamp.models.acm.concepts.DeployState; +import org.onap.policy.clamp.models.acm.concepts.LockState; import org.onap.policy.common.parameters.annotations.NotNull; import org.onap.policy.common.parameters.annotations.Valid; import org.onap.policy.models.base.PfAuthorative; @@ -91,6 +93,14 @@ public class JpaAutomationCompositionElement extends Validated private AutomationCompositionOrderedState orderedState; @Column + @NotNull + private DeployState deployState; + + @Column + @NotNull + private LockState lockState; + + @Column private String description; @Lob @@ -113,7 +123,8 @@ public class JpaAutomationCompositionElement extends Validated * @param instanceId The id of the automation composition instance */ public JpaAutomationCompositionElement(@NonNull final String elementId, @NonNull final String instanceId) { - this(elementId, instanceId, new PfConceptKey(), AutomationCompositionState.UNINITIALISED); + this(elementId, instanceId, new PfConceptKey(), + AutomationCompositionState.UNINITIALISED, DeployState.UNDEPLOYED, LockState.LOCKED); } /** @@ -126,11 +137,14 @@ public class JpaAutomationCompositionElement extends Validated */ public JpaAutomationCompositionElement(@NonNull final String elementId, @NonNull final String instanceId, @NonNull final PfConceptKey definition, - @NonNull final AutomationCompositionState state) { + @NonNull final AutomationCompositionState state, + @NonNull final DeployState deployState, @NonNull final LockState lockState) { this.elementId = elementId; this.instanceId = instanceId; this.definition = definition; this.state = state; + this.deployState = deployState; + this.lockState = lockState; } /** @@ -147,6 +161,8 @@ public class JpaAutomationCompositionElement extends Validated this.orderedState = copyConcept.orderedState; this.description = copyConcept.description; this.properties = (copyConcept.properties != null ? new LinkedHashMap<>(copyConcept.properties) : null); + this.deployState = copyConcept.deployState; + this.lockState = copyConcept.lockState; } /** @@ -169,6 +185,8 @@ public class JpaAutomationCompositionElement extends Validated element.setOrderedState(orderedState != null ? orderedState : state.asOrderedState()); element.setDescription(description); element.setProperties(PfUtils.mapMap(properties, UnaryOperator.identity())); + element.setDeployState(deployState); + element.setLockState(lockState); return element; } @@ -181,6 +199,8 @@ public class JpaAutomationCompositionElement extends Validated this.orderedState = element.getOrderedState(); this.description = element.getDescription(); properties = PfUtils.mapMap(element.getProperties(), UnaryOperator.identity()); + this.deployState = element.getDeployState(); + this.lockState = element.getLockState(); } @Override @@ -222,6 +242,16 @@ public class JpaAutomationCompositionElement extends Validated return result; } + result = ObjectUtils.compare(deployState, other.deployState); + if (result != 0) { + return result; + } + + result = ObjectUtils.compare(lockState, other.lockState); + if (result != 0) { + return result; + } + return ObjectUtils.compare(description, other.description); } } diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java b/models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java index 9f73cb144..7d1e80f54 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java @@ -41,7 +41,7 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition; import org.onap.policy.clamp.models.acm.concepts.NodeTemplateState; import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition; -import org.onap.policy.clamp.models.acm.concepts.ParticipantUpdates; +import org.onap.policy.clamp.models.acm.concepts.ParticipantDeploy; import org.onap.policy.common.parameters.BeanValidationResult; import org.onap.policy.common.parameters.ObjectValidationResult; import org.onap.policy.common.parameters.ValidationResult; @@ -71,14 +71,14 @@ public final class AcmUtils { * @param participantUpdates list of participantUpdates */ public static void prepareParticipantUpdate(AutomationCompositionElement acElement, - List<ParticipantUpdates> participantUpdates) { + List<ParticipantDeploy> participantUpdates) { if (participantUpdates.isEmpty()) { participantUpdates.add(getAutomationCompositionElementList(acElement)); return; } var participantExists = false; - for (ParticipantUpdates participantUpdate : participantUpdates) { + for (ParticipantDeploy participantUpdate : participantUpdates) { if (participantUpdate.getParticipantId().equals(acElement.getParticipantId())) { participantUpdate.getAutomationCompositionElementList().add(acElement); participantExists = true; @@ -89,8 +89,8 @@ public final class AcmUtils { } } - private static ParticipantUpdates getAutomationCompositionElementList(AutomationCompositionElement acElement) { - var participantUpdate = new ParticipantUpdates(); + private static ParticipantDeploy getAutomationCompositionElementList(AutomationCompositionElement acElement) { + var participantUpdate = new ParticipantDeploy(); participantUpdate.setParticipantId(acElement.getParticipantId()); participantUpdate.getAutomationCompositionElementList().add(acElement); return participantUpdate; |