From cbc13a90060421059c0c2ae2f5d6f5ddcc406d8f Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Fri, 29 Jul 2022 15:43:16 +0100 Subject: Create concepts models for the test microservice Issue-ID: POLICY-4315 Change-Id: I55b5b4e909aa58b7c39fa96e88eca16bad73761d Signed-off-by: FrancescoFioraEst --- .../acm/messages/dmaap/element/ElementMessage.java | 46 ++++++++++++++++++++++ .../acm/messages/rest/element/DmaapConfig.java | 37 +++++++++++++++++ .../acm/messages/rest/element/ElementConfig.java | 36 +++++++++++++++++ .../acm/messages/rest/element/ElementType.java | 26 ++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessage.java create mode 100644 models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/DmaapConfig.java create mode 100644 models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/ElementConfig.java create mode 100644 models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/ElementType.java 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 new file mode 100644 index 000000000..2e73b2bd7 --- /dev/null +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/element/ElementMessage.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 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 java.time.Instant; +import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ElementMessage { + + private ToscaConceptIdentifier elementId; + + private String message; + + private UUID messageId = UUID.randomUUID(); + + /** + * Time-stamp, in milliseconds, when the message was created. Defaults to the + * current time. + */ + private Instant timestamp = Instant.now(); +} diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/DmaapConfig.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/DmaapConfig.java new file mode 100644 index 000000000..0d13bcda5 --- /dev/null +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/DmaapConfig.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 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.element; + +import lombok.Data; + +@Data +public class DmaapConfig { + private String server; + + private String topic; + + private Integer fetchTimeout; + + private String topicCommInfrastructure; + + private boolean useHttps; + +} diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/ElementConfig.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/ElementConfig.java new file mode 100644 index 000000000..d1f064823 --- /dev/null +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/ElementConfig.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 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.element; + +import lombok.Data; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; + +@Data +public class ElementConfig { + + private ToscaConceptIdentifier elementId; + + private ElementType elementType; + + private Integer timerSec; + + private DmaapConfig topicParameterGroup; +} diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/ElementType.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/ElementType.java new file mode 100644 index 000000000..4bc08a36e --- /dev/null +++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/element/ElementType.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 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.element; + +public enum ElementType { + + STARTER, BRIDGE, SINK +} -- cgit 1.2.3-korg