aboutsummaryrefslogtreecommitdiffstats
path: root/models/src
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-12-16 10:17:46 +0000
committerliamfallon <liam.fallon@est.tech>2022-12-16 15:48:41 +0000
commitf5ebd50d9f897c72aa3f6da67ac5d09e53b2c743 (patch)
treee2d69f665b8f168bee9580e4d73573e69e6475f7 /models/src
parent0b5e99601abc5290d241f2082f12758ea46231ef (diff)
Add new endpoints for ACM state handling
This commit introduces the Swagger changes required for the updates to the State Handling in ACM. The Update handling on the endpoints has changed and will be completed in future reviews. In the meantime, some stubs and unit tests have been temporarily disabled. Issue-ID: POLICY-4487 Change-Id: I40b8cbb188d809b43c3e385aea35f88e9ea7da2b Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models/src')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformation.java52
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/commissioning/AcTypeStateUpdate.java34
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/AcInstanceStateUpdate.java41
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/StringToMapConverter.java1
4 files changed, 128 insertions, 0 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformation.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformation.java
new file mode 100644
index 000000000..c2f61aa74
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformation.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021 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.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.NonNull;
+
+/**
+ * Class to represent details of a running participant instance.
+ */
+@NoArgsConstructor
+@Data
+@EqualsAndHashCode
+public class ParticipantInformation {
+ @NonNull
+ private Participant participant;
+
+ private Map<UUID, AutomationCompositionElementDefinition> acElementDefinitionMap = new HashMap<>();
+ private Map<UUID, AutomationCompositionElement> acElementInstanceMap = new HashMap<>();
+
+ /**
+ * Copy constructor.
+ *
+ * @param otherInfo the participant information to copy from
+ */
+ public ParticipantInformation(ParticipantInformation otherInfo) {
+ this.participant = otherInfo.participant;
+ }
+}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/commissioning/AcTypeStateUpdate.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/commissioning/AcTypeStateUpdate.java
new file mode 100644
index 000000000..b5f242804
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/commissioning/AcTypeStateUpdate.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021-2022 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.rest.commissioning;
+
+import lombok.Data;
+
+@Data
+public class AcTypeStateUpdate {
+ public enum PrimeOrder {
+ NONE,
+ PRIME,
+ DEPRIME
+ }
+
+ private PrimeOrder primeOrder;
+}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/AcInstanceStateUpdate.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/AcInstanceStateUpdate.java
new file mode 100644
index 000000000..ed83a494a
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/AcInstanceStateUpdate.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021-2022 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.rest.instantiation;
+
+import lombok.Data;
+
+@Data
+public class AcInstanceStateUpdate {
+ private enum DeployOrder {
+ NONE,
+ UNDEPLOY,
+ DEPLOYED
+ }
+
+ private enum LockOrder {
+ NONE,
+ UNLOCK,
+ LOCK
+ }
+
+ private DeployOrder deployOrder;
+ private LockOrder lockOrder;
+}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/StringToMapConverter.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/StringToMapConverter.java
index 5dccd0862..1e06cb16d 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/StringToMapConverter.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/StringToMapConverter.java
@@ -44,6 +44,7 @@ public class StringToMapConverter implements AttributeConverter<Map<String, Obje
}
}
+ @SuppressWarnings("unchecked")
@Override
public Map<String, Object> convertToEntityAttribute(String dbData) {
if (dbData == null) {