diff options
author | Dhrumin Desai <dd303q@att.com> | 2020-02-06 14:26:41 -0500 |
---|---|---|
committer | Dhrumin Desai <dd303q@att.com> | 2020-02-19 12:18:30 -0500 |
commit | 7b27a8acf25d5d92a0160360175b5d0ecd2ef4d7 (patch) | |
tree | 5baa63878fff9188b3d14a34f6ff74b029d3133d /mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.java | |
parent | 83f85998b01c7937b84549d81f5ec2a07958f96d (diff) |
Added policyNodes, db, tls support
Change-Id: Id960c156eb8da67e6792c6dbc1a60892d28703b0
Issue-ID: DCAEGEN2-164
Issue-ID: DCAEGEN2-1873
Issue-ID: DCAEGEN2-1995
Issue-ID: DCAEGEN2-1859
Signed-off-by: Dhrumin Desai <dd303q@att.com>
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.java | 26 |
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); |