+
+ if (parser.hasSubCategoryTunnelXConnect(serviceMetadata) && parser.hasAllottedResource(serviceMetadata)) {
+ resourceModel.addWidget(Widget.createWidget("TUNNEL_XCONNECT"));
+ }
+
+ resources.addAll(parser.processInstanceGroups(resourceModel, serviceVfNode));
+ resources.add(resourceModel);
+ }
+
+ /**
+ * Return all child Node Templates (via Substitution Mappings) that do not have a type ending VnfConfiguration.
+ *
+ * @param nodeTemplate
+ * the parent Node Template
+ * @return the child Node Templates which are not a VNF Configuration type
+ */
+ private List<NodeTemplate> getNonVnfChildren(NodeTemplate nodeTemplate) {
+ return Optional.ofNullable(nodeTemplate.getSubMappingToscaTemplate()) //
+ .map(sm -> Optional.ofNullable(sm.getNodeTemplates())
+ .map(nts -> nts.stream().filter(nt -> !isVNFType(nt)) //
+ .collect(Collectors.toList()))
+ .orElse(Collections.emptyList()))
+ .orElse(Collections.emptyList());
+ }
+
+ private boolean isVNFType(NodeTemplate nt) {
+ return nt.getType().endsWith("VnfConfiguration");
+ }
+
+ /**
+ * @param generationData
+ * @param resource
+ * @throws XmlArtifactGenerationException
+ */
+ private void generateResourceArtifact(GenerationData generationData, Resource resource)
+ throws XmlArtifactGenerationException {
+ if (!isContained(generationData, getArtifactName(resource))) {
+ log.info(ApplicationMsgs.DISTRIBUTION_EVENT, "Generating resource model");
+ generationData.add(getResourceArtifact(resource, modelGenerator.generateModelFor(resource)));
+ }
+ }
+
+ private Path createTempFile(byte[] bytes) throws IOException {
+ log.debug("Creating temp file on file system for the csar");
+ Path path = Files.createTempFile("temp", ".csar");
+ Files.write(path, bytes);