From d1a47bb7e4589e45753661f08e94807b30470059 Mon Sep 17 00:00:00 2001 From: rama-huawei Date: Wed, 18 Oct 2017 10:57:55 +0530 Subject: Replace the usage of System.out by a logger Issue-id: SO-213 Change-Id: Ifd4cca77a0dfe72d876af605ad7ae6d967b5b056 Signed-off-by: rama-huawei --- .../java/com/woorea/openstack/connector/HttpClientConnector.java | 5 +++-- .../com/woorea/openstack/connector/HttpClientRedirectStrategy.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'openstack-client-connectors/http-connector/src') diff --git a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java index dc03f9e..f7fa30b 100644 --- a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java +++ b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java @@ -104,6 +104,7 @@ public class HttpClientConnector implements OpenStackClientConnector { return type.getAnnotation(JsonRootName.class) == null ? DEFAULT_MAPPER : WRAPPED_MAPPER; } + @Override public OpenStackResponse request(OpenStackRequest request) { CloseableHttpClient httpClient = null; //HttpClients.createDefault(); @@ -136,8 +137,8 @@ public class HttpClientConnector implements OpenStackClientConnector { String entityJson = mapper.writeValueAsString (request.entity().getEntity()); entity = new StringEntity(entityJson, ContentType.create(request.entity().getContentType())); - - System.out.println("Openstack query JSON:"+entityJson); + + LOGGER.debug("Openstack query JSON:"+entityJson); LOGGER.debug ("Request JSON Body: " + entityJson.replaceAll("\"password\":\"[^\"]*\"", "\"password\":\"***\"")); } catch (JsonProcessingException e) { diff --git a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientRedirectStrategy.java b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientRedirectStrategy.java index 6264589..2ba17fb 100644 --- a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientRedirectStrategy.java +++ b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientRedirectStrategy.java @@ -113,7 +113,7 @@ public class HttpClientRedirectStrategy extends DefaultRedirectStrategy { final int status = response.getStatusLine().getStatusCode(); - HttpUriRequest newRequest = null; + HttpUriRequest newRequest; if (status == HttpStatus.SC_TEMPORARY_REDIRECT || status == HttpStatus.SC_MOVED_TEMPORARILY) { newRequest = RequestBuilder.copy(request).setUri(uri).build(); } else { -- cgit 1.2.3-korg