summaryrefslogtreecommitdiffstats
path: root/mod/bpgenerator/common
diff options
context:
space:
mode:
authorTomasz Wrobel <tomasz.wrobel@nokia.com>2021-01-15 14:34:18 +0100
committerTomasz Wrobel <tomasz.wrobel@nokia.com>2021-01-21 11:19:39 +0100
commit52b5f5276add6116a14ba671c35ff9d87c140421 (patch)
tree8ccb78489a403eb2c2c83dc192f055a4c1287920 /mod/bpgenerator/common
parent87e8c9cb8b1b335e213ad1e4adaabc3e622ebfb1 (diff)
Add Native Kafka streams support in bp-generator
Issue-ID: DCAEGEN2-1179 Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com> Change-Id: I541dca959707a41c56205e20c9f5a56ccec5ca41
Diffstat (limited to 'mod/bpgenerator/common')
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java3
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Appconfig.java6
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/BaseStream.java37
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Dmaap.java10
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java12
5 files changed, 63 insertions, 5 deletions
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java
index ac654a2..fbd0527 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java
@@ -5,6 +5,8 @@
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
* * ================================================================================
+ * * Modifications Copyright (c) 2021 Nokia
+ * * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
@@ -39,6 +41,7 @@ public class Constants {
public static final String DATA_ROUTER = "data_router";
public static final String MESSAGEROUTER_VALUE = "message router";
public static final String MESSAGE_ROUTER = "message_router";
+ public static final String KAFKA_TYPE = "kafka";
public static final String TOSCA_DEF_VERSION = "cloudify_dsl_1_3";
public static final String SERVICE_COMPONENT_NAME_OVERRIDE = "service_component_name_override";
public static final String EMPTY = "''";
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Appconfig.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Appconfig.java
index 5b3cdc6..d0f5784 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Appconfig.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Appconfig.java
@@ -5,6 +5,8 @@
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
* * ================================================================================
+ * * Modifications Copyright (c) 2021 Nokia
+ * * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
@@ -43,9 +45,9 @@ public class Appconfig {
private Calls[] services_calls;
- private Map<String, Dmaap> streams_publishes;
+ private Map<String, BaseStream> streams_publishes;
- private Map<String, Dmaap> streams_subscribes;
+ private Map<String, BaseStream> streams_subscribes;
private Map<String, Object> params;
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/BaseStream.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/BaseStream.java
new file mode 100644
index 0000000..310f9a0
--- /dev/null
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/BaseStream.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * * ============LICENSE_START=======================================================
+ * * org.onap.dcae
+ * * ================================================================================
+ * * Copyright (c) 2021 Nokia Intellectual Property. All rights reserved.
+ * * ================================================================================
+ * * Licensed under the Apache License, Version 2.0 (the "License");
+ * * you may not use this file except in compliance with the License.
+ * * You may obtain a copy of the License at
+ * *
+ * * http://www.apache.org/licenses/LICENSE-2.0
+ * *
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS,
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * * See the License for the specific language governing permissions and
+ * * limitations under the License.
+ * * ============LICENSE_END=========================================================
+ *
+ *
+ */
+
+
+package org.onap.blueprintgenerator.model.common;
+
+/**
+ * @author : Tomasz Wrobel
+ * @date 01/18/2021 Application: DCAE/ONAP - Blueprint Generator
+ * Applications Common Model: An interface with common stream field
+ */
+
+public interface BaseStream {
+
+ String getType();
+
+}
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Dmaap.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Dmaap.java
index 7ed79b3..9c37773 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Dmaap.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/Dmaap.java
@@ -5,6 +5,8 @@
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
* * ================================================================================
+ * * Modifications Copyright (c) 2021 Nokia
+ * * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
@@ -29,13 +31,14 @@ import lombok.Data;
/**
* @author : Ravi Mantena
- * @date 10/16/2020 Application: DCAE/ONAP - Blueprint Generator Common Module: Used by both ONAP
- * and DCAE Blueprint Applications Common Model: A model class which represents Dmaap
+ * @date 10/16/2020 Application: DCAE/ONAP - Blueprint Generator Common Module: Used by both ONAP and DCAE Blueprint
+ * Applications Common Model: A model class which represents Dmaap
*/
+
@Data
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
-public class Dmaap {
+public class Dmaap implements BaseStream {
private Object dmaap_info;
@@ -45,4 +48,5 @@ public class Dmaap {
private GetInput pass;
private GetInput user;
+
}
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java
index db15360..c9759d0 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java
@@ -5,6 +5,8 @@
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
* * ================================================================================
+ * * Modifications Copyright (c) 2021 Nokia
+ * * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
@@ -202,6 +204,16 @@ public class BlueprintHelperService {
}
/**
+ * Returns if the type is Kafka or not
+ *
+ * @param type Input Type
+ * @return
+ */
+ public boolean isKafkaStreamType(String type) {
+ return type.equals(Constants.KAFKA_TYPE);
+ }
+
+ /**
* Returns name with underscore for empty input
*
* @param name Name