From 34aeb856c5f1a6016e6b39e1d73ac5a772b703ea Mon Sep 17 00:00:00 2001 From: priyanshu Date: Mon, 22 Oct 2018 12:18:41 +0530 Subject: Discrepancy in Entitlement Pool 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 --- .../sdc/vendorlicense/impl/VendorLicenseManagerImpl.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main') diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java index 3a635de1ee..4183f7950c 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java @@ -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); } } -- cgit 1.2.3-korg