From eafce4b03a77e729e1eb7fce7368e206b7fc9dce Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Thu, 4 Aug 2022 10:35:08 +0100 Subject: Create Message Handler and Activator for the test microservice Issue-ID: POLICY-4319 Change-Id: If096467ad717fdeaf70e6a9079c531a201e6cec7 Signed-off-by: FrancescoFioraEst --- .../acm/messages/dmaap/element/ElementMessage.java | 25 +++++++++++---- .../messages/dmaap/element/ElementMessageType.java | 25 +++++++++++++++ .../acm/messages/dmaap/element/ElementStatus.java | 36 ++++++++++++++++++++++ 3 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessageType.java create mode 100644 models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementStatus.java (limited to 'models/src/main') 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); + } + +} -- cgit 1.2.3-korg