public class SimpleRestTemplateConfigurator extends java.lang.Object implements RestTemplateConfigurator
RestTemplateConfigurator that sets an SimpleClientHttpRequestFactory on a RestTemplate.
Use this to use standard JDK facilities to create requests in the Client's RestTemplate.
| Constructor and Description |
|---|
SimpleRestTemplateConfigurator()
Create an instance with no TLS configuration and no
HttpURLConnection post-processor. |
SimpleRestTemplateConfigurator(HttpConnectionConfigurator configurator)
Create an instance with a
HttpURLConnection post-processor. |
SimpleRestTemplateConfigurator(javax.net.ssl.SSLSocketFactory sslSocketFactory)
Create an instance with TLS configuration.
|
SimpleRestTemplateConfigurator(javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.HostnameVerifier hostnameVerifier)
Create an instance with TLS configuration, including a custom hostname verifier.
|
SimpleRestTemplateConfigurator(javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.HostnameVerifier hostnameVerifier,
HttpConnectionConfigurator configurator)
Create an instance with TLS configuration, a custom hostname verifier, and a
HttpURLConnection post-processor. |
SimpleRestTemplateConfigurator(javax.net.ssl.SSLSocketFactory sslSocketFactory,
HttpConnectionConfigurator configurator)
Create an instance with TLS configuration and a
HttpURLConnection post-processor. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.web.client.RestTemplate |
configure(ClientCreationContext context)
Configure a
RestTemplate instance and return it for use in the Client. |
public SimpleRestTemplateConfigurator()
HttpURLConnection post-processor.public SimpleRestTemplateConfigurator(HttpConnectionConfigurator configurator)
HttpURLConnection post-processor.configurator - the post-processing logic to use for the HttpURLConnectionpublic SimpleRestTemplateConfigurator(javax.net.ssl.SSLSocketFactory sslSocketFactory)
sslSocketFactory - the socket factory to usepublic SimpleRestTemplateConfigurator(javax.net.ssl.SSLSocketFactory sslSocketFactory,
HttpConnectionConfigurator configurator)
HttpURLConnection post-processor.sslSocketFactory - the socket factory to useconfigurator - the post-processing logic to use for the HttpURLConnectionpublic SimpleRestTemplateConfigurator(javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.HostnameVerifier hostnameVerifier)
Note HttpsURLConnection sets a default hostname verifier, so setting a custom
one is only needed for specific cases.
sslSocketFactory - the socket factory to usehostnameVerifier - the hostname verifier to usepublic SimpleRestTemplateConfigurator(javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.HostnameVerifier hostnameVerifier,
HttpConnectionConfigurator configurator)
HttpURLConnection post-processor.sslSocketFactory - the socket factory to usehostnameVerifier - the hostname verifier to useconfigurator - the post-processing logic to use for the HttpURLConnectionpublic org.springframework.web.client.RestTemplate configure(ClientCreationContext context)
RestTemplateConfiguratorRestTemplate instance and return it for use in the Client.configure in interface RestTemplateConfiguratorcontext - some context during client creationRestTemplate to use