diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java index 0d3836b1c9..257ea3675d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java @@ -658,6 +658,9 @@ public class ToscaExportHandler { Map<String, ToscaGroupTemplate> groupsMap = null; for (ComponentInstance componentInstance : componentInstances) { ToscaNodeTemplate nodeTemplate = new ToscaNodeTemplate(); + if (MapUtils.isNotEmpty(componentInstance.getToscaArtifacts())) { + nodeTemplate.setArtifacts(convertToNodeTemplateArtifacts(componentInstance.getToscaArtifacts())); + } nodeTemplate.setType(componentInstance.getToscaComponentName()); nodeTemplate.setDirectives(componentInstance.getDirectives()); nodeTemplate.setNode_filter(convertToNodeTemplateNodeFilterComponent(componentInstance.getNodeFilter())); @@ -1249,6 +1252,19 @@ public class ToscaExportHandler { return Either.left(nodeType); } + private Map<String, ToscaTemplateArtifact> convertToNodeTemplateArtifacts(Map<String, ToscaArtifactDataDefinition> artifacts) { + if (artifacts == null) { + return null; + } + Map<String, ToscaTemplateArtifact> arts = new HashMap<>(); + for (Map.Entry<String, ToscaArtifactDataDefinition> entry : artifacts.entrySet()) { + ToscaTemplateArtifact artifact = new ToscaTemplateArtifact(); + artifact.setFile(entry.getValue().getFile()); + artifact.setType(entry.getValue().getType()); + arts.put(entry.getKey(), artifact); + } + return arts; + } protected NodeFilter convertToNodeTemplateNodeFilterComponent(CINodeFilterDataDefinition inNodeFilter) { if (inNodeFilter == null){ |