summaryrefslogtreecommitdiffstats
path: root/runtime-acm/src/main
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-04-05 16:32:38 +0100
committerFrancescoFioraEst <francesco.fiora@est.tech>2023-04-11 10:06:21 +0100
commit9f1fdf9f419c1724a9cf75a20fdd24df191766bd (patch)
tree16db3d01d45ae45a4fc776d9d23596ec2c6bcc58 /runtime-acm/src/main
parent2ca7552978f5389ef5ed2e5d4be3cb43e446f7c6 (diff)
Add UseState and OperationalState support in ACM
Issue-ID: POLICY-4639 Change-Id: Iac5249c054bf41d830463826a8f61f477c48235b Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'runtime-acm/src/main')
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandler.java7
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java5
2 files changed, 12 insertions, 0 deletions
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandler.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandler.java
index 5fcb3837f..85beb76c4 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandler.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandler.java
@@ -163,6 +163,13 @@ public class SupervisionAcHandler {
if (element != null) {
element.setDeployState(acElementAck.getValue().getDeployState());
element.setLockState(acElementAck.getValue().getLockState());
+ if (DeployState.DEPLOYED.equals(element.getDeployState())) {
+ element.setOperationalState(acElementAck.getValue().getOperationalState());
+ element.setUseState(acElementAck.getValue().getUseState());
+ } else {
+ element.setOperationalState(null);
+ element.setUseState(null);
+ }
updated = true;
}
}
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
index c1bfcf07a..564fa8d0e 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
@@ -36,6 +36,7 @@ import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDe
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessage;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegister;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatus;
+import org.onap.policy.clamp.models.acm.persistence.provider.AutomationCompositionProvider;
import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,6 +53,7 @@ public class SupervisionParticipantHandler {
private final ParticipantProvider participantProvider;
private final ParticipantRegisterAckPublisher participantRegisterAckPublisher;
private final ParticipantDeregisterAckPublisher participantDeregisterAckPublisher;
+ private final AutomationCompositionProvider automationCompositionProvider;
/**
* Handle a ParticipantRegister message from a participant.
@@ -101,6 +103,9 @@ public class SupervisionParticipantHandler {
LOGGER.debug("Participant Status received {}", participantStatusMsg);
saveParticipantStatus(participantStatusMsg,
listToMap(participantStatusMsg.getParticipantSupportedElementType()));
+ if (!participantStatusMsg.getAutomationCompositionInfoList().isEmpty()) {
+ automationCompositionProvider.upgradeStates(participantStatusMsg.getAutomationCompositionInfoList());
+ }
}
private void saveParticipantStatus(ParticipantMessage participantMessage,