diff options
author | seshukm <seshu.kumar.m@huawei.com> | 2017-09-18 12:58:10 +0530 |
---|---|---|
committer | seshukm <seshu.kumar.m@huawei.com> | 2017-09-18 12:58:10 +0530 |
commit | 043f000141590ef5c5944b6d717c7a592df69c47 (patch) | |
tree | 32a29bf25d81be8e5c08ce793d395ff2a9f43a3e /adapters/mso-vfc-adapter/src/main/java | |
parent | 5e2aa1fec3c51e8eb0e6b43285c8414105a51b2f (diff) |
Fixed issues in adapter package
Issue-Id: SO-141
Change-Id: I1a6905aa7e1328e47b3d0f7580a1dca33c6a069c
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'adapters/mso-vfc-adapter/src/main/java')
-rw-r--r-- | adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java index dfedce8531..8e5f0b4274 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java @@ -130,31 +130,37 @@ public class RestfulUtil { if(httpResponse.getStatusLine().getStatusCode() >= 300) { String errMsg = "VFC returned " + statusCode + " " + statusMessage; logError(errMsg); - return CreateResponse(statusCode, errMsg); + return createResponse(statusCode, errMsg); } httpResponse = null; - method.reset(); + if(null != method) { + method.reset(); + } + else { + LOGGER.debug("method is NULL:"); + } + method = null; LOGGER.info(MessageEnum.RA_RESPONSE_FROM_SDNC, responseContent, "SDNC", ""); - return CreateResponse(statusCode, responseContent); + return createResponse(statusCode, responseContent); } catch(SocketTimeoutException e) { String errMsg = "Request to SDNC timed out"; logError(errMsg, e); - return CreateResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg); + return createResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg); } catch(ConnectTimeoutException e) { String errMsg = "Request to SDNC timed out"; logError(errMsg, e); - return CreateResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg); + return createResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg); } catch(Exception e) { String errMsg = "Error processing request to SDNC"; logError(errMsg, e); - return CreateResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, errMsg); + return createResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, errMsg); } finally { if(httpResponse != null) { @@ -185,7 +191,7 @@ public class RestfulUtil { ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, errMsg); } - private static RestfulResponse CreateResponse(int statusCode, String content) { + private static RestfulResponse createResponse(int statusCode, String content) { RestfulResponse rsp = new RestfulResponse(); rsp.setStatus(statusCode); rsp.setResponseContent(content); |