summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main/java
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-05-23 15:31:11 +0200
committerpwielebs <piotr.wielebski@nokia.com>2018-05-24 11:50:34 +0200
commit7ddaf390698fe5ae9143d91e7011059b3973f8ce (patch)
tree4d483f24c6b73ce2e0d0a8237410856f8e01edb6 /prh-app-server/src/main/java
parentb6bc8925a354825545b8527879e0f687b0dbab3a (diff)
Refactor of prh-aai-client
Change-Id: Idbca6fe4c050c789f4479164846437039d3b549d Issue-ID: DCAEGEN2-451 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src/main/java')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTask.java2
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java8
2 files changed, 5 insertions, 5 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTask.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTask.java
index 4e95a0d1..ba8e6e45 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTask.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTask.java
@@ -28,7 +28,7 @@ import org.onap.dcaegen2.services.prh.service.producer.ExtendedDmaapProducerHttp
*/
abstract class DmaapPublisherTask<R, S, C> extends Task<R, S, C> {
- abstract String publish(ConsumerDmaapModel consumerDmaapModel) throws DmaapNotFoundException;
+ abstract Integer publish(ConsumerDmaapModel consumerDmaapModel) throws DmaapNotFoundException;
abstract ExtendedDmaapProducerHttpClientImpl resolveClient();
}
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java
index 8f2541c8..6a514747 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java
@@ -37,7 +37,7 @@ import org.springframework.stereotype.Component;
*/
@Component
public class DmaapPublisherTaskImpl extends
- DmaapPublisherTask<ConsumerDmaapModel, String, DmaapPublisherConfiguration> {
+ DmaapPublisherTask<ConsumerDmaapModel, Integer, DmaapPublisherConfiguration> {
private static final Logger logger = LoggerFactory.getLogger(DmaapPublisherTaskImpl.class);
private final Config prhAppConfig;
@@ -49,15 +49,15 @@ public class DmaapPublisherTaskImpl extends
}
@Override
- String publish(ConsumerDmaapModel consumerDmaapModel) throws DmaapNotFoundException {
+ Integer publish(ConsumerDmaapModel consumerDmaapModel) throws DmaapNotFoundException {
logger.trace("Method called with arg {}", consumerDmaapModel);
return extendedDmaapProducerHttpClient.getHttpProducerResponse(consumerDmaapModel)
- .filter(response -> !response.isEmpty() && response.equals(String.valueOf(HttpStatus.OK.value())))
+ .filter(response -> response == HttpStatus.OK.value())
.orElseThrow(() -> new DmaapNotFoundException("Incorrect response from Dmaap"));
}
@Override
- public String execute(ConsumerDmaapModel consumerDmaapModel) throws DmaapNotFoundException {
+ public Integer execute(ConsumerDmaapModel consumerDmaapModel) throws DmaapNotFoundException {
consumerDmaapModel = Optional.ofNullable(consumerDmaapModel)
.orElseThrow(() -> new DmaapNotFoundException("Invoked null object to Dmaap task"));
extendedDmaapProducerHttpClient = resolveClient();