Removing restarting field in ACM 13/142013/5 master
authorFrancescoFioraEst <francesco.fiora@est.tech>
Mon, 8 Sep 2025 07:29:11 +0000 (08:29 +0100)
committerFrancescoFioraEst <francesco.fiora@est.tech>
Fri, 12 Sep 2025 08:40:54 +0000 (09:40 +0100)
Issue-ID: POLICY-5404
Change-Id: Ia11c3679e0e821cdc7377f540b149aae08fbe253
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElement.java
models/src/main/java/org/onap/policy/clamp/models/acm/concepts/NodeTemplateState.java
models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElement.java
models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaNodeTemplateState.java
models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElementTest.java
runtime-acm/src/main/resources/db/changelog/changelog-1800.yaml [new file with mode: 0644]
runtime-acm/src/main/resources/db/changelog/db.changelog-master.yaml

index 7d3acaa..d3c655b 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2021-2024 Nordix Foundation.
+ * Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -47,8 +47,6 @@ public class AutomationCompositionElement {
     @NonNull
     private UUID participantId = UUID.randomUUID();
 
-    private Boolean restarting;
-
     @NonNull
     private DeployState deployState = DeployState.UNDEPLOYED;
 
@@ -83,7 +81,6 @@ public class AutomationCompositionElement {
         this.description = otherElement.description;
         this.properties = AcmUtils.cloneMap(otherElement.properties);
         this.outProperties = AcmUtils.cloneMap(otherElement.outProperties);
-        this.restarting = otherElement.restarting;
         this.deployState = otherElement.deployState;
         this.lockState = otherElement.lockState;
         this.subState = otherElement.subState;
index cbe7ef0..f8a650c 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2023 Nordix Foundation.
+ *  Copyright (C) 2023,2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,8 +42,6 @@ public class NodeTemplateState {
 
     private ToscaConceptIdentifier nodeTemplateId;
 
-    private Boolean restarting;
-
     private AcTypeState state;
 
     private String message;
@@ -59,7 +57,6 @@ public class NodeTemplateState {
         this.nodeTemplateStateId = copyConstructor.nodeTemplateStateId;
         this.participantId = copyConstructor.participantId;
         this.nodeTemplateId = new ToscaConceptIdentifier(copyConstructor.nodeTemplateId);
-        this.restarting = copyConstructor.restarting;
         this.state = copyConstructor.state;
         this.message = copyConstructor.message;
         this.outProperties = PfUtils.mapMap(copyConstructor.outProperties, UnaryOperator.identity());
index 15f5479..2255aed 100644 (file)
@@ -82,9 +82,6 @@ public class JpaAutomationCompositionElement extends Validated
     @NotNull
     private String participantId;
 
-    @Column
-    private Boolean restarting;
-
     @Column
     @NotNull
     private DeployState deployState;
@@ -175,11 +172,8 @@ public class JpaAutomationCompositionElement extends Validated
         this.definition = new PfConceptKey(copyConcept.definition);
         this.participantId = copyConcept.participantId;
         this.description = copyConcept.description;
-        this.properties = (copyConcept.properties != null ? new LinkedHashMap<>(copyConcept.properties) : null);
-        this.outProperties =
-                (copyConcept.outProperties != null ? new LinkedHashMap<>(copyConcept.outProperties)
-                        : null);
-        this.restarting = copyConcept.restarting;
+        this.properties = PfUtils.mapMap(copyConcept.properties, UnaryOperator.identity());
+        this.outProperties = PfUtils.mapMap(copyConcept.outProperties, UnaryOperator.identity());
         this.deployState = copyConcept.deployState;
         this.lockState = copyConcept.lockState;
         this.subState = copyConcept.subState;
@@ -208,7 +202,6 @@ public class JpaAutomationCompositionElement extends Validated
         element.setDescription(description);
         element.setProperties(PfUtils.mapMap(properties, UnaryOperator.identity()));
         element.setOutProperties(PfUtils.mapMap(outProperties, UnaryOperator.identity()));
-        element.setRestarting(restarting);
         element.setDeployState(deployState);
         element.setLockState(lockState);
         element.setSubState(subState);
@@ -227,7 +220,6 @@ public class JpaAutomationCompositionElement extends Validated
         this.description = element.getDescription();
         this.properties = PfUtils.mapMap(element.getProperties(), UnaryOperator.identity());
         this.outProperties = PfUtils.mapMap(element.getOutProperties(), UnaryOperator.identity());
-        this.restarting = element.getRestarting();
         this.deployState = element.getDeployState();
         this.lockState = element.getLockState();
         this.subState = element.getSubState();
@@ -266,11 +258,6 @@ public class JpaAutomationCompositionElement extends Validated
             return result;
         }
 
-        result = ObjectUtils.compare(restarting, other.restarting);
-        if (result != 0) {
-            return result;
-        }
-
         result = ObjectUtils.compare(deployState, other.deployState);
         if (result != 0) {
             return result;
index 01d2167..f79e12e 100644 (file)
@@ -68,9 +68,6 @@ public class JpaNodeTemplateState extends Validated implements PfAuthorative<Nod
     @AttributeOverride(name = "version", column = @Column(name = "nodeTemplate_version"))
     private PfConceptKey nodeTemplateId;
 
-    @Column
-    private Boolean restarting;
-
     @Column
     @NotNull
     private AcTypeState state;
@@ -109,7 +106,6 @@ public class JpaNodeTemplateState extends Validated implements PfAuthorative<Nod
             this.participantId = copyConcept.getParticipantId().toString();
         }
         this.nodeTemplateId = copyConcept.getNodeTemplateId().asConceptKey();
-        this.restarting = copyConcept.getRestarting();
         this.state = copyConcept.getState();
         this.message = copyConcept.getMessage();
         this.outProperties = PfUtils.mapMap(copyConcept.getOutProperties(), UnaryOperator.identity());
@@ -123,7 +119,6 @@ public class JpaNodeTemplateState extends Validated implements PfAuthorative<Nod
             nodeTemplateState.setParticipantId(UUID.fromString(this.participantId));
         }
         nodeTemplateState.setNodeTemplateId(new ToscaConceptIdentifier(this.nodeTemplateId));
-        nodeTemplateState.setRestarting(this.restarting);
         nodeTemplateState.setState(this.state);
         nodeTemplateState.setMessage(this.message);
         nodeTemplateState.setOutProperties(PfUtils.mapMap(outProperties, UnaryOperator.identity()));
index fab3dac..19937a4 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2021-2024 Nordix Foundation.
+ * Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -227,11 +227,6 @@ class JpaAutomationCompositionElementTest {
         testJpaAcElement.setMessage(null);
         assertEquals(0, testJpaAcElement.compareTo(otherJpaAcElement));
 
-        testJpaAcElement.setRestarting(true);
-        assertNotEquals(0, testJpaAcElement.compareTo(otherJpaAcElement));
-        testJpaAcElement.setRestarting(null);
-        assertEquals(0, testJpaAcElement.compareTo(otherJpaAcElement));
-
         testJpaAcElement.setParticipantId(UUID.randomUUID().toString());
         assertNotEquals(0, testJpaAcElement.compareTo(otherJpaAcElement));
 
diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1800.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1800.yaml
new file mode 100644 (file)
index 0000000..dc98915
--- /dev/null
@@ -0,0 +1,36 @@
+# ============LICENSE_START=======================================================
+# Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+databaseChangeLog:
+  - objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
+
+  - changeSet:
+      author: policy
+      id: 1800-1
+      changes:
+        - dropColumn:
+            tableName: AutomationCompositionElement
+            columnName: restarting
+
+  - changeSet:
+      author: policy
+      id: 1800-2
+      changes:
+        - dropColumn:
+            tableName: NodeTemplateState
+            columnName: restarting
index 8b20bd3..a98b648 100644 (file)
@@ -32,3 +32,5 @@ databaseChangeLog:
       file: db/changelog/changelog-1701.yaml
   - include:
       file: db/changelog/changelog-1702.yaml
+  - include:
+      file: db/changelog/changelog-1800.yaml