summaryrefslogtreecommitdiffstats
path: root/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.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/dmaapbp/DmaapBlueprint.java
parentfc08a5916376cb6164bd4a6a3f8f2ee43fe85a5d (diff)
parent7b27a8acf25d5d92a0160360175b5d0ecd2ef4d7 (diff)
Merge "Added policyNodes, db, tls support"
Diffstat (limited to 'mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.java')
-rw-r--r--mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.java b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.java
index d3cff67..21eabf0 100644
--- a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.java
+++ b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.java
@@ -20,15 +20,14 @@
package org.onap.blueprintgenerator.models.dmaapbp;
-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.Blueprint;
import org.onap.blueprintgenerator.models.blueprint.Imports;
-import org.onap.blueprintgenerator.models.blueprint.Interfaces;
import org.onap.blueprintgenerator.models.blueprint.Node;
-import org.onap.blueprintgenerator.models.blueprint.Properties;
import org.onap.blueprintgenerator.models.componentspec.ComponentSpec;
import org.onap.blueprintgenerator.models.componentspec.Publishes;
import org.onap.blueprintgenerator.models.componentspec.Subscribes;
@@ -68,41 +67,48 @@ public class DmaapBlueprint extends Blueprint{
//create and add the topic/feed nodes
//go through the streams publishes
- int counter = 0;
if(cs.getStreams().getPublishes() != null) {
for(Publishes p: cs.getStreams().getPublishes()) {
if(p.getType().equals("message_router") || p.getType().equals("message router")) {
- String topic = "topic" + counter;
+ String topic = p.getConfig_key() + "_topic";
DmaapNode topicNode = new DmaapNode();
inps = topicNode.createTopicNode(cs, inps, topic);
nodeTemplate.put(topic, topicNode);
} else if(p.getType().equals("data_router") || p.getType().equals("data router")) {
- String feed = "feed" + counter;
+ String feed = p.getConfig_key() + "_feed";
DmaapNode feedNode = new DmaapNode();
inps = feedNode.createFeedNode(cs, inps, feed);
nodeTemplate.put(feed, feedNode);
}
- counter++;
}
}
//go through the stream subscribes
if(cs.getStreams().getSubscribes() != null) {
for(Subscribes s: cs.getStreams().getSubscribes()) {
if(s.getType().equals("message_router") || s.getType().equals("message router")) {
- String topic = "topic" + counter;
+ String topic = s.getConfig_key() + "_topic";
DmaapNode topicNode = new DmaapNode();
inps = topicNode.createTopicNode(cs, inps, topic);
nodeTemplate.put(topic, topicNode);
} else if(s.getType().equals("data_router") || s.getType().equals("data router")) {
- String feed = "feed" + counter;
+ String feed = s.getConfig_key() + "_feed";
DmaapNode feedNode = new DmaapNode();
inps = feedNode.createFeedNode(cs, inps, feed);
nodeTemplate.put(feed, feedNode);
}
- counter++;
}
}
+ //if present in component spec, populate policyNodes information in the blueprint
+ if(cs.getPolicyInfo() != null){
+ PolicyNodeBuilder.addPolicyNodesAndInputs(cs, nodeTemplate, inps);
+ }
+
+ //if present in component spec, populate pgaasNodes information in the blueprint
+ if(cs.getAuxilary().getDatabases() != null){
+ PgaasNodeBuilder.addPgaasNodesAndInputs(cs, nodeTemplate, inps);
+ }
+
bp.setNode_templates(nodeTemplate);
bp.setInputs(inps);