aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src
diff options
context:
space:
mode:
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
index 8a4d561fbd..4e8e9562ce 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
@@ -21,9 +21,6 @@
package org.onap.so.apihandlerinfra.tenantisolation.helpers;
import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
@@ -36,6 +33,7 @@ import org.onap.so.apihandlerinfra.exceptions.ApiException;
import org.onap.so.apihandlerinfra.exceptions.ValidateException;
import org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo;
import org.onap.so.client.HttpClient;
+import org.onap.so.client.HttpClientFactory;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
import org.onap.so.utils.CryptoUtils;
@@ -53,6 +51,7 @@ public class SDCClientHelper {
private static String MESSAGE_UNDEFINED_ERROR = "Undefined Error Message!";
private static String MESSAGE_UNEXPECTED_FORMAT = "Unexpected response format from SDC.";
+ private final HttpClientFactory httpClientFactory = new HttpClientFactory();
@Value("${mso.sdc.endpoint}")
private String sdcEndpoint;
@@ -91,7 +90,7 @@ public class SDCClientHelper {
URL url = new URL(urlString);
- HttpClient httpClient = new HttpClient(url, "application/json", TargetEntity.SDC);
+ HttpClient httpClient = httpClientFactory.newJsonClient(url, TargetEntity.SDC);
httpClient.addBasicAuthHeader(sdcClientAuth, msoKey);
Response apiResponse = setHttpPostResponse(httpClient, jsonPayload);