From fa2c7f888495ed0969ce9178b9f770ac088a5f07 Mon Sep 17 00:00:00 2001 From: talig Date: Sun, 27 May 2018 14:47:32 +0300 Subject: Refactor candidate heat dao As a result OrchestrationTemplateCandidate element will be added if not exists instead of failing. Change-Id: I1a1c9afed65018ed01be65ff07dabe1c2081bea7 Issue-ID: SDC-1371 Signed-off-by: talig --- .../dao/OrchestrationTemplateCandidateDao.java | 4 ++-- .../services/filedatastructuremodule/CandidateService.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateCandidateDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateCandidateDao.java index 9743814b11..c44ee307b4 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateCandidateDao.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateCandidateDao.java @@ -26,9 +26,9 @@ import java.util.Optional; public interface OrchestrationTemplateCandidateDao extends VersionableDao { - OrchestrationTemplateCandidateData get(String vspId, Version version); + Optional get(String vspId, Version version); - OrchestrationTemplateCandidateData getInfo(String vspId, Version version); + Optional getInfo(String vspId, Version version); void delete(String vspId, Version version); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/filedatastructuremodule/CandidateService.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/filedatastructuremodule/CandidateService.java index 00120759d6..578b120256 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/filedatastructuremodule/CandidateService.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/filedatastructuremodule/CandidateService.java @@ -44,7 +44,7 @@ public interface CandidateService { OrchestrationTemplateCandidateData createCandidateDataEntity( CandidateDataEntityTo candidateDataEntityTo, InputStream zipFileManifest, - AnalyzedZipHeatFiles analyzedZipHeatFiles) throws Exception; + AnalyzedZipHeatFiles analyzedZipHeatFiles); void updateCandidateUploadData(String vspId, Version version, OrchestrationTemplateCandidateData uploadData); @@ -55,11 +55,11 @@ public interface CandidateService { void updateOrchestrationTemplateCandidateFileDataStructure(String vspId, Version version, FilesDataStructure fileDataStructure); - OrchestrationTemplateCandidateData getOrchestrationTemplateCandidate(String vspId, - Version version); + Optional getOrchestrationTemplateCandidate(String vspId, + Version version); - OrchestrationTemplateCandidateData getOrchestrationTemplateCandidateInfo(String vspId, - Version version); + Optional getOrchestrationTemplateCandidateInfo(String vspId, + Version version); byte[] getZipData(ByteBuffer contentData) throws IOException; @@ -71,7 +71,7 @@ public interface CandidateService { OnboardingTypesEnum type, Map> uploadErrors); - byte[] replaceManifestInZip(ByteBuffer contentData, String manifest, String vspId, + byte[] replaceManifestInZip(ByteBuffer contentData, String manifest, OnboardingTypesEnum type) throws IOException; Optional createManifest(VspDetails vspDetails, -- cgit 1.2.3-korg