Merge "SSL_BASIC getting 403 error"
authorJames Forsyth <jf2512@att.com>
Wed, 23 May 2018 20:13:07 +0000 (20:13 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 23 May 2018 20:13:07 +0000 (20:13 +0000)
pom.xml
src/main/java/org/onap/aai/restclient/client/RestClient.java
version.properties

diff --git a/pom.xml b/pom.xml
index b7586ab..b469d68 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ limitations under the License.
 
        <groupId>org.onap.aai</groupId>
        <artifactId>rest-client</artifactId>
-       <version>1.2.1-SNAPSHOT</version>
+       <version>1.3.0-SNAPSHOT</version>
        <name>aai-rest-client</name>
         
        <properties>
index aab33a0..a00c0ef 100644 (file)
@@ -625,43 +625,58 @@ public class RestClient {
 
   private void debugRequest(String url, String payload, Map<String, List<String>> headers,
       MediaType responseType) {
-    if (logger.isDebugEnabled()) {
-      StringBuilder debugRequest = new StringBuilder("REQUEST:\n");
-      debugRequest.append("URL: ").append(url).append("\n");
-      debugRequest.append("Payload: ").append(payload).append("\n");
-      debugRequest.append("Response Type: ").append(responseType).append("\n");
-      if (headers != null) {
-        debugRequest.append("Headers: ");
-        for (Entry<String, List<String>> header : headers.entrySet()) {
-          debugRequest.append("\n\t").append(header.getKey()).append(":");
-          for (String headerEntry : header.getValue()) {
-            debugRequest.append("\"").append(headerEntry).append("\" ");
-          }
-        }
-      }
+    if (!logger.isDebugEnabled()) {
+      return;
+    }
+
+    StringBuilder debugRequest = new StringBuilder("REQUEST:\n");
+    debugRequest.append("URL: ").append(url).append("\n");
+    debugRequest.append("Payload: ").append(payload).append("\n");
+    debugRequest.append("Response Type: ").append(responseType).append("\n");
+
+    if (headers == null) {
       logger.debug(debugRequest.toString());
+      return;
+    }
+
+    debugRequest.append("Headers: ");
+    for (Entry<String, List<String>> header : headers.entrySet()) {
+      debugRequest.append("\n\t").append(header.getKey()).append(":");
+      for (String headerEntry : header.getValue()) {
+        debugRequest.append("\"").append(headerEntry).append("\" ");
+      }
     }
+
+    logger.debug(debugRequest.toString());
+
   }
 
   private void debugResponse(OperationResult operationResult,
       MultivaluedMap<String, String> headers) {
-    if (logger.isDebugEnabled()) {
-      StringBuilder debugResponse = new StringBuilder("RESPONSE:\n");
-      debugResponse.append("Result: ").append(operationResult.getResultCode()).append("\n");
-      debugResponse.append("Failure Cause: ").append(operationResult.getFailureCause())
-          .append("\n");
-      debugResponse.append("Payload: ").append(operationResult.getResult()).append("\n");
-      if (headers != null) {
-        debugResponse.append("Headers: ");
-        for (Entry<String, List<String>> header : headers.entrySet()) {
-          debugResponse.append("\n\t").append(header.getKey()).append(":");
-          for (String headerEntry : header.getValue()) {
-            debugResponse.append("\"").append(headerEntry).append("\" ");
-          }
-        }
-      }
+
+    if (!logger.isDebugEnabled()) {
+      return;
+    }
+
+    StringBuilder debugResponse = new StringBuilder("RESPONSE:\n");
+    debugResponse.append("Result: ").append(operationResult.getResultCode()).append("\n");
+    debugResponse.append("Failure Cause: ").append(operationResult.getFailureCause()).append("\n");
+    debugResponse.append("Payload: ").append(operationResult.getResult()).append("\n");
+
+    if (headers == null) {
       logger.debug(debugResponse.toString());
+      return;
+    }
+
+    debugResponse.append("Headers: ");
+    for (Entry<String, List<String>> header : headers.entrySet()) {
+      debugResponse.append("\n\t").append(header.getKey()).append(":");
+      for (String headerEntry : header.getValue()) {
+        debugResponse.append("\"").append(headerEntry).append("\" ");
+      }
     }
+
+    logger.debug(debugResponse.toString());
   }
 
   /**
@@ -710,7 +725,7 @@ public class RestClient {
     
     try {
       initClient.setClient(clientBuilder.getClient());
-    } catch ( Throwable error ) {
+    } catch ( Exception error) {
       initClient.setCaughtException(error);
     }
     
index 688582d..a254b21 100644 (file)
@@ -3,8 +3,8 @@
 # because they are used in Jenkins, whose plug-in doesn't support
 
 major=1
-minor=2
-patch=1
+minor=3
+patch=0
 
 base_version=${major}.${minor}.${patch}