summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main
diff options
context:
space:
mode:
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.java2
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java4
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java10
3 files changed, 11 insertions, 5 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 dfc4082b3c..1825dadf7f 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
@@ -549,7 +549,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
final FileContentHandler licenseArtifacts = licenseArtifactsService
.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups());
final ETSIService etsiService = new ETSIServiceImpl();
- if (etsiService.isSol004WithToscaMetaDirectory(toscaServiceModel.getArtifactFiles())) {
+ if (etsiService.hasEtsiSol261Metadata(toscaServiceModel.getArtifactFiles())) {
final FileContentHandler handler = toscaServiceModel.getArtifactFiles();
final Manifest manifest = etsiService.getManifest(handler);
final Optional<Map<String, Path>> fromToMovedPaths = etsiService.moveNonManoFileToArtifactFolder(handler);
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java
index 91d2705693..d3ac455a56 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java
@@ -48,8 +48,8 @@ public class ValidatorFactory {
*/
public Validator getValidator(final FileContentHandler fileContentHandler) throws IOException {
final ETSIService etsiService = new ETSIServiceImpl(null);
- if (!etsiService.isSol004WithToscaMetaDirectory(fileContentHandler)) {
- return new ONAPCsarValidator();
+ if (!etsiService.hasEtsiSol261Metadata(fileContentHandler)) {
+ return etsiService.isEtsiPackage(fileContentHandler) ? new EtsiSol004Version251Validator() : new ONAPCsarValidator();
}
if (!etsiService.getHighestCompatibleSpecificationVersion(fileContentHandler).isLowerThan(ETSI_VERSION_2_7_1)) {
if (etsiService.hasCnfEnhancements(fileContentHandler)) {
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
index 144c8fcf8c..08b4b26846 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
@@ -49,6 +49,7 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
import org.openecomp.sdc.vendorsoftwareproduct.factory.CandidateServiceFactory;
import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.OrchestrationUtil;
import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.CandidateService;
+import org.openecomp.sdc.vendorsoftwareproduct.services.impl.etsi.ETSIService;
import org.openecomp.sdc.vendorsoftwareproduct.services.impl.etsi.ETSIServiceImpl;
import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse;
import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
@@ -60,6 +61,11 @@ public class OrchestrationTemplateProcessCsarHandler implements OrchestrationTem
private static final String EXT_SEPARATOR = ".";
private final CandidateService candidateService = CandidateServiceFactory.getInstance().createInterface();
private final ToscaTreeManager toscaTreeManager = new ToscaTreeManager();
+ private final ETSIService etsiService;
+
+ public OrchestrationTemplateProcessCsarHandler() {
+ etsiService = new ETSIServiceImpl();
+ }
@Override
public OrchestrationTemplateActionResponse process(VspDetails vspDetails, OrchestrationTemplateCandidateData candidateData) {
@@ -118,7 +124,7 @@ public class OrchestrationTemplateProcessCsarHandler implements OrchestrationTem
if (CollectionUtils.isNotEmpty(modelList)) {
return handleToscaModelConversion(modelList, fileContentHandler, candidateData);
}
- if (new ETSIServiceImpl().isSol004WithToscaMetaDirectory(fileContentHandler)) {
+ if (etsiService.isEtsiPackage(fileContentHandler)) {
return getToscaServiceModelSol004(fileContentHandler, candidateData);
}
return new ToscaConverterImpl().convert(fileContentHandler);
@@ -135,7 +141,7 @@ public class OrchestrationTemplateProcessCsarHandler implements OrchestrationTem
private ToscaServiceModel getToscaServiceModelSol004(final FileContentHandler fileContentHandler,
final OrchestrationTemplateCandidateData candidateData) throws IOException {
addOriginalOnboardedPackage(fileContentHandler, candidateData);
- final ResourceTypeEnum resourceType = new ETSIServiceImpl().getResourceType(fileContentHandler);
+ final ResourceTypeEnum resourceType = etsiService.getResourceType(fileContentHandler);
return instantiateToscaConverterFor(resourceType).convert(fileContentHandler);
}