From 2064e725f74edf8fc7873c9ebef1d8bf7f65c5a8 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Thu, 4 Jan 2024 11:15:14 +0000 Subject: Add support for OutProperties instance in deploy scenario Add support for OutProperties instance, operationalState and useState in deploy scenario. Issue-ID: POLICY-4911 Change-Id: I47b5e63b21e4fedd625413de8e80797138fb8d8a Signed-off-by: FrancescoFioraEst --- .../acm/participant/intermediary/handler/CacheProvider.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'participant/participant-intermediary/src/main/java/org/onap') diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java index 08d5ccd32..dc1bb051a 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation. + * Copyright (C) 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,6 +133,7 @@ public class CacheProvider { */ public void initializeAutomationComposition(@NonNull UUID compositionId, @NonNull UUID instanceId, ParticipantDeploy participantDeploy) { + var acLast = automationCompositions.get(instanceId); Map acElementMap = new LinkedHashMap<>(); for (var element : participantDeploy.getAcElementList()) { var acElement = new AutomationCompositionElement(); @@ -142,14 +143,19 @@ public class CacheProvider { acElement.setDeployState(DeployState.DEPLOYING); acElement.setLockState(LockState.NONE); acElement.setProperties(element.getProperties()); + var acElementLast = acLast != null ? acLast.getElements().get(element.getId()) : null; + if (acElementLast != null) { + acElement.setOutProperties(acElementLast.getOutProperties()); + acElement.setOperationalState(acElementLast.getOperationalState()); + acElement.setUseState(acElementLast.getUseState()); + } acElementMap.put(element.getId(), acElement); } - var automationComposition = new AutomationComposition(); automationComposition.setCompositionId(compositionId); automationComposition.setInstanceId(instanceId); automationComposition.setElements(acElementMap); - automationCompositions.put(automationComposition.getInstanceId(), automationComposition); + automationCompositions.put(instanceId, automationComposition); } /** -- cgit 1.2.3-korg