summaryrefslogtreecommitdiffstats
path: root/aai-service
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2019-01-07 17:06:24 +0530
committerSandeep Jha <sandeejh@in.ibm.com>2019-01-07 12:11:19 +0000
commit5b5cd94817ec53dcda4908a9ad11c4a4f4a8fa2c (patch)
treecd2b127049f626b162e6be871dbab0e7e1a6be5b /aai-service
parente6eb5bfb02077473d20061bd16faf6c1a6fa4af4 (diff)
fixed sonar issues in AAIClientRESTExecutor
fixed sonar issues Issue-ID: CCSDK-552 Change-Id: I7ef4106478624255a4d5e3cd187108dadb5be1fe Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'aai-service')
-rwxr-xr-xaai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
index d362d0e06..dd39ba9b3 100755
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -79,6 +81,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
private String userName;
private String userPassword;
private final String applicationId;
+ private static final String HTTP_URL_CONNECTION_RESULT="HttpURLConnection result: {} : {}";
/**
* class Constructor
@@ -116,10 +119,9 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
ignoreCertificateHostError = host_error;
- HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
- public boolean verify(String string,SSLSession ssls) {
- return ignoreCertificateHostError;
- }
+ HttpsURLConnection.setDefaultHostnameVerifier( (String string,SSLSession ssls) -> {
+ return ignoreCertificateHostError;
+
});
if(truststorePath != null && truststorePassword != null && (new File(truststorePath)).exists()) {
@@ -257,7 +259,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
}
// Process the response
- LOG.info("HttpURLConnection result: {} : {}", responseCode, responseMessage);
+ LOG.info(HTTP_URL_CONNECTION_RESULT, responseCode, responseMessage);
logMetricResponse(responseCode, responseMessage);
if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8));
@@ -398,7 +400,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
responseMessage = NOT_PROVIDED;
}
- LOG.info("HttpURLConnection result: {} : {}", responseCode, responseMessage);
+ LOG.info(HTTP_URL_CONNECTION_RESULT, responseCode, responseMessage);
logMetricResponse(responseCode, responseMessage);
// Process the response
@@ -481,7 +483,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
}
// Process the response
- LOG.info("HttpURLConnection result: {} : {}", responseCode, responseMessage);
+ LOG.info(HTTP_URL_CONNECTION_RESULT, responseCode, responseMessage);
logMetricResponse(responseCode, responseMessage);
if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8));
@@ -562,7 +564,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
responseMessage = NOT_PROVIDED;
}
- LOG.info("HttpURLConnection result: {} : {}", responseCode, responseMessage);
+ LOG.info(HTTP_URL_CONNECTION_RESULT, responseCode, responseMessage);
logMetricResponse(responseCode, responseMessage);
ObjectMapper mapper = AAIService.getObjectMapper();
@@ -637,7 +639,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
responseMessage = NOT_PROVIDED;
}
- LOG.info("HttpURLConnection result: {} : {}", responseCode, responseMessage);
+ LOG.info(HTTP_URL_CONNECTION_RESULT, responseCode, responseMessage);
logMetricResponse(responseCode, responseMessage);
// Process the response