diff options
Diffstat (limited to 'catalog-model/src')
-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, |