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 --- .../sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java index 185bb93983..480b83bf8f 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java @@ -18,6 +18,7 @@ package org.openecomp.sdcrests.vsp.rest.services; import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.dao.UniqueValueDaoFactory; import org.openecomp.core.util.UniqueValueUtil; import org.openecomp.sdc.activitylog.ActivityLogManager; import org.openecomp.sdc.activitylog.ActivityLogManagerFactory; @@ -136,6 +137,8 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { ActivityLogManagerFactory.getInstance().createInterface(); private final NotificationPropagationManager notifier = NotificationPropagationManagerFactory.getInstance().createInterface(); + private final UniqueValueUtil uniqueValueUtil = new UniqueValueUtil(UniqueValueDaoFactory + .getInstance().createInterface()); @Override public Response createVsp(VspRequestDto vspRequestDto, String user) { @@ -168,9 +171,9 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { item.setOwner(user); item.addProperty(VspItemProperty.ONBOARDING_METHOD, onboardingMethod.name()); - UniqueValueUtil.validateUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, item.getName()); + uniqueValueUtil.validateUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, item.getName()); item = asdcItemManager.create(item); - UniqueValueUtil.createUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, item.getName()); + uniqueValueUtil.createUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, item.getName()); Version version = versioningManager.create(item.getId(), new Version(), null); @@ -296,7 +299,7 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { if (Objects.isNull(certifiedVersionsCounter) || certifiedVersionsCounter == 0) { asdcItemManager.delete(vsp); permissionsManager.deleteItemPermissions(vspId); - UniqueValueUtil.deleteUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, vsp.getName()); + uniqueValueUtil.deleteUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, vsp.getName()); notifyUsers(vspId, vsp.getName(), null, "VSP was deleted", user, NotificationEventTypes.DELETE); -- cgit 1.2.3-korg