diff options
Diffstat (limited to 'openecomp-be/api')
2 files changed, 12 insertions, 6 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java index 812e3d94f0..b9c2ea3bb8 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java @@ -17,6 +17,7 @@ package org.openecomp.sdcrests.vendorlicense.rest.services; +import org.openecomp.core.dao.UniqueValueDaoFactory; import org.openecomp.core.util.UniqueValueUtil; import org.openecomp.sdc.activitylog.ActivityLogManager; import org.openecomp.sdc.activitylog.ActivityLogManagerFactory; @@ -101,6 +102,8 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { VendorLicenseManagerFactory.getInstance().createInterface(); private ActivityLogManager activityLogManager = ActivityLogManagerFactory.getInstance().createInterface(); + private UniqueValueUtil uniqueValueUtil = new UniqueValueUtil(UniqueValueDaoFactory.getInstance() + .createInterface()); @Override public Response listLicenseModels(String versionStatus, String user) { @@ -135,10 +138,10 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { item.setName(request.getVendorName()); item.setDescription(request.getDescription()); - UniqueValueUtil + uniqueValueUtil .validateUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, item.getName()); item = asdcItemManager.create(item); - UniqueValueUtil + uniqueValueUtil .createUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, item.getName()); Version version = versioningManager.create(item.getId(), new Version(), null); @@ -214,7 +217,7 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { if (Objects.isNull(certifiedVersionsCounter) || certifiedVersionsCounter == 0) { asdcItemManager.delete(vlm); permissionsManager.deleteItemPermissions(vlmId); - UniqueValueUtil + uniqueValueUtil .deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, vlm.getName()); notifyUsers(vlmId, vlm.getName(), null, "VLM was deleted", user, NotificationEventTypes.DELETE); 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); |