aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-05-10 17:11:04 +0100
committerFrancescoFioraEst <francesco.fiora@est.tech>2023-05-16 08:19:07 +0100
commit722523f568a682f1e48f6998c24c945802fec782 (patch)
treeffe6e47aa4c339023772a15d816af8b509b8142e /models
parentb4b9a1f3c81a1c64271e38d879a84f6b134d3a54 (diff)
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 <francesco.fiora@est.tech>
Diffstat (limited to 'models')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementInfo.java7
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProvider.java1
2 files changed, 8 insertions, 0 deletions
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<String, Object> 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);
}
}