Add onap.useDmaapPlugin config parameter 46/110346/2
authorAndrew Gauld <agauld@att.com>
Fri, 17 Jul 2020 15:46:41 +0000 (15:46 +0000)
committerAndrew Gauld <agauld@att.com>
Fri, 17 Jul 2020 20:04:13 +0000 (20:04 +0000)
Change-Id: I8c86eb3f1c76c608fe5ce66bc4e0e1f6d8d64abc
Issue-ID: DCAEGEN2-1996
Signed-off-by: Andrew Gauld <agauld@att.com>
mod/runtimeapi/runtime-core/src/main/java/org/onap/dcae/runtime/core/blueprint_creator/BlueprintCreatorOnap.java
mod/runtimeapi/runtime-web/pom.xml
mod/runtimeapi/runtime-web/src/main/java/org/onap/dcae/runtime/web/configuration/BlueprintCreatorConfig.java
mod/runtimeapi/runtime-web/src/main/resources/application.properties

index 7e11b10..c45173d 100644 (file)
@@ -31,6 +31,7 @@ public class BlueprintCreatorOnap implements BlueprintCreator{
 
     private String topicUrl;
     private String importFilePath;
+    private boolean useDmaapPlugin;
 
     public void setTopicUrl(String topicUrl) {
         this.topicUrl = topicUrl;
@@ -40,11 +41,15 @@ public class BlueprintCreatorOnap implements BlueprintCreator{
         this.importFilePath = importFilePath;
     }
 
+    public void setUseDmaapPlugin(boolean useDmaapPlugin) {
+       this.useDmaapPlugin = useDmaapPlugin;
+    }
+
     @Override
     public String createBlueprint(String componentSpecString) {
         ComponentSpec componentSpec = new ComponentSpec();
         componentSpec.createComponentSpecFromString(componentSpecString);
-        Blueprint blueprint = new Blueprint().createBlueprint(componentSpec,"",'o',importFilePath,"");
+        Blueprint blueprint = new Blueprint().createBlueprint(componentSpec,"",useDmaapPlugin?'d':'o',importFilePath,"");
         return blueprint.blueprintToString();
     }
 
index 722c36a..3582c94 100644 (file)
@@ -25,7 +25,7 @@ limitations under the License.
                <version>1.0.1</version>
        </parent>
        <artifactId>runtime-web</artifactId>
-       <version>1.0.4-SNAPSHOT</version>
+       <version>1.0.5-SNAPSHOT</version>
        <packaging>jar</packaging>
        <name>runtime-web</name>
        <description>MOD Runtime Web Module</description>
index 11622e6..0741bfa 100644 (file)
@@ -47,6 +47,9 @@ public class BlueprintCreatorConfig {
     @Value("${onap.topicUrl}")
     String onapDublinTopicUrl;
 
+    @Value("${onap.useDmaapPlugin}")
+    boolean useDmaapPlugin;
+
     @Value("${onap.import.cloudifyPlugin}")
     String onapDublinImportCloudifyPlugin;
 
@@ -72,6 +75,7 @@ public class BlueprintCreatorConfig {
     public FlowGraphParser getFlowGraphParserForOnapDublin(){
         BlueprintCreatorOnap blueprintCreatorOnap = new BlueprintCreatorOnap();
         blueprintCreatorOnap.setImportFilePath(writeImportsTofile());
+        blueprintCreatorOnap.setUseDmaapPlugin(useDmaapPlugin);
         FlowGraphParser flowGraphParser = new FlowGraphParser(blueprintCreatorOnap);
         return flowGraphParser;
     }
index dccce98..f3b06aa 100644 (file)
@@ -11,6 +11,8 @@ dashboard.password=
 #Onap Dublin BlueprintGenerator configs
 onap.topicUrl=https://url:9999
 
+onap.useDmaapPlugin=false
+
 onap.import.cloudifyPlugin=https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
 
 onap.import.k8sPlugin=https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml
@@ -21,4 +23,4 @@ onap.import.postgresPlugin=https://nexus.onap.org/service/local/repositories/raw
 
 onap.import.clampPlugin=https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/clamppolicyplugin/1.1.0/clamppolicyplugin_types.yaml
 
-onap.import.dmaapPlugin= https://nexus.onap.org/content/repositories/raw/org.onap.ccsdk.platform.plugins/type_files/dmaap/dmaap.yaml
\ No newline at end of file
+onap.import.dmaapPlugin= https://nexus.onap.org/content/repositories/raw/org.onap.ccsdk.platform.plugins/type_files/dmaap/dmaap.yaml