diff options
author | 2018-05-06 13:31:32 +0300 | |
---|---|---|
committer | 2018-05-06 13:31:32 +0300 | |
commit | 9e8835dd593b382f369308fac3cc1cfc64c0971c (patch) | |
tree | f1e2af99695f2cbb91173a0547d991a9cb72652b /vid-app-common/src/main/java/org/onap/vid/asdc | |
parent | caf0ab3707f8177e4b20d1cf735e5e20c2e6ec14 (diff) |
VoLTE support
Change-Id: I593b9c92bf9330c2d28f2ccbd59c0651b67fe94a
Issue-ID: VID-189
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/asdc')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java | 38 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java | 17 |
2 files changed, 52 insertions, 3 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java index 9f3ae429..6b2f39ec 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java @@ -49,6 +49,12 @@ public class Input { /** The required field. If not set, the default is true */ private boolean required = true; + /** Details the inputs template */ + private String templateName; + private String templateUUID; + private String templateInvariantUUID; + private String templateCustomizationUUID; + /** * Instantiates a new input. */ @@ -165,4 +171,36 @@ public class Input { public String toString() { return "type=" + type + ",description=" + description + ",default=" + _default; } + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getTemplateUUID() { + return templateUUID; + } + + public void setTemplateUUID(String templateUUID) { + this.templateUUID = templateUUID; + } + + public String getTemplateInvariantUUID() { + return templateInvariantUUID; + } + + public void setTemplateInvariantUUID(String templateInvariantUUID) { + this.templateInvariantUUID = templateInvariantUUID; + } + + public String getTemplateCustomizationUUID() { + return templateCustomizationUUID; + } + + public void setTemplateCustomizationUUID(String templateCustomizationUUID) { + this.templateCustomizationUUID = templateCustomizationUUID; + } } diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java index f0d056a0..2200b798 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java @@ -8,6 +8,7 @@ import org.onap.sdc.tosca.parser.impl.FilterType; import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory; import org.onap.sdc.tosca.parser.impl.SdcTypes; import org.onap.sdc.toscaparser.api.*; +import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.sdc.toscaparser.api.parameters.Input; import java.nio.file.Path; @@ -238,7 +239,7 @@ public class ToscaParserImpl2 { private Map<String, org.onap.vid.asdc.beans.tosca.Input> inputsListToInputsMap(List<org.onap.sdc.toscaparser.api.parameters.Input> inputList) { Map<String, org.onap.vid.asdc.beans.tosca.Input> inputs = new HashMap<>(); for (org.onap.sdc.toscaparser.api.parameters.Input input : inputList) { - inputs.put(input.getName(), convertInput(input, new org.onap.vid.asdc.beans.tosca.Input())); + inputs.put(input.getName(), convertInput(input, new org.onap.vid.asdc.beans.tosca.Input(), null)); } return inputs; } @@ -297,7 +298,7 @@ public class ToscaParserImpl2 { for (Input input: inputs){ if(input.getName().equals(key)){ org.onap.vid.asdc.beans.tosca.Input localInput = new org.onap.vid.asdc.beans.tosca.Input(); - localInput = convertInput(input, localInput); + localInput = convertInput(input, localInput, nodeTemplate); String name = property.getKey(); commandPropertyMap.put(name, extractCommands(name, key)); inputMap.put(name, localInput); @@ -312,13 +313,23 @@ public class ToscaParserImpl2 { return inputKey.substring(inputKey.indexOf(":") + 1); } - private org.onap.vid.asdc.beans.tosca.Input convertInput(Input parserInput, org.onap.vid.asdc.beans.tosca.Input localInput){ + private org.onap.vid.asdc.beans.tosca.Input convertInput(Input parserInput, org.onap.vid.asdc.beans.tosca.Input localInput, NodeTemplate nodeTemplate){ localInput.setDefault(parserInput.getDefault()); localInput.setDescription(parserInput.getDescription()); localInput.setRequired(parserInput.isRequired()); localInput.setType(parserInput.getType()); localInput.setConstraints(parserInput.getConstraints()); // localInput.setentry_schema() + + //if inputs of inner nodeTemplate - tell its details + if(nodeTemplate != null) { + Metadata metadata = nodeTemplate.getMetaData(); + localInput.setTemplateName(metadata.getValue("name")); + localInput.setTemplateUUID(metadata.getValue("UUID")); + localInput.setTemplateInvariantUUID(metadata.getValue("invariantUUID")); + localInput.setTemplateCustomizationUUID(metadata.getValue("customizationUUID")); + } + return localInput; } |