X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Fparser%2FArtifactGeneratorToscaParser.java;h=3fb77be8ee20a51372c307230d112f7d117fc25c;hb=refs%2Fchanges%2F75%2F78775%2F1;hp=50c6edf0ab61821c53fef7b61181fabd5204edbe;hpb=fc779f51a624bfddc68328bf3fd3c74594ef31f6;p=aai%2Fbabel.git diff --git a/src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java b/src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java index 50c6edf..3fb77be 100644 --- a/src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java +++ b/src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java @@ -85,7 +85,7 @@ public class ArtifactGeneratorToscaParser { * Constructs using csarHelper * * @param csarHelper - * The csar helper + * The csar helper */ public ArtifactGeneratorToscaParser(ISdcCsarHelper csarHelper) { this.csarHelper = csarHelper; @@ -95,7 +95,7 @@ public class ArtifactGeneratorToscaParser { * Get or create the artifact description. * * @param model - * the artifact model + * the artifact model * @return the artifact model's description */ public static String getArtifactDescription(Model model) { @@ -136,9 +136,9 @@ public class ArtifactGeneratorToscaParser { * Initialises the group filtering and TOSCA mapping configuration. * * @param configLocation - * the pathname to the JSON config file + * the pathname to the JSON config file * @throws FileNotFoundException - * if the file cannot be opened for reading + * if the file cannot be opened for reading */ public static void initToscaMappingsConfiguration(String configLocation) throws FileNotFoundException { log.debug("Getting TOSCA Mappings Configuration"); @@ -181,9 +181,9 @@ public class ArtifactGeneratorToscaParser { * duplicate keys then the TOSCA Property value takes precedence. * * @param stringProps - * initial Map of String property values (e.g. from the TOSCA YAML metadata section) + * initial Map of String property values (e.g. from the TOSCA YAML metadata section) * @param toscaProps - * Map of TOSCA Property Type Object values to merge in (or overwrite) + * Map of TOSCA Property Type Object values to merge in (or overwrite) * @return a Map of the property values converted to String */ public Map mergeProperties(Map stringProps, Map toscaProps) { @@ -253,13 +253,12 @@ public class ArtifactGeneratorToscaParser { String metaDataType = Optional.ofNullable(metadata).map(m -> m.getValue("type")).orElse(nodeTypeName); Resource model = Model.getModelFor(nodeTypeName, metaDataType); - if (metadata != null && hasAllottedResource(metadata.getAllProperties())) { - if (model.getWidgetType() == Type.VSERVER) { - model = new Resource(Type.ALLOTTED_RESOURCE, false); - Map props = new HashMap<>(); - props.put("providingService", true); - model.setProperties(props); - } + if (metadata != null && hasAllottedResource(metadata.getAllProperties()) + && model.getWidgetType() == Type.VSERVER) { + model = new Resource(Type.ALLOTTED_RESOURCE, false); + Map props = new HashMap<>(); + props.put("providingService", true); + model.setProperties(props); } foundProvidingService |= processModel(resourceModel, metadata, model, resourceNodeTemplate.getProperties()); @@ -276,13 +275,13 @@ public class ArtifactGeneratorToscaParser { * Create an Instance Group Model and populate it with the supplied data. * * @param resourceModel - * the Resource node template Model + * the Resource node template Model * @param memberNodes - * the Resources and Widgets belonging to the Group + * the Resources and Widgets belonging to the Group * @param metaProperties - * the metadata of the Group + * the metadata of the Group * @param properties - * the properties of the Group + * the properties of the Group * @return the Instance Group and Member resource models */ private List processInstanceGroup(Model resourceModel, ArrayList memberNodes, @@ -385,7 +384,7 @@ public class ArtifactGeneratorToscaParser { * Create a Map of property name against String property value from the input Map * * @param inputMap - * The input Map + * The input Map * @return Map of property name against String property value */ private Map populateStringProperties(Map inputMap) { @@ -398,13 +397,13 @@ public class ArtifactGeneratorToscaParser { * is ProvidingService then return true, otherwise return false. * * @param resourceModel - * parent Resource + * parent Resource * @param metaData - * for populating the Resource IDs + * for populating the Resource IDs * @param resourceNode - * any Model (will be ignored if not a Resource) + * any Model (will be ignored if not a Resource) * @param nodeProperties - * the node properties + * the node properties * @return whether or not a ProvidingService was processed */ private boolean processModel(Model resourceModel, Metadata metaData, Resource resourceNode,