From 59700d14ff998413dada0cb2e0864e643edbb77e Mon Sep 17 00:00:00 2001 From: Witold Ficio Kopel Date: Tue, 26 Mar 2019 09:17:02 +0100 Subject: Eliminated printStackTrace() calls Eliminated calls to printStackTrace() on Throwable as they go to stdout and are not handled by logger. Occurences has been replaced by calls to logger or modifications to nearby logger calls (Throwable passed as last parameter). Occurences in unit test classes left without modification. Change-Id: I6a771d60a3ea69ceecc29bb21358e565aa5ce101 Issue-ID: LOG-631 Signed-off-by: Witold Ficio Kopel --- .../org/onap/so/adapters/sdnc/impl/SDNCRestClient.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'adapters/mso-sdnc-adapter/src') diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java index bea4c1bb3b..80f111b570 100644 --- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java +++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java @@ -85,7 +85,7 @@ public class SDNCRestClient{ @Async public void executeRequest(SDNCAdapterRequest bpelRequest) { - + logger.debug("BPEL Request:" + bpelRequest.toString()); // Added delay to allow completion of create request to SDNC @@ -93,7 +93,9 @@ public class SDNCRestClient{ try { Thread.sleep(5000); } catch (InterruptedException e) { - e.printStackTrace(); + logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), "SDNC", + ErrorCode.UnknownError.getValue(), "Exception processing request to SDNC", e); + Thread.currentThread().interrupt(); } @@ -104,12 +106,10 @@ public class SDNCRestClient{ String sdncReqBody = null; - - RequestTunables rt = new RequestTunables(bpelReqId, bpelRequest.getRequestHeader().getMsoAction(), bpelRequest.getRequestHeader().getSvcOperation(), - bpelRequest.getRequestHeader().getSvcAction()); + bpelRequest.getRequestHeader().getSvcAction()); rt = tunablesMapper.setTunables(rt); rt.setSdncaNotificationUrl(env.getProperty(Constants.MY_URL_PROP)); @@ -176,8 +176,8 @@ public class SDNCRestClient{ sdncResp.setRespCode(con.getResponseCode()); sdncResp.setRespMsg(con.getResponseMessage()); - if (con.getResponseCode()>= 200 && con.getResponseCode()<=299) { - in = new BufferedReader(new InputStreamReader(con.getInputStream())); + if (con.getResponseCode()>= 200 && con.getResponseCode()<=299) { + in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; //Not parsing the response -it contains a responseHdr section and data section while ((inputLine = in.readLine()) != null) { @@ -185,7 +185,7 @@ public class SDNCRestClient{ } in.close(); } - + sdncResp.setSdncRespXml(response.toString()); logger.info("{} :\n {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.name(), sdncResp.toString(), "SDNC"); return(sdncResp); @@ -314,7 +314,7 @@ public class SDNCRestClient{ SDNCCallbackAdapterPortType cbPort = cbSvc.getSDNCCallbackAdapterSoapHttpPort(); BindingProvider bp = (BindingProvider)cbPort; - + if(null != wsdlUrl) { bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, wsdlUrl.toExternalForm()); } -- cgit 1.2.3-korg