summaryrefslogtreecommitdiffstats
path: root/prh-commons/src/main
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-12-17 09:49:00 +0100
committerpwielebs <piotr.wielebski@nokia.com>2018-12-18 14:30:59 +0100
commit0386c752ae31856bd5ee83fc8b6de763c48d3c83 (patch)
tree4a640c61086421a826022bc39c6f7e195b4a99fe /prh-commons/src/main
parentc35d7ae7f2ff44e0e08306f674b1b48d54831521 (diff)
Integration with SDK
* minor version upgraded in poms * align ConsumerDmaapModel to abstraction exposed in SDK * UTs modified Change-Id: Iaef2f9e8fab746106574771b2317c5689e047a5b Issue-ID: DCAEGEN2-1042 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-commons/src/main')
-rw-r--r--prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java4
-rw-r--r--prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/JsonBodyBuilderImpl.java (renamed from prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/CommonFunctions.java)9
2 files changed, 8 insertions, 5 deletions
diff --git a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java
index 6d488c85..b2bac24c 100644
--- a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java
+++ b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java
@@ -23,6 +23,8 @@ package org.onap.dcaegen2.services.prh.model;
import com.google.gson.annotations.SerializedName;
import org.immutables.gson.Gson;
import org.immutables.value.Value;
+import org.onap.dcaegen2.services.sdk.rest.services.model.AaiModel;
+import org.onap.dcaegen2.services.sdk.rest.services.model.DmaapModel;
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 5/8/18
@@ -30,7 +32,7 @@ import org.immutables.value.Value;
@Value.Immutable
@Gson.TypeAdapters(fieldNamingStrategy = true)
-public interface ConsumerDmaapModel {
+public interface ConsumerDmaapModel extends AaiModel, DmaapModel {
@SerializedName(value = "correlationId", alternate = "correlationId")
String getCorrelationId();
diff --git a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/CommonFunctions.java b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/JsonBodyBuilderImpl.java
index 20820fce..b504a4bd 100644
--- a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/CommonFunctions.java
+++ b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/JsonBodyBuilderImpl.java
@@ -22,13 +22,14 @@ package org.onap.dcaegen2.services.prh.model;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapterFactory;
+import org.onap.dcaegen2.services.sdk.rest.services.model.JsonBodyBuilder;
+
import java.util.ServiceLoader;
-public class CommonFunctions {
+public class JsonBodyBuilderImpl implements JsonBodyBuilder<ConsumerDmaapModel> {
- private CommonFunctions() {
- }
+ public JsonBodyBuilderImpl() {}
/**
* Method for serialization object by GSON.
@@ -36,7 +37,7 @@ public class CommonFunctions {
* @param consumerDmaapModel - object which will be serialized
* @return string from serialization
*/
- public static String createJsonBody(ConsumerDmaapModel consumerDmaapModel) {
+ public String createJsonBody(ConsumerDmaapModel consumerDmaapModel) {
GsonBuilder gsonBuilder = new GsonBuilder();
ServiceLoader.load(TypeAdapterFactory.class).forEach(gsonBuilder::registerTypeAdapterFactory);
return gsonBuilder.create().toJson(ImmutableConsumerDmaapModel.builder().ipv4(consumerDmaapModel.getIpv4())