aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main/java
diff options
context:
space:
mode:
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();