From 7b27a8acf25d5d92a0160360175b5d0ecd2ef4d7 Mon Sep 17 00:00:00 2001 From: Dhrumin Desai Date: Thu, 6 Feb 2020 14:26:41 -0500 Subject: 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 --- .../models/dmaapbp/DmaapBlueprint.java | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapBlueprint.java') 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); -- cgit 1.2.3-korg