aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2020-08-24 17:09:20 +0100
committerSébastien Determe <sebastien.determe@intl.att.com>2020-09-07 07:11:49 +0000
commitc70b7081d70edf93aefae514dc688d8dc1835db2 (patch)
tree70f4c24e46e0b9593df169c655de71ea1a808eec /catalog-model
parent0c61108fca142e7e6a9d59453e3b14f2b402e89d (diff)
Add node_filter capabilities
Issue-ID: SDC-3263 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: I2965c8b0b9331b035ba5f9cc7f58d9ea3af26402
Diffstat (limited to 'catalog-model')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeFilterOperation.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeFilterOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeFilterOperation.java
index 69c9f4e59d..02f8e83dde 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeFilterOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeFilterOperation.java
@@ -33,6 +33,7 @@ import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
import org.openecomp.sdc.be.datatypes.elements.CINodeFilterDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.RequirementNodeFilterCapabilityDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.RequirementNodeFilterPropertyDataDefinition;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.model.Component;
@@ -115,6 +116,22 @@ public class NodeFilterOperation extends BaseOperation {
return addOrUpdateNodeFilter(true, componentId, componentInstanceId, nodeFilterDataDefinition);
}
+ public Either<CINodeFilterDataDefinition, StorageOperationStatus> addNewCapabilities(
+ final String componentId, final String componentInstanceId,
+ final CINodeFilterDataDefinition nodeFilterDataDefinition,
+ final RequirementNodeFilterCapabilityDataDefinition requirementNodeFilterCapabilityDataDefinition) {
+
+ ListDataDefinition<RequirementNodeFilterCapabilityDataDefinition> capabilities =
+ nodeFilterDataDefinition.getCapabilities();
+ if(capabilities == null) {
+ capabilities = new ListDataDefinition<>();
+ nodeFilterDataDefinition.setCapabilities(capabilities);
+ }
+ capabilities.getListToscaDataDefinition().add(requirementNodeFilterCapabilityDataDefinition);
+ nodeFilterDataDefinition.setCapabilities(capabilities);
+ return addOrUpdateNodeFilter(true, componentId, componentInstanceId, nodeFilterDataDefinition);
+ }
+
public Either<CINodeFilterDataDefinition, StorageOperationStatus> updateProperties(
final String serviceId, final String componentInstanceId,
final CINodeFilterDataDefinition nodeFilterDataDefinition,