summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main
diff options
context:
space:
mode:
authorsheetalm <sheetal.mudholkar@amdocs.com>2018-02-19 11:05:17 +0530
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-02-19 16:13:04 +0000
commit38b4e81eab76202bcafdec7e0b6374679090ce7e (patch)
treedb6afd3705c212e043cd106e4e44e4934f92d0ea /openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main
parentd299e8af2e9dfa79e53f7cf9e79977bab3474919 (diff)
Onboarding foundation changes - UniqueValueUtil
Refactored UniqueValueUtil Change-Id: I7523ad501de9a49c5fbbb59f33c07a40c55eda2f Issue-ID: SDC-1047 Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java4
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java25
2 files changed, 18 insertions, 11 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java
index 472473fdb0..4a07aee7c6 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java
@@ -1,5 +1,6 @@
package org.openecomp.sdc.vendorlicense.impl;
+import org.openecomp.core.dao.UniqueValueDaoFactory;
import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
import org.openecomp.sdc.vendorlicense.VendorLicenseManagerFactory;
import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory;
@@ -22,7 +23,8 @@ public class VendorLicenseManagerFactoryImpl extends VendorLicenseManagerFactory
FeatureGroupDaoFactory.getInstance().createInterface(),
EntitlementPoolDaoFactory.getInstance().createInterface(),
LicenseKeyGroupDaoFactory.getInstance().createInterface(),
- LimitDaoFactory.getInstance().createInterface());
+ LimitDaoFactory.getInstance().createInterface(),
+ UniqueValueDaoFactory.getInstance().createInterface());
@Override
public VendorLicenseManager createInterface() {
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 8135efa89a..50425c82c4 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
@@ -17,6 +17,7 @@
package org.openecomp.sdc.vendorlicense.impl;
import org.apache.commons.collections.CollectionUtils;
+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;
@@ -52,13 +53,15 @@ import java.util.Optional;
import java.util.Set;
public class VendorLicenseManagerImpl implements VendorLicenseManager {
- private VendorLicenseFacade vendorLicenseFacade;
- private VendorLicenseModelDao vendorLicenseModelDao;
- private LicenseAgreementDao licenseAgreementDao;
- private FeatureGroupDao featureGroupDao;
- private EntitlementPoolDao entitlementPoolDao;
- private LicenseKeyGroupDao licenseKeyGroupDao;
- private LimitDao limitDao;
+ private final UniqueValueUtil uniqueValueUtil;
+ private final VendorLicenseFacade vendorLicenseFacade;
+ private final VendorLicenseModelDao vendorLicenseModelDao;
+ private final LicenseAgreementDao licenseAgreementDao;
+ private final FeatureGroupDao featureGroupDao;
+ private final EntitlementPoolDao entitlementPoolDao;
+ private final LicenseKeyGroupDao licenseKeyGroupDao;
+ private final LimitDao limitDao;
+
private static final String EP_POOL_START_TIME = "T00:00:00Z";
private static final String EP_POOL_EXPIRY_TIME = "T23:59:59Z";
private static final DateTimeFormatter FORMATTER
@@ -69,7 +72,8 @@ public class VendorLicenseManagerImpl implements VendorLicenseManager {
FeatureGroupDao featureGroupDao,
EntitlementPoolDao entitlementPoolDao,
LicenseKeyGroupDao licenseKeyGroupDao,
- LimitDao limitDao) {
+ LimitDao limitDao,
+ UniqueValueDao uniqueValueDao) {
this.vendorLicenseFacade = vendorLicenseFacade;
this.vendorLicenseModelDao = vendorLicenseModelDao;
this.licenseAgreementDao = licenseAgreementDao;
@@ -77,6 +81,7 @@ public class VendorLicenseManagerImpl implements VendorLicenseManager {
this.entitlementPoolDao = entitlementPoolDao;
this.licenseKeyGroupDao = licenseKeyGroupDao;
this.limitDao = limitDao;
+ this.uniqueValueUtil = new UniqueValueUtil(uniqueValueDao);
}
@@ -690,11 +695,11 @@ public class VendorLicenseManagerImpl implements VendorLicenseManager {
protected void updateUniqueName(String uniqueValueType, String oldName, String newName, String...
context) {
- UniqueValueUtil
+ uniqueValueUtil
.updateUniqueValue(uniqueValueType, oldName, newName, context);
}
protected void deleteUniqueName(String uniqueValueType, String... uniqueCombination) {
- UniqueValueUtil.deleteUniqueValue(uniqueValueType, uniqueCombination);
+ uniqueValueUtil.deleteUniqueValue(uniqueValueType, uniqueCombination);
}
}