summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/ExtendedDmaapConsumerHttpClientImpl.java2
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/ExtendedDmaapProducerHttpClientImpl.java25
2 files changed, 14 insertions, 13 deletions
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/ExtendedDmaapConsumerHttpClientImpl.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/ExtendedDmaapConsumerHttpClientImpl.java
index 3bae6989..8d2f82d9 100644
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/ExtendedDmaapConsumerHttpClientImpl.java
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/ExtendedDmaapConsumerHttpClientImpl.java
@@ -68,7 +68,7 @@ public class ExtendedDmaapConsumerHttpClientImpl {
try {
return createRequest()
.flatMap(this::executeHttpClient);
- } catch (NullPointerException | URISyntaxException e) {
+ } catch (URISyntaxException e) {
logger.warn("Exception while executing HTTP request: ", e);
}
return Optional.empty();
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/ExtendedDmaapProducerHttpClientImpl.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/ExtendedDmaapProducerHttpClientImpl.java
index bea36201..2f96b396 100644
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/ExtendedDmaapProducerHttpClientImpl.java
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/ExtendedDmaapProducerHttpClientImpl.java
@@ -68,7 +68,7 @@ public class ExtendedDmaapProducerHttpClientImpl {
try {
return createRequest()
.flatMap(this::executeHttpClient);
- } catch (NullPointerException | URISyntaxException e) {
+ } catch (URISyntaxException e) {
logger.warn("Exception while executing HTTP request: ", e);
}
return Optional.empty();
@@ -114,16 +114,17 @@ public class ExtendedDmaapProducerHttpClientImpl {
}
private Optional<String> getDmaapProducerResponseHandler(HttpResponse httpResponse) throws IOException {
- final int responseCode = httpResponse.getStatusLine().getStatusCode();
- final HttpEntity responseEntity = httpResponse.getEntity();
+ final int responseCode = httpResponse.getStatusLine().getStatusCode();
+ logger.info("Status code of operation: {}", responseCode);
+ final HttpEntity responseEntity = httpResponse.getEntity();
- if (HttpUtils.isSuccessfulResponseCode(responseCode)) {
- logger.trace("HTTP response successful.");
- return Optional.of("" + responseCode);
- } else {
- String response = responseEntity != null ? EntityUtils.toString(responseEntity) : "";
- logger.warn("HTTP response not successful : {}", response);
- return Optional.of("" + responseCode);
- }
+ if (HttpUtils.isSuccessfulResponseCode(responseCode)) {
+ logger.trace("HTTP response successful.");
+ return Optional.of("" + responseCode);
+ } else {
+ String response = responseEntity != null ? EntityUtils.toString(responseEntity) : "";
+ logger.warn("HTTP response not successful : {}", response);
+ return Optional.of("" + responseCode);
+ }
}
-}
+} \ No newline at end of file