From 035d670c792c9408493b3d729a3ac91124c2d4df Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Tue, 1 Aug 2023 09:28:12 +0100 Subject: Backend support for operation milestone filters Issue-ID: SDC-4590 Signed-off-by: JvD_Ericsson Change-Id: If291bd79871eee590c8826800127f543a6ba4b0c --- .../datatypes/elements/FilterDataDefinition.java | 47 ++++++++++++++++++++++ .../elements/MilestoneDataDefinition.java | 8 ++++ .../be/datatypes/enums/JsonPresentationFields.java | 1 + .../java/org/openecomp/sdc/be/utils/TypeUtils.java | 1 + 4 files changed, 57 insertions(+) create mode 100644 common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/FilterDataDefinition.java (limited to 'common-be/src/main/java/org/openecomp') diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/FilterDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/FilterDataDefinition.java new file mode 100644 index 0000000000..d1b9c98129 --- /dev/null +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/FilterDataDefinition.java @@ -0,0 +1,47 @@ +/* + * + * ============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.openecomp.sdc.be.datatypes.elements; + +import java.io.Serializable; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@NoArgsConstructor +public class FilterDataDefinition extends PropertyDataDefinition implements Serializable { + + @Getter + @Setter + private Object filterValue; + + @Getter + @Setter + private String constraint; + + public FilterDataDefinition(FilterDataDefinition activity) { + setName(activity.getName()); + setConstraint(activity.getConstraint()); + setValue(activity.getValue()); + setToscaFunction(activity.getToscaFunction()); + } + +} diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MilestoneDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MilestoneDataDefinition.java index 78681e1434..a608e1cd03 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MilestoneDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MilestoneDataDefinition.java @@ -41,4 +41,12 @@ public class MilestoneDataDefinition extends ToscaDataDefinition implements Seri setToscaPresentationValue(JsonPresentationFields.OPERATION_ACTIVITIES, activities); } + public ListDataDefinition getFilters() { + return (ListDataDefinition) getToscaPresentationValue(JsonPresentationFields.OPERATION_FILTERS); + } + + public void setFilters(ListDataDefinition activities) { + setToscaPresentationValue(JsonPresentationFields.OPERATION_FILTERS, activities); + } + } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java index c4d22a037f..e96477dc68 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java @@ -258,6 +258,7 @@ public enum JsonPresentationFields { OPERATION_INPUTS("inputs", null), OPERATION_OUTPUTS("outputs", null), OPERATION_MILESTONES("milestones", null), + OPERATION_FILTERS("filters", null), OPERATION_ACTIVITIES("activities", null), OPERATION_ACTIVITIES_WORKFLOW("workflow", null), INPUTS("inputs", null), diff --git a/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java b/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java index d4076aee5c..6d291da375 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java @@ -79,6 +79,7 @@ public class TypeUtils { IMPLEMENTATION("implementation"), MILESTONES("milestones"), ACTIVITIES("activities"), + FILTERS("filters"), WORKFLOW("workflow"), SUBSTITUTION_FILTERS("substitution_filter"), DERIVED_FROM_NAME("derivedFromName"), -- cgit 1.2.3-korg