summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorMcblain, Thomas <tom.mcblain@att.com>2019-07-25 13:57:43 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2019-07-25 13:57:43 -0400
commit61b1a3f28b9641bba7702119fa6eda26d820d295 (patch)
tree0dbda218ed584cf3fef55608aacd1f01ae9685c7 /adapters
parent5128f152409017604d97b1e2f711a77a4c3acdf3 (diff)
Add SpringClientFilter in ValetClient to autolog
Add SpringClientFilter in ValetClient to autolog msgs Modify to use our RestTemplateConfig for RestTemplate Use Provider for thread-safe RestTemplate autowire Issue-ID: SO-2160 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I02d1995ebd6d2c93477008feb13193d3c0b3cd05
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
index 34177ff5a3..3c073af6ba 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
@@ -48,10 +48,10 @@ import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
-import org.springframework.http.client.BufferingClientHttpRequestFactory;
-import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
+import org.onap.so.client.RestTemplateConfig;
+import javax.inject.Provider;
@Component
public class ValetClient {
@@ -75,6 +75,9 @@ public class ValetClient {
private static final String BODY = ", body=";
@Autowired
private ObjectMapper mapper;
+ @Autowired
+ private Provider<RestTemplate> templateProvider;
+
protected String baseUrl;
protected String basePath;
@@ -123,10 +126,7 @@ public class ValetClient {
}
private RestTemplate getRestTemplate() {
- RestTemplate restTemplate = new RestTemplate();
- restTemplate
- .setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
- return restTemplate;
+ return templateProvider.get();
}
/*