diff options
author | aribeiro <anderson.ribeiro@est.tech> | 2020-08-24 17:09:20 +0100 |
---|---|---|
committer | Sébastien Determe <sebastien.determe@intl.att.com> | 2020-09-07 07:11:49 +0000 |
commit | c70b7081d70edf93aefae514dc688d8dc1835db2 (patch) | |
tree | 70f4c24e46e0b9593df169c655de71ea1a808eec /catalog-model | |
parent | 0c61108fca142e7e6a9d59453e3b14f2b402e89d (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.java | 17 |
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, |