Package org.springframework.vault.client
Interface VaultClient.Builder
- Enclosing interface:
- VaultClient
public static interface VaultClient.Builder
A mutable builder for creating a
VaultClient.-
Method Summary
Modifier and TypeMethodDescriptionapply(Consumer<VaultClient.Builder> builderConsumer) Apply the givenConsumerto this builder instance.build()Build theVaultClientinstance.clone()Clone thisVaultClient.Builder.configureRestClient(Consumer<RestClient.Builder> restClientBuilderConsumer) Provide a consumer to accessRestClient.Builderwith the possibility to override or augment its configuration.defaultHeader(String header, String... values) Global option to specify a header to be added to every request, if the request does not already contain such a header.default VaultClient.BuilderdefaultNamespace(String namespace) Global option to specify a namespace header to be added to every request, if the request does not already contain such a header.endpoint(VaultEndpoint endpoint) Set the Vault endpoint to use.endpoint(VaultEndpointProvider endpointProvider) Set the Vault endpoint provider to use.requestFactory(ClientHttpRequestFactory requestFactory) Configure theClientHttpRequestFactoryto use.uriBuilderFactory(UriBuilderFactory uriBuilderFactory) Provide a pre-configuredUriBuilderFactoryinstance.
-
Method Details
-
endpoint
Set the Vault endpoint to use.- Parameters:
endpoint- the vault endpoint to use.- Returns:
- this builder.
-
endpoint
Set the Vault endpoint provider to use.- Parameters:
endpointProvider- the vault endpoint provider to use.- Returns:
- this builder.
-
uriBuilderFactory
Provide a pre-configuredUriBuilderFactoryinstance. This is an alternative to, and effectively overrides the following shortcut properties:- Parameters:
uriBuilderFactory- the URI builder factory to use.- Returns:
- this builder.
- See Also:
-
defaultNamespace
Global option to specify a namespace header to be added to every request, if the request does not already contain such a header.- Parameters:
namespace- the namespace header value.- Returns:
- this builder.
-
defaultHeader
Global option to specify a header to be added to every request, if the request does not already contain such a header.- Parameters:
header- the header name.values- the header values.- Returns:
- this builder.
-
requestFactory
Configure theClientHttpRequestFactoryto use. This is useful for plugging in and/or customizing options of the underlying HTTP client library (for example, SSL).If no request factory is specified,
VaultClientuses Apache Http Client, Jetty Http Client if available on the classpath, and defaults to the JDK HttpClient if thejava.net.httpmodule is loaded, or to a simple default otherwise.- Parameters:
requestFactory- the request factory to use.- Returns:
- this builder.
-
configureRestClient
Provide a consumer to accessRestClient.Builderwith the possibility to override or augment its configuration.- Parameters:
restClientBuilderConsumer- the consumer.- Returns:
- this builder.
-
apply
Apply the givenConsumerto this builder instance.This can be useful for applying pre-packaged customizations.
- Parameters:
builderConsumer- the consumer to apply- Returns:
- this builder
-
clone
VaultClient.Builder clone()Clone thisVaultClient.Builder. -
build
VaultClient build()Build theVaultClientinstance.
-