summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main
diff options
context:
space:
mode:
authorkooper <sergey.sachkov@est.tech>2019-03-12 09:47:48 +0000
committerkooper <sergey.sachkov@est.tech>2019-03-12 09:47:48 +0000
commit56e535b98ea753d7b64dfbdb9d64d380457eaba5 (patch)
treec212ef25a88d82218f6176f7d8743f8eeb17b0e6 /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main
parent0e7aacdd1620cea42a9588702f99f2dc24d78112 (diff)
Get manifest location from Meta file
Change-Id: Ibdf3e3c0a5c045d19e207c7e48f3404ff099fb3c Issue-ID: SDC-2152 Signed-off-by: kooper <sergey.sachkov@est.tech>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java337
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java53
2 files changed, 271 insertions, 119 deletions
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 19d06ed493..51a4bdd3fd 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
@@ -16,6 +16,9 @@
package org.openecomp.sdc.vendorsoftwareproduct.impl;
+import static org.openecomp.sdc.tosca.csar.CSARConstants.TOSCA_META_ENTRY_MANIFEST;
+import static org.openecomp.sdc.tosca.csar.CSARConstants.TOSCA_META_ORIG_PATH_FILE_NAME;
+import static org.openecomp.sdc.tosca.csar.CSARConstants.TOSCA_META_PATH_FILE_NAME;
import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductInvalidErrorBuilder.candidateDataNotProcessedOrAbortedErrorBuilder;
import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductInvalidErrorBuilder.invalidProcessedCandidate;
import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductInvalidErrorBuilder.vspMissingDeploymentFlavorErrorBuilder;
@@ -27,6 +30,7 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@@ -64,6 +68,8 @@ import org.openecomp.sdc.common.errors.ValidationErrorBuilder;
import org.openecomp.sdc.common.utils.CommonUtil;
import org.openecomp.sdc.datatypes.error.ErrorLevel;
import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.tosca.csar.OnboardingToscaMetadata;
+import org.openecomp.sdc.tosca.csar.ToscaMetadata;
import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
import org.openecomp.sdc.validation.util.ValidationManagerUtil;
@@ -136,75 +142,25 @@ import org.openecomp.sdc.versioning.dao.types.Version;
public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductManager {
- private final VspMergeDao vspMergeDao;
- private final OrchestrationTemplateDao orchestrationTemplateDao;
- private final OrchestrationTemplateCandidateManager orchestrationTemplateCandidateManager;
- private final VendorSoftwareProductInfoDao vspInfoDao;
- private final VendorLicenseFacade vendorLicenseFacade;
- private final ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao;
- private final EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao;
- private final VendorLicenseArtifactsService licenseArtifactsService;
- private final InformationArtifactGenerator informationArtifactGenerator;
- private final PackageInfoDao packageInfoDao;
- private final DeploymentFlavorDao deploymentFlavorDao;
- private final ComponentDao componentDao;
- private final ComponentDependencyModelDao componentDependencyModelDao;
- private final NicDao nicDao;
- private final ComputeDao computeDao;
- private final ImageDao imageDao;
- private final ManualVspToscaManager manualVspToscaManager;
- private final UniqueValueUtil uniqueValueUtil;
- private final CandidateService candidateService;
-
- public VendorSoftwareProductManagerImpl(
- VspMergeDao vspMergeDao,
- OrchestrationTemplateDao orchestrationTemplateDataDao,
- OrchestrationTemplateCandidateManager orchestrationTemplateCandidateManager,
- VendorSoftwareProductInfoDao vspInfoDao,
- VendorLicenseFacade vendorLicenseFacade,
- ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao,
- EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao,
- VendorLicenseArtifactsService licenseArtifactsService,
- InformationArtifactGenerator informationArtifactGenerator,
- PackageInfoDao packageInfoDao,
- DeploymentFlavorDao deploymentFlavorDao,
- ComponentDao componentDao,
- ComponentDependencyModelDao componentDependencyModelDao,
- NicDao nicDao,
- ComputeDao computeDao,
- ImageDao imageDao,
- ManualVspToscaManager manualVspToscaManager,
- UniqueValueDao uniqueValueDao,
- CandidateService candidateService) {
- this.vspMergeDao = vspMergeDao;
- this.orchestrationTemplateDao = orchestrationTemplateDataDao;
- this.orchestrationTemplateCandidateManager = orchestrationTemplateCandidateManager;
- this.vspInfoDao = vspInfoDao;
- this.vendorLicenseFacade = vendorLicenseFacade;
- this.serviceModelDao = serviceModelDao;
- this.enrichedServiceModelDao = enrichedServiceModelDao;
- this.licenseArtifactsService = licenseArtifactsService;
- this.informationArtifactGenerator = informationArtifactGenerator;
- this.packageInfoDao = packageInfoDao;
- this.deploymentFlavorDao = deploymentFlavorDao;
- this.componentDao = componentDao;
- this.componentDependencyModelDao = componentDependencyModelDao;
- this.nicDao = nicDao;
- this.computeDao = computeDao;
- this.imageDao = imageDao;
- this.manualVspToscaManager = manualVspToscaManager;
- this.uniqueValueUtil = new UniqueValueUtil(uniqueValueDao);
- this.candidateService = candidateService;
-
- registerToVersioning();
- }
-
- private void registerToVersioning() {
- serviceModelDao.registerVersioning(
- VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
- enrichedServiceModelDao.registerVersioning(
- VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
- }
+ private VspMergeDao vspMergeDao;
+ private OrchestrationTemplateDao orchestrationTemplateDao;
+ private OrchestrationTemplateCandidateManager orchestrationTemplateCandidateManager;
+ private VendorSoftwareProductInfoDao vspInfoDao;
+ private VendorLicenseFacade vendorLicenseFacade;
+ private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao;
+ private EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao;
+ private VendorLicenseArtifactsService licenseArtifactsService;
+ private InformationArtifactGenerator informationArtifactGenerator;
+ private PackageInfoDao packageInfoDao;
+ private DeploymentFlavorDao deploymentFlavorDao;
+ private ComponentDao componentDao;
+ private ComponentDependencyModelDao componentDependencyModelDao;
+ private NicDao nicDao;
+ private ComputeDao computeDao;
+ private ImageDao imageDao;
+ private ManualVspToscaManager manualVspToscaManager;
+ private UniqueValueUtil uniqueValueUtil;
+ private CandidateService candidateService;
@Override
public ValidationResponse validate(VspDetails vspDetails) throws IOException {
@@ -218,10 +174,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
if (!validationResponse.isValid()) {
return validationResponse;
}
- if (vspDetails.getVlmVersion() != null || vspDetails.getLicenseAgreement() != null
- || vspDetails.getFeatureGroups() != null) {
- vspErrors.addAll(validateMandatoryLicenseFields(vspDetails));
- }
+ validateLicense(vspDetails, vspErrors);
OrchestrationTemplateEntity orchestrationTemplate =
orchestrationTemplateDao.get(vspDetails.getId(), vspDetails.getVersion());
ToscaServiceModel serviceModel =
@@ -261,6 +214,13 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
return validationResponse;
}
+ private void validateLicense(VspDetails vspDetails, List<ErrorCode> vspErrors) {
+ if (vspDetails.getVlmVersion() != null || vspDetails.getLicenseAgreement() != null
+ || vspDetails.getFeatureGroups() != null) {
+ vspErrors.addAll(validateMandatoryLicenseFields(vspDetails));
+ }
+ }
+
private void validateOrchestrationTemplateCandidate(ValidationResponse validationResponse,
List<ErrorCode> vspErrors, String vspId,
Version version) {
@@ -352,36 +312,33 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
List<ComponentComputeAssociation> componentComputeAssociations =
deploymentlocalFlavor.getComponentComputeAssociations();
if (CollectionUtils.isEmpty(componentComputeAssociations)) {
- CompositionEntityValidationData compositionEntityValidationData = new
- CompositionEntityValidationData(CompositionEntityType.deployment, deploymentFlavor
- .getId());
- compositionEntityValidationData.setEntityName(deployment
- .getDeploymentFlavorCompositionData().getModel());
- ErrorCode deploymentFlavorErrorBuilder = DeploymentFlavorErrorBuilder
- .getInvalidComponentComputeAssociationErrorBuilder(
- deploymentlocalFlavor.getModel());
-
- errorCodeList.add(deploymentFlavorErrorBuilder);
+ validateCompositionEntity(errorCodeList, deploymentFlavor, deployment, deploymentlocalFlavor);
} else {
componentComputeAssociations.forEach(componentComputeAssociation -> {
if (componentComputeAssociation == null
|| !(componentComputeAssociation.getComponentId() != null
&& componentComputeAssociation.getComputeFlavorId() != null)) {
- CompositionEntityValidationData compositionEntityValidationData = new
- CompositionEntityValidationData(CompositionEntityType.deployment,
- deploymentFlavor.getId());
- compositionEntityValidationData.setEntityName(deployment
- .getDeploymentFlavorCompositionData().getModel());
- ErrorCode deploymentFlavorErrorBuilder = DeploymentFlavorErrorBuilder
- .getInvalidComponentComputeAssociationErrorBuilder(
- deploymentlocalFlavor.getModel());
-
- errorCodeList.add(deploymentFlavorErrorBuilder);
+ validateCompositionEntity(errorCodeList, deploymentFlavor, deployment, deploymentlocalFlavor);
}
});
}
}
+ private void validateCompositionEntity(Collection<ErrorCode> errorCodeList,
+ DeploymentFlavorEntity deploymentFlavor,
+ DeploymentFlavorEntity deployment,
+ DeploymentFlavor deploymentlocalFlavor){
+ CompositionEntityValidationData compositionEntityValidationData = new
+ CompositionEntityValidationData(CompositionEntityType.deployment, deploymentFlavor
+ .getId());
+ compositionEntityValidationData.setEntityName(deployment
+ .getDeploymentFlavorCompositionData().getModel());
+ ErrorCode deploymentFlavorErrorBuilder = DeploymentFlavorErrorBuilder
+ .getInvalidComponentComputeAssociationErrorBuilder(
+ deploymentlocalFlavor.getModel());
+ errorCodeList.add(deploymentFlavorErrorBuilder);
+ }
+
private Set<CompositionEntityValidationData> componentValidation(String vspId, Version version) {
Set<CompositionEntityValidationData> validationData = new HashSet<>();
Collection<ComponentEntity> components =
@@ -625,7 +582,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
OrchestrationTemplateEntity uploadData = orchestrationTemplateDao.get(vspId, version);
ByteBuffer contentData = uploadData.getContentData();
if (contentData == null) {
- return null;
+ return new byte[0];
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -677,9 +634,10 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
ETSIService etsiService = new ETSIServiceImpl();
if(etsiService.isSol004WithToscaMetaDirectory(toscaServiceModel.getArtifactFiles())){
FileContentHandler handler = toscaServiceModel.getArtifactFiles();
- Manifest onboardingManifest = OnboardingManifest.parse(handler.getFileContent(MAIN_SERVICE_TEMPLATE_MF_FILE_NAME));
- etsiService.moveNonManoFileToArtifactFolder(handler, onboardingManifest);
-
+ try(InputStream manifestInputStream = getManifest(handler)) {
+ Manifest onboardingManifest = OnboardingManifest.parse(manifestInputStream);
+ etsiService.moveNonManoFileToArtifactFolder(handler, onboardingManifest);
+ }
}
packageInfo.setTranslatedFile(ByteBuffer.wrap(
toscaServiceTemplateServiceCsar.createOutputFile(toscaServiceModel, licenseArtifacts)));
@@ -688,6 +646,38 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
return packageInfo;
}
+ private InputStream getManifest(FileContentHandler handler) throws IOException {
+ ToscaMetadata metadata = getMetadata(handler);
+ return getManifestInputStream(handler, metadata.getMetaEntries().get(TOSCA_META_ENTRY_MANIFEST));
+ }
+
+ private ToscaMetadata getMetadata(FileContentHandler handler) throws IOException {
+ ToscaMetadata metadata;
+ if(handler.containsFile(TOSCA_META_PATH_FILE_NAME)){
+ metadata = OnboardingToscaMetadata.parseToscaMetadataFile(handler.getFileContent(TOSCA_META_PATH_FILE_NAME));
+
+ }else if(handler.containsFile(TOSCA_META_ORIG_PATH_FILE_NAME)){
+ metadata = OnboardingToscaMetadata.parseToscaMetadataFile(handler.getFileContent(TOSCA_META_ORIG_PATH_FILE_NAME));
+ }else {
+ throw new IOException("TOSCA.meta file not found!");
+ }
+ return metadata;
+ }
+
+ private InputStream getManifestInputStream(FileContentHandler handler, String manifestLocation) throws IOException {
+ InputStream io;
+ if(manifestLocation == null || !handler.containsFile(manifestLocation)){
+ io = handler.getFileContent(MAIN_SERVICE_TEMPLATE_MF_FILE_NAME);
+ }else {
+ io = handler.getFileContent(manifestLocation);
+ }
+
+ if(io == null){
+ throw new IOException("Manifest file not found!");
+ }
+ return io;
+ }
+
void populateVersionsForVlm(String vlmId, Version vlmVersion) {
VersioningManager versioningManager = VersioningManagerFactory.getInstance().createInterface();
versioningManager.list(vlmId).stream()
@@ -878,4 +868,157 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
return serviceModel == null || serviceModel.getEntryDefinitionServiceTemplate() == null;
}
+ public static class Builder{
+ private VspMergeDao vspMergeDao;
+ private OrchestrationTemplateDao orchestrationTemplateDao;
+ private OrchestrationTemplateCandidateManager orchestrationTemplateCandidateManager;
+ private VendorSoftwareProductInfoDao vspInfoDao;
+ private VendorLicenseFacade vendorLicenseFacade;
+ private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao;
+ private EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao;
+ private VendorLicenseArtifactsService licenseArtifactsService;
+ private InformationArtifactGenerator informationArtifactGenerator;
+ private PackageInfoDao packageInfoDao;
+ private DeploymentFlavorDao deploymentFlavorDao;
+ private ComponentDao componentDao;
+ private ComponentDependencyModelDao componentDependencyModelDao;
+ private NicDao nicDao;
+ private ComputeDao computeDao;
+ private ImageDao imageDao;
+ private ManualVspToscaManager manualVspToscaManager;
+ private UniqueValueDao uniqueValueDao;
+ private CandidateService candidateService;
+
+ public Builder vspMerge(VspMergeDao vspMergeDao){
+ this.vspMergeDao = vspMergeDao;
+ return this;
+ }
+
+ public Builder orchestrationTemplate(OrchestrationTemplateDao orchestrationTemplateDao) {
+ this.orchestrationTemplateDao = orchestrationTemplateDao;
+ return this;
+ }
+
+ public Builder orchestrationTemplateCandidateManager(OrchestrationTemplateCandidateManager orchestrationTemplateCandidateManager) {
+ this.orchestrationTemplateCandidateManager = orchestrationTemplateCandidateManager;
+ return this;
+ }
+
+ public Builder vspInfo(VendorSoftwareProductInfoDao vspInfoDao) {
+ this.vspInfoDao = vspInfoDao;
+ return this;
+ }
+
+ public Builder vendorLicenseFacade(VendorLicenseFacade vendorLicenseFacade) {
+ this.vendorLicenseFacade = vendorLicenseFacade;
+ return this;
+ }
+
+ public Builder serviceModel(ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao) {
+ this.serviceModelDao = serviceModelDao;
+ return this;
+ }
+
+ public Builder enrichedServiceModel(EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao) {
+ this.enrichedServiceModelDao = enrichedServiceModelDao;
+ return this;
+ }
+
+ public Builder licenseArtifactsService(VendorLicenseArtifactsService licenseArtifactsService) {
+ this.licenseArtifactsService = licenseArtifactsService;
+ return this;
+ }
+
+ public Builder informationArtifactGenerator(InformationArtifactGenerator informationArtifactGenerator) {
+ this.informationArtifactGenerator = informationArtifactGenerator;
+ return this;
+ }
+
+ public Builder packageInfo(PackageInfoDao packageInfoDao) {
+ this.packageInfoDao = packageInfoDao;
+ return this;
+ }
+
+ public Builder deploymentFlavor(DeploymentFlavorDao deploymentFlavorDao) {
+ this.deploymentFlavorDao = deploymentFlavorDao;
+ return this;
+ }
+
+ public Builder component(ComponentDao componentDao) {
+ this.componentDao = componentDao;
+ return this;
+ }
+
+ public Builder componentDependencyModel(ComponentDependencyModelDao componentDependencyModelDao) {
+ this.componentDependencyModelDao = componentDependencyModelDao;
+ return this;
+ }
+
+ public Builder nic(NicDao nicDao) {
+ this.nicDao = nicDao;
+ return this;
+ }
+
+ public Builder compute(ComputeDao computeDao) {
+ this.computeDao = computeDao;
+ return this;
+ }
+
+ public Builder image(ImageDao imageDao) {
+ this.imageDao = imageDao;
+ return this;
+ }
+
+ public Builder manualVspToscaManager(ManualVspToscaManager manualVspToscaManager) {
+ this.manualVspToscaManager = manualVspToscaManager;
+ return this;
+ }
+
+ public Builder uniqueValue(UniqueValueDao uniqueValueDao) {
+ this.uniqueValueDao = uniqueValueDao;
+ return this;
+ }
+
+ public Builder candidateService(CandidateService candidateService) {
+ this.candidateService = candidateService;
+ return this;
+ }
+
+ private void registerToVersioning() {
+ if(serviceModelDao != null) {
+ serviceModelDao.registerVersioning(
+ VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
+ }
+ if(enrichedServiceModelDao != null) {
+ enrichedServiceModelDao.registerVersioning(
+ VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
+ }
+ }
+
+ public VendorSoftwareProductManager build(){
+ VendorSoftwareProductManagerImpl vendorSoftwareProductManager = new VendorSoftwareProductManagerImpl();
+ vendorSoftwareProductManager.vspMergeDao = this.vspMergeDao;
+ vendorSoftwareProductManager.orchestrationTemplateDao = this.orchestrationTemplateDao;
+ vendorSoftwareProductManager.orchestrationTemplateCandidateManager = this.orchestrationTemplateCandidateManager;
+ vendorSoftwareProductManager.vspInfoDao = this.vspInfoDao;
+ vendorSoftwareProductManager.vendorLicenseFacade = this.vendorLicenseFacade;
+ vendorSoftwareProductManager.serviceModelDao = this.serviceModelDao;
+ vendorSoftwareProductManager.enrichedServiceModelDao = this.enrichedServiceModelDao;
+ vendorSoftwareProductManager.licenseArtifactsService = this.licenseArtifactsService;
+ vendorSoftwareProductManager.informationArtifactGenerator = this.informationArtifactGenerator;
+ vendorSoftwareProductManager.packageInfoDao = this.packageInfoDao;
+ vendorSoftwareProductManager.deploymentFlavorDao = this.deploymentFlavorDao;
+ vendorSoftwareProductManager.componentDao = this.componentDao;
+ vendorSoftwareProductManager.componentDependencyModelDao = this.componentDependencyModelDao;
+ vendorSoftwareProductManager.nicDao = this.nicDao;
+ vendorSoftwareProductManager.computeDao = this.computeDao;
+ vendorSoftwareProductManager.imageDao = this.imageDao;
+ vendorSoftwareProductManager.manualVspToscaManager = this.manualVspToscaManager;
+ vendorSoftwareProductManager.uniqueValueUtil = new UniqueValueUtil(this.uniqueValueDao);
+ vendorSoftwareProductManager.candidateService = candidateService;
+ this.registerToVersioning();
+ return vendorSoftwareProductManager;
+ }
+ }
+
}
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 75351e2fc5..b0385a373b 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
@@ -24,32 +24,41 @@ import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManagerFactory;
import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.*;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspMergeDaoFactory;
import org.openecomp.sdc.vendorsoftwareproduct.factory.CandidateServiceFactory;
import org.openecomp.sdc.vendorsoftwareproduct.factory.InformationArtifactGeneratorFactory;
public class VspManagerFactoryImpl extends VspManagerFactory {
- private static final VendorSoftwareProductManager INSTANCE =
- new VendorSoftwareProductManagerImpl(
- VspMergeDaoFactory.getInstance().createInterface(),
- OrchestrationTemplateDaoFactory.getInstance().createInterface(),
- OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface(),
- VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(),
- VendorLicenseFacadeFactory.getInstance().createInterface(),
- ServiceModelDaoFactory.getInstance().createInterface(),
- EnrichedServiceModelDaoFactory.getInstance().createInterface(),
- VendorLicenseArtifactServiceFactory.getInstance().createInterface(),
- InformationArtifactGeneratorFactory.getInstance().createInterface(),
- PackageInfoDaoFactory.getInstance().createInterface(),
- DeploymentFlavorDaoFactory.getInstance().createInterface(),
- ComponentDaoFactory.getInstance().createInterface(),
- ComponentDependencyModelDaoFactory.getInstance().createInterface(),
- NicDaoFactory.getInstance().createInterface(),
- ComputeDaoFactory.getInstance().createInterface(),
- ImageDaoFactory.getInstance().createInterface(),
- new ManualVspToscaManagerImpl(),
- UniqueValueDaoFactory.getInstance().createInterface(), CandidateServiceFactory
- .getInstance().createInterface());
+ private static final VendorSoftwareProductManager INSTANCE = new VendorSoftwareProductManagerImpl.Builder()
+ .vspMerge(VspMergeDaoFactory.getInstance().createInterface())
+ .orchestrationTemplate(OrchestrationTemplateDaoFactory.getInstance().createInterface())
+ .orchestrationTemplateCandidateManager(OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface())
+ .vspInfo(VendorSoftwareProductInfoDaoFactory.getInstance().createInterface())
+ .vendorLicenseFacade(VendorLicenseFacadeFactory.getInstance().createInterface())
+ .serviceModel(ServiceModelDaoFactory.getInstance().createInterface())
+ .enrichedServiceModel(EnrichedServiceModelDaoFactory.getInstance().createInterface())
+ .licenseArtifactsService(VendorLicenseArtifactServiceFactory.getInstance().createInterface())
+ .informationArtifactGenerator(InformationArtifactGeneratorFactory.getInstance().createInterface())
+ .packageInfo(PackageInfoDaoFactory.getInstance().createInterface())
+ .deploymentFlavor(DeploymentFlavorDaoFactory.getInstance().createInterface())
+ .component(ComponentDaoFactory.getInstance().createInterface())
+ .componentDependencyModel(ComponentDependencyModelDaoFactory.getInstance().createInterface())
+ .nic(NicDaoFactory.getInstance().createInterface())
+ .compute(ComputeDaoFactory.getInstance().createInterface())
+ .image(ImageDaoFactory.getInstance().createInterface())
+ .manualVspToscaManager(new ManualVspToscaManagerImpl())
+ .uniqueValue(UniqueValueDaoFactory.getInstance().createInterface())
+ .candidateService(CandidateServiceFactory.getInstance().createInterface())
+ .build();
@Override
public VendorSoftwareProductManager createInterface() {