+
+ Map<String, String> serviceMetadata = nodeTemplate.getMetaData().getAllProperties();
+ resourceModel.populateModelIdentificationInformation(serviceMetadata);
+
+ parser.processResourceModels(resourceModel, csarHelper.getNodeTemplateChildren(nodeTemplate));
+
+ if (csarHelper.getServiceVfList() != null) {
+ parser.processVfModules(resources, resourceModel, nodeTemplate);
+ }
+
+ if (parser.hasSubCategoryTunnelXConnect(serviceMetadata) && parser.hasAllottedResource(serviceMetadata)) {
+ resourceModel.addWidget(Widget.getWidget(Type.TUNNEL_XCONNECT));
+ }
+
+ resources.addAll(parser.processInstanceGroups(resourceModel, nodeTemplate));
+ resources.add((Resource) resourceModel);
+ }
+
+ /**
+ * @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);