X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Fxml%2Fgenerator%2Fapi%2FAaiArtifactGenerator.java;h=11c1471a304b78cf2008b7c925250d705948a489;hb=bfde3ef00beb3c6f31cebfd12e90b9b9cdcc492e;hp=d35814af879b49898beb86a5262ad20288c156b9;hpb=6c585913c11b2e1973bfcd0d7671d4114e1c3e66;p=aai%2Fbabel.git diff --git a/src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java b/src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java index d35814a..11c1471 100644 --- a/src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java +++ b/src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java @@ -82,7 +82,6 @@ public class AaiArtifactGenerator implements ArtifactGenerator { } try { - ArtifactGeneratorToscaParser.initWidgetConfiguration(); ArtifactGeneratorToscaParser.initToscaMappingsConfiguration(configLocation); } catch (IOException e) { log.error(ApplicationMsgs.LOAD_PROPERTIES, e, configLocation); @@ -124,8 +123,9 @@ public class AaiArtifactGenerator implements ArtifactGenerator { * interface to the TOSCA parser * @return the generated Artifacts (containing XML models) * @throws XmlArtifactGenerationException + * if the configured widget mappings do not support processed widget type(s) */ - private GenerationData generateAllArtifacts(final String serviceVersion, ISdcCsarHelper csarHelper) + public GenerationData generateAllArtifacts(final String serviceVersion, ISdcCsarHelper csarHelper) throws XmlArtifactGenerationException { List serviceNodeTemplates = csarHelper.getServiceNodeTemplates(); if (serviceNodeTemplates == null) { @@ -182,6 +182,7 @@ public class AaiArtifactGenerator implements ArtifactGenerator { * @param serviceModel * @return the generated Models * @throws XmlArtifactGenerationException + * if the configured widget mappings do not support processed widget type(s) */ private List generateResourceModels(ISdcCsarHelper csarHelper, List serviceNodeTemplates, Service serviceModel) throws XmlArtifactGenerationException { @@ -201,6 +202,16 @@ public class AaiArtifactGenerator implements ArtifactGenerator { return resources; } + /** + * @param csarHelper + * @param serviceModel + * @param resources + * @param serviceGroups + * @param parser + * @param nodeTemplate + * @throws XmlArtifactGenerationException + * if the configured widget mappings do not support processed widget type(s) + */ private void generateModelFromNodeTemplate(ISdcCsarHelper csarHelper, Service serviceModel, List resources, final List serviceGroups, ArtifactGeneratorToscaParser parser, NodeTemplate nodeTemplate) throws XmlArtifactGenerationException { @@ -250,6 +261,14 @@ public class AaiArtifactGenerator implements ArtifactGenerator { return model; } + /** + * @param csarHelper + * @param resources + * @param parser + * @param nodeTemplate + * @throws XmlArtifactGenerationException + * if the configured widget mappings do not support processed widget type(s) + */ private void generateResourceModel(ISdcCsarHelper csarHelper, List resources, ArtifactGeneratorToscaParser parser, NodeTemplate nodeTemplate) throws XmlArtifactGenerationException { Resource resourceModel = getModelFor(parser, nodeTemplate); @@ -268,7 +287,7 @@ public class AaiArtifactGenerator implements ArtifactGenerator { } if (parser.hasSubCategoryTunnelXConnect(serviceMetadata) && parser.hasAllottedResource(serviceMetadata)) { - resourceModel.addWidget(Widget.getWidget(WidgetType.valueOf("TUNNEL_XCONNECT"))); + resourceModel.addWidget(Widget.createWidget("TUNNEL_XCONNECT")); } resources.addAll(parser.processInstanceGroups(resourceModel, nodeTemplate));