diff options
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src')
6 files changed, 39 insertions, 16 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java index a074557d13..6e462dc370 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java @@ -18,6 +18,7 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.core.dao.UniqueValueDaoFactory; import org.openecomp.core.util.UniqueValueUtil; import org.openecomp.core.utilities.json.JsonSchemaDataGenerator; import org.openecomp.sdc.common.errors.CoreException; @@ -300,30 +301,38 @@ public class ComputeManagerImpl implements ComputeManager { protected void validateUniqueName(String vspId, Version version, String componentId, String name) { - UniqueValueUtil.validateUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, + UniqueValueUtil uniqueValueUtil = + new UniqueValueUtil(UniqueValueDaoFactory.getInstance().createInterface()); + uniqueValueUtil.validateUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, vspId, version.getId(), componentId, name); } protected void createUniqueName(String vspId, Version version, String componentId, String name) { - UniqueValueUtil + UniqueValueUtil uniqueValueUtil = + new UniqueValueUtil(UniqueValueDaoFactory.getInstance().createInterface()); + uniqueValueUtil .createUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, vspId, version.getId(), componentId, name); } protected void updateUniqueName(String vspId, Version version, String componentId, String oldName, String newName) { - UniqueValueUtil + UniqueValueUtil uniqueValueUtil = + new UniqueValueUtil(UniqueValueDaoFactory.getInstance().createInterface()); + uniqueValueUtil .updateUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, oldName, newName, vspId, version.getId(), componentId); } protected void deleteUniqueValue(String vspId, Version version, String componentId, String name) { + UniqueValueUtil uniqueValueUtil = + new UniqueValueUtil(UniqueValueDaoFactory.getInstance().createInterface()); if (componentId == null) { - UniqueValueUtil + uniqueValueUtil .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, vspId, version.getId(), name); } - UniqueValueUtil + uniqueValueUtil .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, vspId, version.getId(), componentId, name); } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerFactoryImpl.java index 7a4e4876d2..b1b8ff4d42 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerFactoryImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerFactoryImpl.java @@ -20,13 +20,15 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; +import org.openecomp.core.dao.UniqueValueDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.ProcessManager; import org.openecomp.sdc.vendorsoftwareproduct.ProcessManagerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory; public class ProcessManagerFactoryImpl extends ProcessManagerFactory { private static final ProcessManager INSTANCE = - new ProcessManagerImpl(ProcessDaoFactory.getInstance().createInterface()); + new ProcessManagerImpl(ProcessDaoFactory.getInstance().createInterface(), + UniqueValueDaoFactory.getInstance().createInterface()); @Override public ProcessManager createInterface() { diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java index 1bdb9b2a28..855007dfd9 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java @@ -16,6 +16,7 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; +import org.openecomp.core.dao.UniqueValueDao; import org.openecomp.core.util.UniqueValueUtil; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.common.errors.CoreException; @@ -42,9 +43,11 @@ public class ProcessManagerImpl implements ProcessManager { private static final String PROCESS_ARTIFACT_NOT_EXIST_MSG = "Process artifact for process with Id %s does not exist for %s with Id %s and version %s"; private final ProcessDao processDao; + private final UniqueValueUtil uniqueValueUtil; - public ProcessManagerImpl(ProcessDao processDao) { + public ProcessManagerImpl(ProcessDao processDao, UniqueValueDao uniqueValueDao) { this.processDao = processDao; + this.uniqueValueUtil = new UniqueValueUtil(uniqueValueDao); } @Override @@ -186,20 +189,20 @@ public class ProcessManagerImpl implements ProcessManager { protected void validateUniqueName(String vspId, Version version, String componentId, String processName) { - UniqueValueUtil.validateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, + uniqueValueUtil.validateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, vspId, version.getId(), componentId, processName); } protected void createUniqueName(String vspId, Version version, String componentId, String processName) { - UniqueValueUtil + uniqueValueUtil .createUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, vspId, version.getId(), componentId, processName); } protected void updateUniqueName(String vspId, Version version, String componentId, String oldProcessName, String newProcessName) { - UniqueValueUtil + uniqueValueUtil .updateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, oldProcessName, newProcessName, vspId, version.getId(), componentId); } @@ -207,11 +210,11 @@ public class ProcessManagerImpl implements ProcessManager { protected void deleteUniqueValue(String vspId, Version version, String componentId, String processName) { if (componentId == null) { - UniqueValueUtil + uniqueValueUtil .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, vspId, version.getId(), processName); } - UniqueValueUtil + uniqueValueUtil .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, vspId, version.getId(), componentId, processName); } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java index 8961df70ea..ad5717af25 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java @@ -18,6 +18,7 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.dao.UniqueValueDao; import org.openecomp.core.enrichment.api.EnrichmentManager; import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory; import org.openecomp.core.model.dao.EnrichedServiceModelDao; @@ -140,6 +141,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa private final ComputeDao computeDao; private final ImageDao imageDao; private final ManualVspToscaManager manualVspToscaManager; + private final UniqueValueUtil uniqueValueUtil; public VendorSoftwareProductManagerImpl( OrchestrationTemplateDao orchestrationTemplateDataDao, @@ -157,7 +159,8 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa NicDao nicDao, ComputeDao computeDao, ImageDao imageDao, - ManualVspToscaManager manualVspToscaManager) { + ManualVspToscaManager manualVspToscaManager, + UniqueValueDao uniqueValueDao) { this.orchestrationTemplateDao = orchestrationTemplateDataDao; this.orchestrationTemplateCandidateManager = orchestrationTemplateCandidateManager; this.vspInfoDao = vspInfoDao; @@ -174,6 +177,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa this.computeDao = computeDao; this.imageDao = imageDao; this.manualVspToscaManager = manualVspToscaManager; + this.uniqueValueUtil = new UniqueValueUtil(uniqueValueDao); registerToVersioning(); } @@ -812,7 +816,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa } void updateUniqueName(String oldVspName, String newVspName) { - UniqueValueUtil.updateUniqueValue( + uniqueValueUtil.updateUniqueValue( VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, oldVspName, newVspName); } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java index 4749e7f2dd..177af3a8bc 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java @@ -16,6 +16,7 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; +import org.openecomp.core.dao.UniqueValueDaoFactory; import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory; import org.openecomp.core.model.dao.ServiceModelDaoFactory; import org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactory; @@ -52,7 +53,8 @@ public class VspManagerFactoryImpl extends VspManagerFactory { NicDaoFactory.getInstance().createInterface(), ComputeDaoFactory.getInstance().createInterface(), ImageDaoFactory.getInstance().createInterface(), - new ManualVspToscaManagerImpl()); + new ManualVspToscaManagerImpl(), + UniqueValueDaoFactory.getInstance().createInterface()); @Override public VendorSoftwareProductManager createInterface() { diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUtil.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUtil.java index fae8f8b697..71890bb9e8 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUtil.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUtil.java @@ -20,6 +20,7 @@ import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConst import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.dao.UniqueValueDaoFactory; import org.openecomp.core.model.dao.ServiceModelDao; import org.openecomp.core.model.dao.ServiceModelDaoFactory; import org.openecomp.core.util.UniqueValueUtil; @@ -282,7 +283,9 @@ public class OrchestrationUtil { Collection<ProcessEntity> processList = processes.get(componentName); processList.forEach(process -> { process.setComponentId(componentId); - UniqueValueUtil.createUniqueValue(PROCESS_NAME, vspId, version.getId(), componentId, + UniqueValueUtil uniqueValueUtil = new UniqueValueUtil(UniqueValueDaoFactory.getInstance() + .createInterface()); + uniqueValueUtil.createUniqueValue(PROCESS_NAME, vspId, version.getId(), componentId, process.getName()); processDao.create(process); if (processArtifact.containsKey(process.getId())) { |