diff options
author | ms236b <ms236b@att.com> | 2019-07-19 08:20:08 -0400 |
---|---|---|
committer | ms236b <ms236b@att.com> | 2019-07-24 09:37:44 -0400 |
commit | 403897151adfd785a14ad3568ba75b3010937307 (patch) | |
tree | afbbbb0ecbb398c29506e95ac102f088d8abf9e6 /blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Appconfig.java | |
parent | 686dc4ecb6adddc9299c93f20c0081918c532ee0 (diff) |
Added the dmaap plugin changes needed
Added the dmaap plugin changes along with a few other changes (fixed
format by pressing backspace a lot)
Issue-ID: DCAEGEN2-1517
Change-Id: I9167b7001c5916686a04112771093b0ce6cc2cff
Signed-off-by: ms236b <ms236b@att.com>
Diffstat (limited to 'blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Appconfig.java')
-rw-r--r-- | blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Appconfig.java | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Appconfig.java b/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Appconfig.java index e4f1230..5159814 100644 --- a/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Appconfig.java +++ b/blueprint-generator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Appconfig.java @@ -48,7 +48,7 @@ public class Appconfig { return params; } - public TreeMap<String, LinkedHashMap<String, Object>> createOnapAppconfig(TreeMap<String, LinkedHashMap<String, Object>> inps, ComponentSpec cs) { + public TreeMap<String, LinkedHashMap<String, Object>> createAppconfig(TreeMap<String, LinkedHashMap<String, Object>> inps, ComponentSpec cs, String override) { TreeMap<String, LinkedHashMap<String, Object>> retInputs = new TreeMap<String, LinkedHashMap<String, Object>>(); retInputs = inps; @@ -58,23 +58,26 @@ public class Appconfig { //set the stream publishes TreeMap<String, DmaapObj> streamPublishes = new TreeMap<String, DmaapObj>(); - + int counter = 0; if(cs.getStreams().getPublishes().length != 0) { for(Publishes p: cs.getStreams().getPublishes()) { if(p.getType().equals("data_router") || p.getType().equals("data router")) { //in this case the data router information gets added to the params so for now leave it alone String config = p.getConfig_key(); DmaapObj pub = new DmaapObj(); - retInputs = pub.createOnapDmaapDRObj(retInputs, config, 'p'); + String name = "feed" + counter; + retInputs = pub.createOnapDmaapDRObj(retInputs, config, 'p', "feed" + counter, name); pub.setType(p.getType()); streamPublishes.put(config, pub); } else if(p.getType().equals("message_router") || p.getType().equals("message router")) { String config = p.getConfig_key(); DmaapObj pub = new DmaapObj(); - retInputs = pub.createOnapDmaapMRObj(retInputs, config, 'p'); + String name = "topic" + counter; + retInputs = pub.createOnapDmaapMRObj(retInputs, config, 'p', "topic" + counter, name); pub.setType(p.getType()); streamPublishes.put(config, pub); } + counter++; } } @@ -87,16 +90,19 @@ public class Appconfig { //in this case the data router information gets added to the params so for now leave it alone String config = s.getConfig_key(); DmaapObj sub = new DmaapObj(); - retInputs = sub.createOnapDmaapDRObj(retInputs, config, 'p'); + String name = "feed" + counter; + retInputs = sub.createOnapDmaapDRObj(retInputs, config, 'p', "feed" + counter, name); sub.setType(s.getType()); streamSubscribes.put(config, sub); } else if(s.getType().equals("message_router") || s.getType().equals("message router")) { String config = s.getConfig_key(); DmaapObj sub = new DmaapObj(); - retInputs = sub.createOnapDmaapMRObj(retInputs, config, 's'); + String name = "topic" + counter; + retInputs = sub.createOnapDmaapMRObj(retInputs, config, 's', "topic" + counter, name); sub.setType(s.getType()); streamSubscribes.put(config, sub); } + counter++; } } @@ -131,24 +137,20 @@ public class Appconfig { else { parameters.put(pName, p.getValue()); } - } } + if(override != null) { + GetInput ov = new GetInput(); + ov.setGet_input("service_component_name_override"); + parameters.put("service_component_name_override", ov); + LinkedHashMap<String, Object> over = new LinkedHashMap<String, Object>(); + over.put("type", "string"); + over.put("default", override); + retInputs.put("service_component_name_override", over); + } this.setParams(parameters); return retInputs; } -// public void createTemplateAppconfig() { -// //set service calls -// CallsObj[] call = new CallsObj[0]; -// this.setService_calls(call); -// -// //set the stream publishes -// TreeMap<String, DmaapObj> streamPublishes = new TreeMap<String, DmaapObj>(); -// this.setStream_publishes(streamPublishes); -// -// //set the stream subscribes -// TreeMap<String, DmaapObj> streamSubscribes = new TreeMap<String, DmaapObj>(); -// this.setStream_subcribes(streamSubscribes); -// } + } |