aboutsummaryrefslogtreecommitdiffstats
path: root/models/src/main/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'models/src/main/java/org/onap')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcTypeState.java3
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantRestartAc.java57
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java11
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestart.java61
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java3
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java20
6 files changed, 144 insertions, 11 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcTypeState.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcTypeState.java
index 76851b490..8e36f7a3b 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcTypeState.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AcTypeState.java
@@ -25,5 +25,6 @@ public enum AcTypeState {
COMMISSIONED,
PRIMING,
PRIMED,
- DEPRIMING
+ DEPRIMING,
+ RESTARTING
}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantRestartAc.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantRestartAc.java
new file mode 100644
index 000000000..b8ee0200d
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantRestartAc.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2023 Nordix Foundation.
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.onap.policy.clamp.models.acm.concepts;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.models.base.PfUtils;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@ToString
+public class ParticipantRestartAc {
+
+ private UUID automationCompositionId;
+
+ // current state of auto composition
+ private DeployState deployState;
+ private LockState lockState;
+
+ private List<AcElementDeploy> acElementList = new ArrayList<>();
+
+ /**
+ * Copy constructor.
+ *
+ * @param copyConstructor the participant with updates to copy from
+ */
+ public ParticipantRestartAc(ParticipantRestartAc copyConstructor) {
+ this.automationCompositionId = copyConstructor.automationCompositionId;
+ this.deployState = copyConstructor.deployState;
+ this.lockState = copyConstructor.lockState;
+ this.acElementList = PfUtils.mapList(copyConstructor.acElementList, AcElementDeploy::new);
+ }
+}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
index e60a13202..c42778aae 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
@@ -49,12 +49,6 @@ public enum ParticipantMessageType {
AUTOMATION_COMPOSITION_STATE_CHANGE,
/**
- * Used by the automation composition runtime to order a health check on participants, triggers a
- * PARTICIPANT_STATUS message with the result of the PARTICIPANT_HEALTH_CHECK operation.
- */
- PARTICIPANT_HEALTH_CHECK,
-
- /**
* Used by participant to register itself with automation composition runtime.
*/
PARTICIPANT_REGISTER,
@@ -108,8 +102,7 @@ public enum ParticipantMessageType {
PROPERTIES_UPDATE,
/**
- * Used by participant to acknowledge the receipt of PROPERTIES_UPDATE message
- * from automation composition runtime.
+ * Used by runtime to send composition and instances to a restarted participant.
*/
- PROPERTIES_UPDATE_ACK
+ PARTICIPANT_RESTART
}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestart.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestart.java
new file mode 100644
index 000000000..6b801ce8d
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestart.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2023 Nordix Foundation.
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.onap.policy.clamp.models.acm.messages.dmaap.participant;
+
+import java.util.ArrayList;
+import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantRestartAc;
+import org.onap.policy.models.base.PfUtils;
+
+@Getter
+@Setter
+@ToString(callSuper = true)
+public class ParticipantRestart extends ParticipantMessage {
+
+ // priming
+ private List<ParticipantDefinition> participantDefinitionUpdates = new ArrayList<>();
+
+ // autocomposition list
+ private List<ParticipantRestartAc> autocompositionList = new ArrayList<>();
+
+ /**
+ * Constructor.
+ */
+ public ParticipantRestart() {
+ super(ParticipantMessageType.PARTICIPANT_RESTART);
+ }
+
+ /**
+ * Constructs the object, making a deep copy.
+ *
+ * @param source source from which to copy
+ */
+ public ParticipantRestart(ParticipantRestart source) {
+ super(source);
+ this.participantDefinitionUpdates =
+ PfUtils.mapList(source.participantDefinitionUpdates, ParticipantDefinition::new);
+ this.autocompositionList = PfUtils.mapList(source.autocompositionList, ParticipantRestartAc::new);
+ }
+}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
index 318b36a19..24197f1ab 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
@@ -25,5 +25,6 @@ public enum DeployOrder {
UNDEPLOY,
DEPLOY,
DELETE,
- UPDATE
+ UPDATE,
+ RESTARTING
}
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 671aca60f..ee8e010d2 100644
--- 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
@@ -35,8 +35,10 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
+import org.onap.policy.clamp.models.acm.concepts.AcElementDeploy;
import org.onap.policy.clamp.models.acm.concepts.AcTypeState;
import org.onap.policy.clamp.models.acm.concepts.AutomationComposition;
+import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
import org.onap.policy.clamp.models.acm.concepts.DeployState;
import org.onap.policy.clamp.models.acm.concepts.LockState;
@@ -49,6 +51,7 @@ import org.onap.policy.common.parameters.ObjectValidationResult;
import org.onap.policy.common.parameters.ValidationResult;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.models.base.PfModelRuntimeException;
+import org.onap.policy.models.base.PfUtils;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
@@ -406,4 +409,21 @@ public final class AcmUtils {
element.setLockState(lockState);
}
}
+
+ /**
+ * Create a new AcElementDeploy from an AutomationCompositionElement.
+ *
+ * @param element the AutomationCompositionElement
+ * @param deployOrder the DeployOrder
+ * @return the AcElementDeploy
+ */
+ public static AcElementDeploy createAcElementDeploy(AutomationCompositionElement element, DeployOrder deployOrder) {
+ var acElementDeploy = new AcElementDeploy();
+ acElementDeploy.setId(element.getId());
+ acElementDeploy.setDefinition(new ToscaConceptIdentifier(element.getDefinition()));
+ acElementDeploy.setOrderedState(deployOrder);
+ acElementDeploy.setProperties(PfUtils.mapMap(element.getProperties(), UnaryOperator.identity()));
+ return acElementDeploy;
+ }
+
}