summaryrefslogtreecommitdiffstats
path: root/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java
diff options
context:
space:
mode:
authorVijay Venkatesh Kumar <vv770d@att.com>2020-02-19 17:35:15 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-19 17:35:15 +0000
commit38808a23e76deb763a39f457a15b2ef56282b609 (patch)
tree2dc309b32cd3154a7268b5e319b15e58ac3e320d /mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java
parentfc08a5916376cb6164bd4a6a3f8f2ee43fe85a5d (diff)
parent7b27a8acf25d5d92a0160360175b5d0ecd2ef4d7 (diff)
Merge "Added policyNodes, db, tls support"
Diffstat (limited to 'mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java')
-rw-r--r--mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java
index 2b0b8c0..a3d8e3e 100644
--- a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java
+++ b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/onapbp/OnapNode.java
@@ -20,9 +20,12 @@
package org.onap.blueprintgenerator.models.onapbp;
+import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.TreeMap;
+import org.onap.blueprintgenerator.core.PgaasNodeBuilder;
+import org.onap.blueprintgenerator.core.PolicyNodeBuilder;
import org.onap.blueprintgenerator.models.blueprint.Interfaces;
import org.onap.blueprintgenerator.models.blueprint.Node;
import org.onap.blueprintgenerator.models.blueprint.Properties;
@@ -47,6 +50,8 @@ import lombok.NoArgsConstructor;
public class OnapNode extends Node{
private TreeMap<String, Interfaces> interfaces;
private Properties properties;
+ private ArrayList<LinkedHashMap<String, String>> relationships;
+
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;
@@ -61,6 +66,23 @@ public class OnapNode extends Node{
//set the type
this.setType("dcae.nodes.ContainerizedPlatformComponent");
+ //create and set the relationships
+ ArrayList<LinkedHashMap<String, String>> rets = new ArrayList();
+
+ //add relationship for policy if exist
+ if(cs.getPolicyInfo() != null){
+ ArrayList<LinkedHashMap<String, String>> policyRelationshipsList = PolicyNodeBuilder.getPolicyRelationships(cs);
+ rets.addAll(policyRelationshipsList);
+ }
+
+ //add relationships and env_variables for pgaas dbs if exist
+ if(cs.getAuxilary().getDatabases() != null){
+ ArrayList<LinkedHashMap<String, String>> pgaasRelationshipsList = PgaasNodeBuilder.getPgaasNodeRelationships(cs);
+ rets.addAll(pgaasRelationshipsList);
+ }
+
+ this.setRelationships(rets);
+
//set the properties
Properties props = new Properties();
retInputs = props.createOnapProperties(retInputs, cs, override);