Discrepancy in Entitlement Pool 13/70913/2 1.3.0
authorpriyanshu <pagarwal@amdocs.com>
Mon, 22 Oct 2018 06:48:41 +0000 (12:18 +0530)
committerOren Kleks <orenkle@amdocs.com>
Mon, 22 Oct 2018 07:32:18 +0000 (07:32 +0000)
Discrepancy in Entitlement Pool between vendor-license-model.xml and vf-license-model.xml

Change-Id: Ic68081c6a2d29840bd2cb6dab10f4c024c7bba86
Issue-ID: SDC-1856
Signed-off-by: priyanshu <pagarwal@amdocs.com>
openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java

index 3a635de..4183f79 100644 (file)
@@ -18,6 +18,7 @@ package org.openecomp.sdc.vendorlicense.impl;
 
 import org.openecomp.core.dao.UniqueValueDao;
 import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
@@ -516,8 +517,11 @@ public class VendorLicenseManagerImpl implements VendorLicenseManager {
   public void updateLimit(LimitEntity limit) {
     getLimit(limit);
     validateLimit(limit);
-    vendorLicenseFacade.updateLimit(limit);
-    updateParentForLimit(limit);
+    LimitEntity retrieved = limitDao.get(limit);
+    if(!retrieved.equals(limit)){
+      vendorLicenseFacade.updateLimit(limit);
+      updateParentForLimit(limit);
+    }
   }
 
   private boolean isLimitPresent(LimitEntity limit) {
@@ -545,14 +549,16 @@ public class VendorLicenseManagerImpl implements VendorLicenseManager {
       EntitlementPoolEntity entitlementPoolEntity =
           entitlementPoolDao.get(new EntitlementPoolEntity(limit.getVendorLicenseModelId(),
               limit.getVersion(), limit.getEpLkgId()));
-      vendorLicenseFacade.updateEntitlementPool(entitlementPoolEntity);
+      entitlementPoolEntity.setVersionUuId(CommonMethods.nextUuId());
+      entitlementPoolDao.update(entitlementPoolEntity);
     }
 
     if ("LicenseKeyGroup".equals(limit.getParent())) {
       LicenseKeyGroupEntity licenseKeyGroupEntity = licenseKeyGroupDao.get(
           new LicenseKeyGroupEntity(limit.getVendorLicenseModelId(), limit.getVersion(),
               limit.getEpLkgId()));
-      vendorLicenseFacade.updateLicenseKeyGroup(licenseKeyGroupEntity);
+      licenseKeyGroupEntity.setVersionUuId(CommonMethods.nextUuId());
+      licenseKeyGroupDao.update(licenseKeyGroupEntity);
     }
   }