From d8ecbcfb5461ad13f72a6def9224a600d29f1090 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Thu, 4 Jan 2024 10:28:13 +0000 Subject: Add OutProperties instance support for restart scenario in acm-model Add support for OutProperties instance, operationalState and useState in restart scenario. Issue-ID: POLICY-4909 Change-Id: I2106bc3bd60ba9ca568acfa64c09a2984ad8a337 Signed-off-by: FrancescoFioraEst --- .../policy/clamp/models/acm/concepts/AcElementRestart.java | 10 +++++++++- .../java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'models/src/main/java/org') diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementRestart.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementRestart.java index 3815989f7..3f0dff2bb 100644 --- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementRestart.java +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcElementRestart.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. @@ -50,12 +50,17 @@ public class AcElementRestart { // State of the AutomationCompositionElement private LockState lockState; + private String operationalState; + private String useState; + 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 properties = new LinkedHashMap<>(); + private Map outProperties = new LinkedHashMap<>(); + /** * Copy constructor, does a deep copy but as all fields here are immutable, it's just a regular copy. * @@ -66,8 +71,11 @@ public class AcElementRestart { this.definition = new ToscaConceptIdentifier(otherElement.definition); this.deployState = otherElement.deployState; this.lockState = otherElement.lockState; + this.operationalState = otherElement.operationalState; + this.useState = otherElement.useState; this.toscaServiceTemplateFragment = otherElement.toscaServiceTemplateFragment; this.properties = PfUtils.mapMap(otherElement.properties, UnaryOperator.identity()); + this.outProperties = PfUtils.mapMap(otherElement.outProperties, UnaryOperator.identity()); } } 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 0fd7ab95c..504d3ef06 100755 --- 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 @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021-2023 Nordix Foundation. + * Copyright (C) 2021-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. @@ -437,7 +437,10 @@ public final class AcmUtils { acElementRestart.setDefinition(new ToscaConceptIdentifier(element.getDefinition())); acElementRestart.setDeployState(element.getDeployState()); acElementRestart.setLockState(element.getLockState()); + acElementRestart.setOperationalState(element.getOperationalState()); + acElementRestart.setUseState(element.getUseState()); acElementRestart.setProperties(PfUtils.mapMap(element.getProperties(), UnaryOperator.identity())); + acElementRestart.setOutProperties(PfUtils.mapMap(element.getOutProperties(), UnaryOperator.identity())); return acElementRestart; } } -- cgit 1.2.3-korg