Interface ClientConfiguration.TerminalClientConfigurationBuilder
- All Known Subinterfaces:
ClientConfiguration.MaybeSecureClientConfigurationBuilder
- Enclosing interface:
- ClientConfiguration
public static interface ClientConfiguration.TerminalClientConfigurationBuilder
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theClientConfiguration
object.withBasicAuth
(String username, String password) Configure the username and password to be sent as a Basic Authentication headerwithClientConfigurer
(ClientConfiguration.ClientConfigurationCallback<?> clientConfigurer) Register aClientConfiguration.ClientConfigurationCallback
to configure the client.withConnectTimeout
(long millis) Configure the milliseconds for the connect-timeout.withConnectTimeout
(Duration timeout) Configure aDuration
connect timeout.withDefaultHeaders
(HttpHeaders defaultHeaders) withHeaders
(Supplier<HttpHeaders> headers) set a supplier for custom headers.withPathPrefix
(String pathPrefix) Configure the path prefix that will be prepended to any HTTP(s) requestswithSocketTimeout
(long millis) Configure the milliseconds for the socket timeout.withSocketTimeout
(Duration timeout) Configure asocket timeout
which is typically applied as SO-timeout/read timeout.
-
Method Details
-
withDefaultHeaders
ClientConfiguration.TerminalClientConfigurationBuilder withDefaultHeaders(HttpHeaders defaultHeaders) - Parameters:
defaultHeaders
- must not be null.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
-
withConnectTimeout
Configure the milliseconds for the connect-timeout.- Parameters:
millis
- the timeout to use.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
- See Also:
-
withConnectTimeout
Configure aDuration
connect timeout.- Parameters:
timeout
- the timeout to use. Must not be null.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
- See Also:
-
Socket.connect(SocketAddress, int)
ChannelOption.CONNECT_TIMEOUT_MILLIS
-
withSocketTimeout
Configure the milliseconds for the socket timeout.- Parameters:
millis
- the timeout to use.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
- See Also:
-
withSocketTimeout
Configure asocket timeout
which is typically applied as SO-timeout/read timeout.- Parameters:
timeout
- the timeout to use. Must not be null.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
- See Also:
-
Socket.setSoTimeout(int)
ReadTimeoutHandler
WriteTimeoutHandler
-
withBasicAuth
ClientConfiguration.TerminalClientConfigurationBuilder withBasicAuth(String username, String password) Configure the username and password to be sent as a Basic Authentication header- Parameters:
username
- the username. Must not be null.password
- the password. Must not be null.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
-
withPathPrefix
Configure the path prefix that will be prepended to any HTTP(s) requests- Parameters:
pathPrefix
- the pathPrefix.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
- Since:
- 4.0
-
withProxy
- Parameters:
proxy
- a proxy formatted as String host:port.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
.
-
withClientConfigurer
ClientConfiguration.TerminalClientConfigurationBuilder withClientConfigurer(ClientConfiguration.ClientConfigurationCallback<?> clientConfigurer) Register aClientConfiguration.ClientConfigurationCallback
to configure the client.- Parameters:
clientConfigurer
- configuration callback, must not be null.- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
. - Since:
- 4.3
-
withHeaders
set a supplier for custom headers. This is invoked for every HTTP request to Elasticsearch to retrieve headers that should be sent with the request. A common use case is passing in authentication headers that may change.
Note: When used in a reactive environment, the calling ofSupplier.get()
function must not do any blocking operations. It may return null.- Parameters:
headers
- supplier function for headers, must not be null- Returns:
- the
ClientConfiguration.TerminalClientConfigurationBuilder
. - Since:
- 4.0
-
build
ClientConfiguration build()Build theClientConfiguration
object.- Returns:
- the
ClientConfiguration
object.
-