aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java6
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/BPRestCallback.java6
-rw-r--r--adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java7
-rw-r--r--adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/BPRestCallback.java5
4 files changed, 9 insertions, 15 deletions
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java
index 757ea8207d..7473950063 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java
@@ -199,7 +199,7 @@ public class SDNCRestClient implements Runnable {
//default
sdncResp.setRespCode(HttpURLConnection.HTTP_INTERNAL_ERROR);
String respMsg = "Error processing request to SDNC. ";
- String sdncErrMsg = null;
+ String sdncErrMsg = "";
if (e instanceof java.net.SocketTimeoutException )
{
@@ -264,9 +264,7 @@ public class SDNCRestClient implements Runnable {
if (e.getMessage() != null) {
respMsg = respMsg + e.getMessage();
}
- if (sdncErrMsg != null) {
- respMsg = respMsg + sdncErrMsg;
- }
+ respMsg = respMsg + sdncErrMsg;
sdncResp.setRespMsg(respMsg);
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/BPRestCallback.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/BPRestCallback.java
index 0622c48c41..f6708a2586 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/BPRestCallback.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/BPRestCallback.java
@@ -138,12 +138,7 @@ public class BPRestCallback {
LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError, msg);
ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, msg);
}
-
- httpResponse = null;
}
-
- method.reset();
- method = null;
return true;
} catch (Exception e) {
LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError,
@@ -155,6 +150,7 @@ public class BPRestCallback {
if (httpResponse != null) {
try {
EntityUtils.consume(httpResponse.getEntity());
+ httpResponse = null;
} catch (Exception e) {
LOGGER.debug("Exception:", e);
}
diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java
index a4f1046df9..6dc0dc35d9 100644
--- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java
+++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java
@@ -240,9 +240,6 @@ public class BpelRestClient {
LOGGER.debug("Sending to BPEL server: "+bpelUrl);
LOGGER.debug("Content is: "+toBpelStr);
- //Client 4.3+
- CloseableHttpClient client = HttpClients.createDefault();
-
//POST
HttpPost post = new HttpPost(bpelUrl);
if (credentials != null && !credentials.isEmpty())
@@ -260,9 +257,13 @@ public class BpelRestClient {
.build();
post.setConfig(requestConfig);
+ //Client 4.3+
+ CloseableHttpClient client = null;
+
//Client 4.3+
//Execute & GetResponse
try {
+ client = HttpClients.createDefault();
CloseableHttpResponse response = client.execute(post);
if (response != null) {
lastResponseCode = response.getStatusLine().getStatusCode();
diff --git a/adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/BPRestCallback.java b/adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/BPRestCallback.java
index 253523eaac..0293a8d4d0 100644
--- a/adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/BPRestCallback.java
+++ b/adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/BPRestCallback.java
@@ -144,11 +144,8 @@ public class BPRestCallback {
ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, msg);
}
- httpResponse = null;
}
- method.reset();
- method = null;
return true;
} catch (Exception e) {
LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError,
@@ -160,6 +157,7 @@ public class BPRestCallback {
if (httpResponse != null) {
try {
EntityUtils.consume(httpResponse.getEntity());
+ httpResponse = null;
} catch (Exception e) {
LOGGER.debug("Exception :",e);
}
@@ -168,6 +166,7 @@ public class BPRestCallback {
if (method != null) {
try {
method.reset();
+ method = null;
} catch (Exception e) {
LOGGER.debug("Exception :",e);
}