diff options
author | andre.schmid <andre.schmid@est.tech> | 2022-01-18 10:16:37 +0000 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-01-25 09:57:30 +0000 |
commit | 3ba359e291789363ce2670c72da8eaa9caa5f956 (patch) | |
tree | bc3358369990f40b7ce994ab454094fc5b062270 /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java | |
parent | d77bdf472a4fb5b6cf8e17f2d0d8e8d2bababeaf (diff) |
Update onboarding upload status during processing
Updates the onboarding upload status during the VSP package processing
Change-Id: Idc705220ad26e62577b52c6f9126aeae51a33fe0
Issue-ID: SDC-3848
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java')
1 files changed, 6 insertions, 3 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java index 1477ce1414..6615447c6f 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java @@ -152,6 +152,8 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate fileToUploadBytes = fileToUpload.getObject(byte[].class); } + + vspUploadStatus = orchestrationTemplateCandidateUploadManager.putUploadInValidation(vspId, versionId, user); final var onboardingPackageProcessor = new OnboardingPackageProcessor(filename, fileToUploadBytes, new CnfPackageValidator(), artifactInfo); final ErrorMessage[] errorMessages = onboardingPackageProcessor.getErrorMessages().toArray(new ErrorMessage[0]); @@ -166,13 +168,14 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate } final var version = new Version(versionId); final var vspDetails = vendorSoftwareProductManager.getVsp(vspId, version); + vspUploadStatus = orchestrationTemplateCandidateUploadManager.putUploadInProcessing(vspId, versionId, user); response = processOnboardPackage(onboardPackageInfo, vspDetails, errorMessages); final UploadFileResponseDto entity = (UploadFileResponseDto) response.getEntity(); if (artifactStorageManager.isEnabled()) { - if (!entity.getErrors().isEmpty()) { - artifactStorageManager.delete(artifactInfo); - } else { + if (entity.getErrors().isEmpty()) { artifactStorageManager.put(vspId, versionId + ".reduced", new ByteArrayInputStream(fileToUploadBytes)); + } else { + artifactStorageManager.delete(artifactInfo); } } orchestrationTemplateCandidateUploadManager |