Package org.springframework.vault.client
Class RestTemplateBuilder
java.lang.Object
org.springframework.vault.client.RestTemplateBuilder
Deprecated.
Builder that can be used to configure and create a
RestTemplate.
Provides convenience methods to configure
ClientHttpRequestFactory,
error handlers and
default headers.
By default, the built RestTemplate will attempt to use the most
suitable ClientHttpRequestFactory using
ClientHttpRequestFactoryFactory.create(org.springframework.vault.support.ClientOptions, org.springframework.vault.support.SslConfiguration).- Since:
- 2.2
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Deprecated.Build a newRestTemplate.static RestTemplateBuilderbuilder()Deprecated.Create a newRestTemplateBuilder.static RestTemplateBuilderbuilder(RestClientBuilder restClientBuilder) Deprecated.Create a newRestTemplateBuilderinitialized fromRestClientBuilder.protected RestTemplateDeprecated.Create theRestTemplateto use.customizers(RestTemplateCustomizer... customizer) Deprecated.Add theRestTemplateCustomizersthat should be applied to theRestTemplate.defaultHeader(String name, String value) Deprecated.Add a default header that will be set if not already present on the outgoingHttpRequest.endpoint(VaultEndpoint endpoint) Deprecated.Set theVaultEndpointthat should be used with theRestTemplate.endpointProvider(VaultEndpointProvider provider) Deprecated.Set theVaultEndpointProviderthat should be used with theRestTemplate.errorHandler(ResponseErrorHandler errorHandler) Deprecated.Set theResponseErrorHandlerthat should be used with theRestTemplate.requestCustomizers(RestTemplateRequestCustomizer<?>... requestCustomizers) Deprecated.Add theRestTemplateRequestCustomizersthat should be applied to theClientHttpRequest.requestFactory(Supplier<ClientHttpRequestFactory> requestFactory) Deprecated.Set theSupplierofClientHttpRequestFactorythat should be called each time webuild()a newRestTemplateinstance.requestFactory(ClientHttpRequestFactory requestFactory) Deprecated.Set theClientHttpRequestFactorythat should be used with theRestTemplate.
-
Method Details
-
builder
Deprecated.Create a newRestTemplateBuilder.- Returns:
- a new
RestTemplateBuilder.
-
builder
Deprecated.Create a newRestTemplateBuilderinitialized fromRestClientBuilder.- Returns:
- a new
RestTemplateBuilder. - Since:
- 4.0
-
endpoint
Deprecated.Set theVaultEndpointthat should be used with theRestTemplate.- Parameters:
endpoint- theVaultEndpointprovider.- Returns:
- this builder.
-
endpointProvider
Deprecated.Set theVaultEndpointProviderthat should be used with theRestTemplate.- Parameters:
provider- theVaultEndpointprovider.- Returns:
- this builder.
-
requestFactory
Deprecated.Set theClientHttpRequestFactorythat should be used with theRestTemplate.- Parameters:
requestFactory- the request factory.- Returns:
- this builder.
-
requestFactory
Deprecated.Set theSupplierofClientHttpRequestFactorythat should be called each time webuild()a newRestTemplateinstance.- Parameters:
requestFactory- the supplier for the request factory.- Returns:
- this builder.
-
errorHandler
Deprecated.Set theResponseErrorHandlerthat should be used with theRestTemplate.- Parameters:
errorHandler- the error handler to use.- Returns:
- this builder.
-
defaultHeader
Deprecated.Add a default header that will be set if not already present on the outgoingHttpRequest.- Parameters:
name- the name of the header.value- the header value.- Returns:
- this builder.
-
customizers
Deprecated.Add theRestTemplateCustomizersthat should be applied to theRestTemplate. Customizers are applied in the order that they were added.- Parameters:
customizer- the template customizers to add.- Returns:
- this builder.
-
requestCustomizers
public RestTemplateBuilder requestCustomizers(RestTemplateRequestCustomizer<?>... requestCustomizers) Deprecated.Add theRestTemplateRequestCustomizersthat should be applied to theClientHttpRequest. Customizers are applied in the order that they were added.- Parameters:
requestCustomizers- the request customizers to add.- Returns:
- this builder.
-
build
Deprecated.Build a newRestTemplate.VaultEndpointmust be set. Applies alsoResponseErrorHandlerandRestTemplateCustomizerif configured.- Returns:
- a new
RestTemplate.
-
createTemplate
Deprecated.Create theRestTemplateto use.- Returns:
- the
RestTemplateto use.
-
VaultClientCustomizerorRestClientCustomizerinstead.