Package com.rabbitmq.http.client
Class SimpleRestTemplateConfigurator
- java.lang.Object
-
- com.rabbitmq.http.client.SimpleRestTemplateConfigurator
-
- All Implemented Interfaces:
RestTemplateConfigurator
public class SimpleRestTemplateConfigurator extends Object implements RestTemplateConfigurator
RestTemplateConfigurator
that sets anSimpleClientHttpRequestFactory
on aRestTemplate
.Use this to use standard JDK facilities to create requests in the
Client
'sRestTemplate
.- Since:
- 3.6.0
-
-
Constructor Summary
Constructors Constructor Description SimpleRestTemplateConfigurator()
Create an instance with no TLS configuration and noHttpURLConnection
post-processor.SimpleRestTemplateConfigurator(HttpConnectionConfigurator configurator)
Create an instance with aHttpURLConnection
post-processor.SimpleRestTemplateConfigurator(SSLSocketFactory sslSocketFactory)
Create an instance with TLS configuration.SimpleRestTemplateConfigurator(SSLSocketFactory sslSocketFactory, HttpConnectionConfigurator configurator)
Create an instance with TLS configuration and aHttpURLConnection
post-processor.SimpleRestTemplateConfigurator(SSLSocketFactory sslSocketFactory, HostnameVerifier hostnameVerifier)
Create an instance with TLS configuration, including a custom hostname verifier.SimpleRestTemplateConfigurator(SSLSocketFactory sslSocketFactory, HostnameVerifier hostnameVerifier, HttpConnectionConfigurator configurator)
Create an instance with TLS configuration, a custom hostname verifier, and aHttpURLConnection
post-processor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.web.client.RestTemplate
configure(ClientCreationContext context)
Configure aRestTemplate
instance and return it for use in theClient
.
-
-
-
Constructor Detail
-
SimpleRestTemplateConfigurator
public SimpleRestTemplateConfigurator()
Create an instance with no TLS configuration and noHttpURLConnection
post-processor.
-
SimpleRestTemplateConfigurator
public SimpleRestTemplateConfigurator(HttpConnectionConfigurator configurator)
Create an instance with aHttpURLConnection
post-processor.- Parameters:
configurator
- the post-processing logic to use for theHttpURLConnection
-
SimpleRestTemplateConfigurator
public SimpleRestTemplateConfigurator(SSLSocketFactory sslSocketFactory)
Create an instance with TLS configuration.- Parameters:
sslSocketFactory
- the socket factory to use
-
SimpleRestTemplateConfigurator
public SimpleRestTemplateConfigurator(SSLSocketFactory sslSocketFactory, HttpConnectionConfigurator configurator)
Create an instance with TLS configuration and aHttpURLConnection
post-processor.- Parameters:
sslSocketFactory
- the socket factory to useconfigurator
- the post-processing logic to use for theHttpURLConnection
-
SimpleRestTemplateConfigurator
public SimpleRestTemplateConfigurator(SSLSocketFactory sslSocketFactory, HostnameVerifier hostnameVerifier)
Create an instance with TLS configuration, including a custom hostname verifier.Note
HttpsURLConnection
sets a default hostname verifier, so setting a custom one is only needed for specific cases.- Parameters:
sslSocketFactory
- the socket factory to usehostnameVerifier
- the hostname verifier to use
-
SimpleRestTemplateConfigurator
public SimpleRestTemplateConfigurator(SSLSocketFactory sslSocketFactory, HostnameVerifier hostnameVerifier, HttpConnectionConfigurator configurator)
Create an instance with TLS configuration, a custom hostname verifier, and aHttpURLConnection
post-processor.- Parameters:
sslSocketFactory
- the socket factory to usehostnameVerifier
- the hostname verifier to useconfigurator
- the post-processing logic to use for theHttpURLConnection
-
-
Method Detail
-
configure
public org.springframework.web.client.RestTemplate configure(ClientCreationContext context)
Description copied from interface:RestTemplateConfigurator
Configure aRestTemplate
instance and return it for use in theClient
.- Specified by:
configure
in interfaceRestTemplateConfigurator
- Parameters:
context
- some context during client creation- Returns:
- the
RestTemplate
to use
-
-