summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services
diff options
context:
space:
mode:
authorsheetalm <sheetal.mudholkar@amdocs.com>2018-02-14 09:39:22 +0530
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-02-18 19:44:22 +0000
commit04c1754116920f5b43b20f449a39cbfa7a681102 (patch)
tree805a48420c86466c82eace500d5edc6531e1f554 /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services
parent1f79fe6cf0abafc9db0a99f4c9fbd661a5d87b32 (diff)
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 <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java16
1 files changed, 8 insertions, 8 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 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<ItemDto> 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<String, Object> 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) {