From 04c1754116920f5b43b20f449a39cbfa7a681102 Mon Sep 17 00:00:00 2001 From: sheetalm Date: Wed, 14 Feb 2018 09:39:22 +0530 Subject: Onboarding foundation changes for ItemManager Resolved conflicting changes 1. Split ItemManager to ASDCItemManager and ItemManager 2. ItemManager provides basic capability of item without collaboration 3. AsdcItemManager provides all capabilities of item including collaboration which are required by onboarding 4. ItemManager can be used by other services like activity spec to create a basic item without collaboration features. Change-Id: I6c6dc34a2b1a1745c796099b70e359432e90f85e Issue-ID: SDC-1039 Signed-off-by: sheetalm --- .../rest/services/VendorLicenseModelsImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services') 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 e5db536deb..812e3d94f0 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 @@ -39,8 +39,8 @@ import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; import org.openecomp.sdc.vendorlicense.VendorLicenseManager; import org.openecomp.sdc.vendorlicense.VendorLicenseManagerFactory; import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; -import org.openecomp.sdc.versioning.ItemManager; -import org.openecomp.sdc.versioning.ItemManagerFactory; +import org.openecomp.sdc.versioning.AsdcItemManager; +import org.openecomp.sdc.versioning.AsdcItemManagerFactory; import org.openecomp.sdc.versioning.VersioningManager; import org.openecomp.sdc.versioning.VersioningManagerFactory; import org.openecomp.sdc.versioning.dao.types.Version; @@ -94,7 +94,7 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { private NotificationPropagationManager notifier = NotificationPropagationManagerFactory.getInstance().createInterface(); - private ItemManager itemManager = ItemManagerFactory.getInstance().createInterface(); + private AsdcItemManager asdcItemManager = AsdcItemManagerFactory.getInstance().createInterface(); private VersioningManager versioningManager = VersioningManagerFactory.getInstance().createInterface(); private VendorLicenseManager vendorLicenseManager = @@ -120,7 +120,7 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { GenericCollectionWrapper results = new GenericCollectionWrapper<>(); MapItemToDto mapper = new MapItemToDto(); - itemManager.list(itemPredicate).stream() + asdcItemManager.list(itemPredicate).stream() .sorted((o1, o2) -> o2.getModificationTime().compareTo(o1.getModificationTime())) .forEach(vspItem -> results.add(mapper.applyMapping(vspItem, ItemDto.class))); return Response.ok(results).build(); @@ -137,7 +137,7 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { UniqueValueUtil .validateUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, item.getName()); - item = itemManager.create(item); + item = asdcItemManager.create(item); UniqueValueUtil .createUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, item.getName()); @@ -202,7 +202,7 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { @Override public Response deleteLicenseModel(String vlmId, String user) { - Item vlm = itemManager.get(vlmId); + Item vlm = asdcItemManager.get(vlmId); if (!vlm.getType().equals(ItemType.vlm.name())){ throw new CoreException((new ErrorCode.ErrorCodeBuilder() @@ -212,7 +212,7 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { Integer certifiedVersionsCounter = vlm.getVersionStatusCounters().get(VersionStatus.Certified); if (Objects.isNull(certifiedVersionsCounter) || certifiedVersionsCounter == 0) { - itemManager.delete(vlm); + asdcItemManager.delete(vlm); permissionsManager.deleteItemPermissions(vlmId); UniqueValueUtil .deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, vlm.getName()); @@ -269,7 +269,7 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels { private void notifyUsers(String itemId, String itemName, Version version, String message, String userName, NotificationEventTypes eventType) { Map eventProperties = new HashMap<>(); - eventProperties.put(ITEM_NAME, itemName == null ? itemManager.get(itemId).getName() : itemName); + eventProperties.put(ITEM_NAME, itemName == null ? asdcItemManager.get(itemId).getName() : itemName); eventProperties.put(ITEM_ID, itemId); if (version != null) { -- cgit 1.2.3-korg