aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2019-08-29 16:31:53 +0000
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-09-01 08:42:24 +0000
commit96908856dea9061161b2c324aa7b0eeb5d6e4fd5 (patch)
tree9faa162c2b55e78506a1fe4cf87ff1be8b6501bb /openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api
parentc1e9e72d0689f1188daf0c105e035bd16a0818f8 (diff)
Fix artifacts references in main TOSCA descriptor
During package conversion, artifacts can have their path changed. References for those artifacts inside the main TOSCA descriptor must be updated accordingly. Change-Id: Idcffb0724c20875ff1decebfec7c47605bfe20dc Issue-ID: SDC-2540 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/etsi/ETSIService.java27
1 files changed, 22 insertions, 5 deletions
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/impl/etsi/ETSIService.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/impl/etsi/ETSIService.java
index a6b58167f9..0a271c9d87 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/impl/etsi/ETSIService.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/impl/etsi/ETSIService.java
@@ -20,10 +20,14 @@
package org.openecomp.sdc.vendorsoftwareproduct.services.impl.etsi;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.Map;
+import java.util.Optional;
import org.openecomp.core.utilities.file.FileContentHandler;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.tosca.csar.Manifest;
-import java.io.IOException;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
public interface ETSIService {
@@ -38,11 +42,22 @@ public interface ETSIService {
boolean isSol004WithToscaMetaDirectory(FileContentHandler handler) throws IOException;
/**
- * Update file structure. Moves non mano files to Artifacts/Deployment/non mano key location
- * @param handler
- * @param manifest
+ * Update file structure. Moves non mano files to the correct folder based on the manifest non mano type.
+ *
+ * @param handler The file handler containing the artifacts to move.
+ * @return A Map with pairs of from and to path of the moved artifacts.
+ */
+ Optional<Map<String, Path>> moveNonManoFileToArtifactFolder(final FileContentHandler handler)
+ throws IOException;
+
+ /**
+ * Updates the main descriptor paths referring the artifacts that were moved.
+ *
+ * @param toscaServiceModel The tosca service model containing the main descriptor.
+ * @param fromToMovedArtifactMap A Map representing the from and to artifacts path changes.
*/
- void moveNonManoFileToArtifactFolder(FileContentHandler handler, Manifest manifest);
+ void updateMainDescriptorPaths(final ToscaServiceModel toscaServiceModel,
+ final Map<String, Path> fromToMovedArtifactMap);
/**
* Retrieves the manifest file from the CSAR
@@ -64,4 +79,6 @@ public interface ETSIService {
* @throws IOException when TOSCA.meta file or manifest file is invalid
*/
ResourceTypeEnum getResourceType(Manifest manifest) throws IOException;
+
+ Path getOriginalManifestPath(final FileContentHandler handler) throws IOException;
}