From 38b4e81eab76202bcafdec7e0b6374679090ce7e Mon Sep 17 00:00:00 2001 From: sheetalm Date: Mon, 19 Feb 2018 11:05:17 +0530 Subject: Onboarding foundation changes - UniqueValueUtil Refactored UniqueValueUtil Change-Id: I7523ad501de9a49c5fbbb59f33c07a40c55eda2f Issue-ID: SDC-1047 Signed-off-by: sheetalm --- .../java/org/openecomp/sdc/action/impl/ActionManagerImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'openecomp-be/backend/openecomp-sdc-action-manager/src/main') diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java index 1189a9c00a..696c63e498 100644 --- a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java @@ -74,6 +74,7 @@ import java.util.Map; import java.util.UUID; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; +import org.openecomp.core.dao.UniqueValueDaoFactory; import org.openecomp.core.util.UniqueValueUtil; import org.openecomp.core.utilities.CommonMethods; import org.openecomp.core.utilities.json.JsonUtil; @@ -282,9 +283,11 @@ public class ActionManagerImpl implements ActionManager { */ @Override public Action createAction(Action action, String user) throws ActionException { + UniqueValueUtil uniqueValueUtil = + new UniqueValueUtil(UniqueValueDaoFactory.getInstance().createInterface()); try { actionLogPreProcessor(ActionSubOperation.VALIDATE_ACTION_UNIQUE_NAME, TARGET_ENTITY_API); - UniqueValueUtil + uniqueValueUtil .validateUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName()); actionLogPostProcessor(StatusCode.COMPLETE); } catch (CoreException exception) { @@ -314,7 +317,7 @@ public class ActionManagerImpl implements ActionManager { action = actionDao.createAction(action); actionLogPreProcessor(ActionSubOperation.CREATE_ACTION_UNIQUE_VALUE, TARGET_ENTITY_API); - UniqueValueUtil.createUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName()); + uniqueValueUtil.createUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName()); actionLogPostProcessor(StatusCode.COMPLETE); log.metrics(""); @@ -456,7 +459,9 @@ public class ActionManagerImpl implements ActionManager { if (version.equals(new Version(0, 0))) { actionLogPreProcessor(ActionSubOperation.DELETE_UNIQUEVALUE, TARGET_ENTITY_API); - UniqueValueUtil + UniqueValueUtil uniqueValueUtil = + new UniqueValueUtil(UniqueValueDaoFactory.getInstance().createInterface()); + uniqueValueUtil .deleteUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName()); actionLogPostProcessor(StatusCode.COMPLETE); log.metrics(""); -- cgit 1.2.3-korg