diff options
Diffstat (limited to 'blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp')
2 files changed, 18 insertions, 27 deletions
diff --git a/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapBlueprint.java b/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapBlueprint.java index d4212d9..8342020 100644 --- a/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapBlueprint.java +++ b/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapBlueprint.java @@ -42,15 +42,13 @@ import lombok.NoArgsConstructor; @JsonInclude(value=Include.NON_NULL) public class OnapBlueprint extends Blueprint{ - - public Blueprint createOnapBlueprint(ComponentSpec cs, String importPath) { - + public Blueprint createOnapBlueprint(ComponentSpec cs, String importPath, String override) { + //create the inputs that will be used TreeMap<String, LinkedHashMap<String, Object>> inputs = new TreeMap<String, LinkedHashMap<String, Object>>(); - //set the tosca definition which is the same for everything this.setTosca_definitions_version("cloudify_dsl_1_3"); - + //set the imports if(importPath != "") { Imports imps = new Imports(); @@ -61,30 +59,26 @@ public class OnapBlueprint extends Blueprint{ this.setImports(imps.createOnapImports()); } - //create the node template TreeMap<String, Node> nodeTemplate = new TreeMap<String, Node>(); String nodeName = cs.getSelf().getName(); - + //create the onap node that will be used OnapNode node = new OnapNode(); - inputs = node.createOnapNode(inputs, cs); + inputs = node.createOnapNode(inputs, cs, override); nodeTemplate.put(nodeName, node); this.setNode_templates(nodeTemplate); - + //set the inputs this.setInputs(inputs); - + Blueprint bp = new Blueprint(); bp.setImports(this.getImports()); bp.setInputs(this.getInputs()); bp.setNode_templates(this.getNode_templates()); bp.setTosca_definitions_version(this.getTosca_definitions_version()); - - return bp; - - } + return bp; - -} + } +}
\ No newline at end of file diff --git a/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java b/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java index 5131057..2b0b8c0 100644 --- a/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java +++ b/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java @@ -45,30 +45,27 @@ import lombok.NoArgsConstructor; @JsonInclude(value=Include.NON_NULL) public class OnapNode extends Node{ - private TreeMap<String, Interfaces> interfaces; private Properties properties; - - - public TreeMap<String, LinkedHashMap<String, Object>> createOnapNode(TreeMap<String, LinkedHashMap<String, Object>> inps, ComponentSpec cs) { + public TreeMap<String, LinkedHashMap<String, Object>> createOnapNode(TreeMap<String, LinkedHashMap<String, Object>> inps, ComponentSpec cs, String override) { TreeMap<String, LinkedHashMap<String, Object>> retInputs = new TreeMap<String, LinkedHashMap<String, Object>>(); retInputs = inps; - + //create and set the interfaces Interfaces inter = new Interfaces(); - retInputs = inter.createOnapInterface(retInputs, cs); + retInputs = inter.createInterface(retInputs, cs); TreeMap<String, Interfaces> interfaces = new TreeMap<String, Interfaces>(); interfaces.put("cloudify.interfaces.lifecycle", inter); this.setInterfaces(interfaces); - + //set the type this.setType("dcae.nodes.ContainerizedPlatformComponent"); - + //set the properties Properties props = new Properties(); - retInputs = props.createOnapProperties(retInputs, cs); + retInputs = props.createOnapProperties(retInputs, cs, override); this.setProperties(props); - + return retInputs; } -} +}
\ No newline at end of file |