aboutsummaryrefslogtreecommitdiffstats
path: root/profiles/http/src
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-02-12 10:18:20 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-02-12 11:26:08 +0530
commit33596b6fca3804b5e9e685dbe144b7a6879fa96c (patch)
treee89dc358b61d921a52ca48482f9ca8fe9b68f586 /profiles/http/src
parent55386d02df6cda4581a4207233e0f72353f9fbb7 (diff)
Ignore conn manager closure, take care by closure
Issue-ID: CLI-92 Change-Id: If2eeabd3a6ee18ab38eca4dff5a67114e372652f Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'profiles/http/src')
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
index 3e03efa7..235a3b98 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
@@ -126,7 +126,7 @@ public class OnapHttpConnection {
.register("https", new SSLConnectionSocketFactory(sslContext, hostnameVerifier)).build();
HttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
- this.httpClient = HttpClients.custom().setConnectionManager(connManager)
+ this.httpClient = HttpClients.custom().setConnectionManager(connManager) // NOSONAR
.setRedirectStrategy(new LaxRedirectStrategy()).build();
} else {
this.httpClient = HttpClients.createDefault(); // NOSONAR
@@ -345,8 +345,12 @@ public class OnapHttpConnection {
return result;
}
+ @SuppressWarnings("deprecation")
public void close() {
this.mapCommonHeaders.clear();
+ if (this.httpClient != null) {
+ this.httpClient.getConnectionManager().shutdown();
+ }
}
private HttpEntity getMultipartEntity(HttpInput input) {