summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java6
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServlet.java11
2 files changed, 13 insertions, 4 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java
index ac5af15d6e..962407ca92 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogic.java
@@ -225,7 +225,8 @@ public class ComponentNodeFilterBusinessLogic extends BaseBusinessLogic {
final String constraint,
final int position,
final boolean shouldLock,
- final ComponentTypeEnum componentTypeEnum)
+ final ComponentTypeEnum componentTypeEnum,
+ final NodeFilterConstraintType nodeFilterConstraintType)
throws BusinessLogicException {
final Component component = getComponent(componentId);
@@ -238,7 +239,8 @@ public class ComponentNodeFilterBusinessLogic extends BaseBusinessLogic {
wasLocked = true;
}
final Either<CINodeFilterDataDefinition, StorageOperationStatus> result = nodeFilterOperation
- .deleteConstraint(componentId, componentInstanceId, nodeFilterDataDefinition, position);
+ .deleteConstraint(componentId, componentInstanceId, nodeFilterDataDefinition, position,
+ nodeFilterConstraintType);
if (result.isRight()) {
janusGraphDao.rollback();
throw new BusinessLogicException(componentsUtils.getResponseFormatByResource(componentsUtils
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServlet.java
index a682dc9bed..5146d5e5b5 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServlet.java
@@ -256,9 +256,16 @@ public class ComponentNodeFilterServlet extends AbstractValidationsServlet {
componentNodeFilterBusinessLogic.validateUser(userId);
try {
- final Optional<CINodeFilterDataDefinition>actionResponse = componentNodeFilterBusinessLogic
+ final Optional<NodeFilterConstraintType> nodeFilterConstraintType =
+ NodeFilterConstraintType.parse(constraintType);
+ if (!nodeFilterConstraintType.isPresent()) {
+ return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT_PARAM,
+ "Invalid value for NodeFilterConstraintType enum %s", constraintType));
+ }
+ final Optional<CINodeFilterDataDefinition> actionResponse = componentNodeFilterBusinessLogic
.deleteNodeFilter(componentId.toLowerCase(), componentInstanceId, NodeFilterConstraintAction.DELETE,
- null, index, true, ComponentTypeEnum.findByParamName(componentType));
+ null, index, true, ComponentTypeEnum.findByParamName(componentType),
+ nodeFilterConstraintType.get());
if (!actionResponse.isPresent()) {
LOGGER.debug(FAILED_TO_DELETE_NODE_FILTER);