summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main
diff options
context:
space:
mode:
authorMichal Kabaj <michal.kabaj@nokia.com>2019-12-04 12:51:19 +0100
committerMichal Kabaj <michal.kabaj@nokia.com>2019-12-04 13:18:57 +0100
commit2532f556a8bda4d6eec02d5120553262e65c7329 (patch)
treec39374d379454bf6d90256c0f5701185c259e6a0 /prh-app-server/src/main
parent26b3fd4c057a8e1ac38bcc48c920c4aef61da9e2 (diff)
Refactor AaiClient API - remove interfaces
- Removed JsonBodyBuilder because it had only one impl - AaiJsonBodyBuilderImpl - Removed AaiModel because it had only one impl - ConsumerDmaapModel - Replaced usages of removed interfaces with concrete implementations Issue-ID: DCAEGEN2-1955 Signed-off-by: Michal Kabaj <michal.kabaj@nokia.com> Change-Id: I6cd651b2061e8520a508e3a62091d1cb15002c99
Diffstat (limited to 'prh-app-server/src/main')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AaiHttpClientConfig.java6
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImpl.java5
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTask.java4
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImpl.java8
4 files changed, 11 insertions, 12 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AaiHttpClientConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AaiHttpClientConfig.java
index 9156732d..d8f6d966 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AaiHttpClientConfig.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AaiHttpClientConfig.java
@@ -28,11 +28,11 @@ import org.onap.dcaegen2.services.prh.adapter.aai.api.get.AaiGetServiceInstanceC
import org.onap.dcaegen2.services.prh.adapter.aai.api.get.AaiHttpGetClient;
import org.onap.dcaegen2.services.prh.adapter.aai.api.patch.AaiHttpPatchClient;
import org.onap.dcaegen2.services.prh.adapter.aai.main.AaiHttpClientFactory;
-import org.onap.dcaegen2.services.prh.adapter.aai.model.AaiModel;
import org.onap.dcaegen2.services.prh.adapter.aai.model.AaiServiceInstanceQueryModel;
import org.onap.dcaegen2.services.prh.model.AaiJsonBodyBuilderImpl;
import org.onap.dcaegen2.services.prh.model.AaiPnfResultModel;
import org.onap.dcaegen2.services.prh.model.AaiServiceInstanceResultModel;
+import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.model.utils.PrhModelAwareGsonBuilder;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.HttpResponse;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.RxHttpClient;
@@ -47,7 +47,7 @@ public class AaiHttpClientConfig {
private CbsConfiguration cbsConfiguration;
@Bean
- public AaiHttpClient<AaiModel, HttpResponse> getPatchClientFactory() {
+ public AaiHttpClient<ConsumerDmaapModel, HttpResponse> getPatchClientFactory() {
return createLazyConfigClient(
(config, client) -> new AaiHttpPatchClient(config, new AaiJsonBodyBuilderImpl(), client));
}
@@ -64,7 +64,7 @@ public class AaiHttpClientConfig {
}
@Bean
- public AaiHttpClient<AaiModel, AaiPnfResultModel> getGetClient() {
+ public AaiHttpClient<ConsumerDmaapModel, AaiPnfResultModel> getGetClient() {
return createLazyConfigClient(
(config, client) -> new AaiHttpGetClient(config, client)
.map(httpResponse -> {
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImpl.java
index e0764fd2..fd7f11c0 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImpl.java
@@ -21,7 +21,6 @@
package org.onap.dcaegen2.services.prh.tasks;
import org.onap.dcaegen2.services.prh.adapter.aai.api.AaiHttpClient;
-import org.onap.dcaegen2.services.prh.adapter.aai.model.AaiModel;
import org.onap.dcaegen2.services.prh.exceptions.AaiNotFoundException;
import org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException;
import org.onap.dcaegen2.services.prh.exceptions.PrhTaskException;
@@ -43,10 +42,10 @@ public class AaiProducerTaskImpl implements AaiProducerTask {
private static final Logger LOGGER = LoggerFactory.getLogger(AaiProducerTaskImpl.class);
- private final AaiHttpClient<AaiModel, HttpResponse> aaiHttpPatchClient;
+ private final AaiHttpClient<ConsumerDmaapModel, HttpResponse> aaiHttpPatchClient;
@Autowired
- public AaiProducerTaskImpl(final AaiHttpClient<AaiModel, HttpResponse> aaiHttpPatchClient) {
+ public AaiProducerTaskImpl(final AaiHttpClient<ConsumerDmaapModel, HttpResponse> aaiHttpPatchClient) {
this.aaiHttpPatchClient = aaiHttpPatchClient;
}
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTask.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTask.java
index 0bcb1dea..b4ab10f0 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTask.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTask.java
@@ -20,10 +20,10 @@
package org.onap.dcaegen2.services.prh.tasks;
-import org.onap.dcaegen2.services.prh.adapter.aai.model.AaiModel;
+import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
import reactor.core.publisher.Mono;
@FunctionalInterface
public interface AaiQueryTask {
- Mono<Boolean> execute(final AaiModel aaiModel);
+ Mono<Boolean> execute(final ConsumerDmaapModel aaiModel);
}
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImpl.java
index 46f9d3d9..9489a501 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImpl.java
@@ -24,11 +24,11 @@ import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
import org.onap.dcaegen2.services.prh.adapter.aai.api.AaiHttpClient;
-import org.onap.dcaegen2.services.prh.adapter.aai.model.AaiModel;
import org.onap.dcaegen2.services.prh.adapter.aai.model.AaiServiceInstanceQueryModel;
import org.onap.dcaegen2.services.prh.adapter.aai.model.ImmutableAaiServiceInstanceQueryModel;
import org.onap.dcaegen2.services.prh.model.AaiPnfResultModel;
import org.onap.dcaegen2.services.prh.model.AaiServiceInstanceResultModel;
+import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.model.Relationship;
import org.onap.dcaegen2.services.prh.model.RelationshipData;
import org.onap.dcaegen2.services.prh.model.RelationshipDict;
@@ -44,19 +44,19 @@ public class AaiQueryTaskImpl implements AaiQueryTask {
static final String SERVICE_TYPE = "service-subscription.service-type";
static final String SERVICE_INSTANCE_ID = "service-instance.service-instance-id";
- private final AaiHttpClient<AaiModel, AaiPnfResultModel> getPnfModelClient;
+ private final AaiHttpClient<ConsumerDmaapModel, AaiPnfResultModel> getPnfModelClient;
private final AaiHttpClient<AaiServiceInstanceQueryModel, AaiServiceInstanceResultModel> getServiceClient;
@Autowired
public AaiQueryTaskImpl(
- final AaiHttpClient<AaiModel, AaiPnfResultModel> getPnfModelClient,
+ final AaiHttpClient<ConsumerDmaapModel, AaiPnfResultModel> getPnfModelClient,
final AaiHttpClient<AaiServiceInstanceQueryModel, AaiServiceInstanceResultModel> getServiceClient) {
this.getPnfModelClient = getPnfModelClient;
this.getServiceClient = getServiceClient;
}
@Override
- public Mono<Boolean> execute(AaiModel aaiModel) {
+ public Mono<Boolean> execute(ConsumerDmaapModel aaiModel) {
return getPnfModelClient
.getAaiResponse(aaiModel)
.flatMap(this::checkIfPnfHasRelationToService)