From 722523f568a682f1e48f6998c24c945802fec782 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Wed, 10 May 2023 17:11:04 +0100 Subject: Add participant capability to send message with status and properties Add participant capability to send message with status and properties to ACM-R when those values need to be change. Issue-ID: POLICY-4679 Change-Id: Idca5796c199b235e1f829097316c50688a351e80 Signed-off-by: FrancescoFioraEst --- .../models/acm/concepts/AutomationCompositionElementInfo.java | 7 +++++++ .../acm/persistence/provider/AutomationCompositionProvider.java | 1 + 2 files changed, 8 insertions(+) (limited to 'models') diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementInfo.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementInfo.java index 1eb4bf8cb..9d8fd72ae 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementInfo.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementInfo.java @@ -20,10 +20,14 @@ package org.onap.policy.clamp.models.acm.concepts; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.UUID; +import java.util.function.UnaryOperator; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; +import org.onap.policy.models.base.PfUtils; /** * Class to represent a automation composition element info instance. @@ -43,6 +47,8 @@ public class AutomationCompositionElementInfo { private String useState; + private Map statusProperties = new LinkedHashMap<>(); + /** * Copy constructor, does a deep copy but as all fields here are immutable, it's just a regular copy. * @@ -54,5 +60,6 @@ public class AutomationCompositionElementInfo { this.lockState = otherElement.lockState; this.operationalState = otherElement.operationalState; this.useState = otherElement.useState; + this.statusProperties = PfUtils.mapMap(otherElement.statusProperties, UnaryOperator.identity()); } } diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProvider.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProvider.java index 959fd7637..94693fd0b 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProvider.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProvider.java @@ -203,6 +203,7 @@ public class AutomationCompositionProvider { var jpa = acElementRepository.getReferenceById(element.getAutomationCompositionElementId().toString()); jpa.setUseState(element.getUseState()); jpa.setOperationalState(element.getOperationalState()); + jpa.setProperties(element.getStatusProperties()); jpaList.add(jpa); } } -- cgit 1.2.3-korg