aboutsummaryrefslogtreecommitdiffstats
path: root/models/src/main
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2022-08-04 10:35:08 +0100
committerFrancescoFioraEst <francesco.fiora@est.tech>2022-08-09 14:24:28 +0100
commiteafce4b03a77e729e1eb7fce7368e206b7fc9dce (patch)
treec48f0c1dc5b6a9cdfd3c624d5e246dfdf1d7d353 /models/src/main
parentc0202ca94ae499b88061efbbc06ffde53218a7a5 (diff)
Create Message Handler and Activator for the test microservice
Issue-ID: POLICY-4319 Change-Id: If096467ad717fdeaf70e6a9079c531a201e6cec7 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'models/src/main')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessage.java25
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessageType.java25
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementStatus.java36
3 files changed, 80 insertions, 6 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessage.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessage.java
index 2e73b2bd7..f14b2c4ad 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessage.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessage.java
@@ -22,16 +22,20 @@ package org.onap.policy.clamp.models.acm.messages.dmaap.element;
import java.time.Instant;
import java.util.UUID;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
+@Getter
+@Setter
+@ToString
public class ElementMessage {
+ @Setter(AccessLevel.NONE)
+ private ElementMessageType messageType;
+
private ToscaConceptIdentifier elementId;
private String message;
@@ -43,4 +47,13 @@ public class ElementMessage {
* current time.
*/
private Instant timestamp = Instant.now();
+
+ /**
+ * Constructor for instantiating a element message class.
+ *
+ * @param messageType the message type
+ */
+ public ElementMessage(ElementMessageType messageType) {
+ this.messageType = messageType;
+ }
}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessageType.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessageType.java
new file mode 100644
index 000000000..9cefaf2fb
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessageType.java
@@ -0,0 +1,25 @@
+/*-
+ * ============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.dmaap.element;
+
+public enum ElementMessageType {
+ STATUS, ACK_MSG
+}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementStatus.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementStatus.java
new file mode 100644
index 000000000..844ec8aaa
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementStatus.java
@@ -0,0 +1,36 @@
+/*-
+ * ============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.dmaap.element;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@Getter
+@Setter
+@ToString(callSuper = true)
+public class ElementStatus extends ElementMessage {
+
+ public ElementStatus() {
+ super(ElementMessageType.STATUS);
+ }
+
+}