summaryrefslogtreecommitdiffstats
path: root/adapters/mso-vfc-adapter/src/main
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2017-09-18 12:44:28 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-18 12:44:28 +0000
commit532e0fa11d6593ace302e54a31740f0f74d3e4cc (patch)
tree9694f443a4980c92c5c65ebf6434ebba914bac0d /adapters/mso-vfc-adapter/src/main
parent79078d99d45a4e3bb87796f3012941e5a8ecbef0 (diff)
parent043f000141590ef5c5944b6d717c7a592df69c47 (diff)
Merge "Fixed issues in adapter package Issue-Id: SO-141"
Diffstat (limited to 'adapters/mso-vfc-adapter/src/main')
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java20
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);