aboutsummaryrefslogtreecommitdiffstats
path: root/common-be/src
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2023-08-01 09:28:12 +0100
committerMichael Morris <michael.morris@est.tech>2023-09-22 07:43:25 +0000
commit035d670c792c9408493b3d729a3ac91124c2d4df (patch)
tree0437db7e9b647546799236c39b026d538e5e1c60 /common-be/src
parent27633293d6d45521ea985019ea7b99c2009b62c7 (diff)
Backend support for operation milestone filters
Issue-ID: SDC-4590 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: If291bd79871eee590c8826800127f543a6ba4b0c
Diffstat (limited to 'common-be/src')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/FilterDataDefinition.java47
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MilestoneDataDefinition.java8
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java1
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java1
4 files changed, 57 insertions, 0 deletions
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<FilterDataDefinition> getFilters() {
+ return (ListDataDefinition<FilterDataDefinition>) getToscaPresentationValue(JsonPresentationFields.OPERATION_FILTERS);
+ }
+
+ public void setFilters(ListDataDefinition<FilterDataDefinition> 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"),