diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java index 80bee80d06..2721fda2c5 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java @@ -51,6 +51,7 @@ import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade import org.openecomp.sdc.be.model.jsonjanusgraph.utils.ModelConverter; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter; +import org.openecomp.sdc.be.plugins.CsarEntryGenerator; import org.openecomp.sdc.be.resources.data.DAOArtifactData; import org.openecomp.sdc.be.resources.data.SdcSchemaFilesData; import org.openecomp.sdc.be.tosca.model.ToscaTemplate; @@ -108,6 +109,9 @@ public class CsarUtils { private ToscaExportHandler toscaExportUtils; @Autowired protected ToscaOperationFacade toscaOperationFacade; + + @Autowired(required = false) + private List<CsarEntryGenerator> generators; private static final String CONFORMANCE_LEVEL = ConfigurationManager.getConfigurationManager().getConfiguration().getToscaConformanceLevel(); private static final String SDC_VERSION = ExternalConfiguration.getAppVersion(); @@ -303,6 +307,16 @@ public class CsarUtils { return Either.right(collectedComponentCsarDefinition.right().value()); } + if (generators != null) { + for (CsarEntryGenerator generator: generators) { + log.debug("Invoking CsarEntryGenerator: {}", generator.getClass().getName()); + for (Entry<String, byte[]> pluginGeneratedFile : generator.generateCsarEntries(component).entrySet()) { + zip.putNextEntry(new ZipEntry(pluginGeneratedFile.getKey())); + zip.write(pluginGeneratedFile.getValue()); + } + } + } + return writeAllFilesToCsar(component, collectedComponentCsarDefinition.left().value(), zip, isInCertificationRequest); } |