public interface TarantoolClientBuilder extends TarantoolClientConfigurator<TarantoolClientBuilder>
Provides a single entry point for building all types of Tarantool clients.
Modifier and Type | Method and Description |
---|---|
TarantoolClient<TarantoolTuple,TarantoolResult<TarantoolTuple>> |
build()
Build the configured Tarantool client instance.
|
TarantoolClientBuilder |
withAddress(InetSocketAddress socketAddress)
Specify a Tarantool server address.
|
TarantoolClientBuilder |
withAddress(String host)
Specify a single host of a Tarantool server.
|
TarantoolClientBuilder |
withAddress(String host,
int port)
Specify a single host and a port of a Tarantool server.
|
TarantoolClientBuilder |
withAddresses(List<TarantoolServerAddress> addressList)
Specify a list of Tarantool server addresses.
|
TarantoolClientBuilder |
withAddresses(TarantoolServerAddress... address)
Specify one or more Tarantool server addresses.
|
TarantoolClientBuilder |
withAddressProvider(TarantoolClusterAddressProvider addressProvider)
Specify a provider for Tarantool server addresses.
|
TarantoolClientBuilder |
withAuthMechanism(AuthMechanism authMechanism)
Specify authentication mechanism configured on the server.
|
TarantoolClientBuilder |
withConnections(int connections)
Specify the number of connections per one Tarantool server.
|
TarantoolClientBuilder |
withConnectionSelectionStrategy(ConnectionSelectionStrategyFactory connectionSelectionStrategyFactory)
Specify a custom connection selection strategy factory.
|
TarantoolClientBuilder |
withConnectionSelectionStrategy(TarantoolConnectionSelectionStrategyType connectionSelectionStrategyType)
Select a built-in connection selection strategy factory.
|
TarantoolClientBuilder |
withConnectTimeout(int connectTimeout)
Specify a connection timeout.
|
TarantoolClientBuilder |
withCredentials(String user,
String password)
Specify user credentials for password-based authentication in a Tarantool server.
|
TarantoolClientBuilder |
withCredentials(TarantoolCredentials tarantoolCredentials)
Specify user credentials for authentication in a Tarantool server.
|
TarantoolClientBuilder |
withDefaultMessagePackMapperConfiguration(UnaryOperator<MessagePackMapperBuilder> mapperBuilder)
Specify a configuration for mapping between Java objects and MessagePack entities.
|
TarantoolClientBuilder |
withEventLoopThreadsNumber(int eventLoopThreadsNumber)
Specify netty threads number.
|
TarantoolClientBuilder |
withMessagePackMapper(MessagePackMapper mapper)
Specify a mapper between Java objects and MessagePack entities.
|
TarantoolClientBuilder |
withReadTimeout(int readTimeout)
Specify a response reading timeout.
|
TarantoolClientBuilder |
withRequestTimeout(int requestTimeout)
Specify a request timeout.
|
TarantoolClientBuilder |
withSecure(boolean isSecure)
Turn on secure connection or turn off secure connection.
|
TarantoolClientBuilder |
withSslContext(io.netty.handler.ssl.SslContext sslContext)
Specify SslContext with settings for establishing SSL/TLS connection between Tarantool
|
TarantoolClientBuilder |
withTarantoolClientConfig(TarantoolClientConfig config)
Specify a tarantool client config
It overrides previous settings for config
|
withProxyMethodMapping, withProxyMethodMapping, withRetrying, withRetrying, withRetryingByNumberOfAttempts, withRetryingByNumberOfAttempts, withRetryingByNumberOfAttempts, withRetryingByNumberOfAttempts, withRetryingByNumberOfAttempts, withRetryingIndefinitely, withRetryingIndefinitely, withRetryingIndefinitely, withRetryingIndefinitely
TarantoolClientBuilder withAddress(String host)
host
- Tarantool server hostTarantoolClientBuilder
TarantoolClientBuilder withAddress(String host, int port)
host
- Tarantool server hostport
- Tarantool server portTarantoolClientBuilder
TarantoolClientBuilder withAddress(InetSocketAddress socketAddress)
socketAddress
- remote server addressTarantoolClientBuilder
TarantoolClientBuilder withAddresses(TarantoolServerAddress... address)
address
- list of addresses of Tarantool instancesTarantoolClientBuilder
TarantoolClientBuilder withAddresses(List<TarantoolServerAddress> addressList)
addressList
- list of Tarantool instance addressesTarantoolClientBuilder
TarantoolClientBuilder withAddressProvider(TarantoolClusterAddressProvider addressProvider)
addressProvider
- TarantoolClusterAddressProvider
TarantoolClientBuilder
TarantoolClientBuilder withCredentials(TarantoolCredentials tarantoolCredentials)
tarantoolCredentials
- credentials for all Tarantool server instancesTarantoolClientBuilder
TarantoolClientBuilder withCredentials(String user, String password)
user
- user to authenticate withpassword
- password to authenticate withTarantoolClientBuilder
withCredentials(TarantoolCredentials tarantoolCredentials)
TarantoolClientBuilder withAuthMechanism(AuthMechanism authMechanism)
authMechanism
- configured authentication mechanismTarantoolClientBuilder
TarantoolClientBuilder withConnections(int connections)
connections
- the number of connections per one serverTarantoolClientBuilder
TarantoolClientBuilder withDefaultMessagePackMapperConfiguration(UnaryOperator<MessagePackMapperBuilder> mapperBuilder)
This method takes a lambda as an argument, where the mapperBuilder is DefaultMessagePackMapper.Builder
.
DefaultMessagePackMapperFactory
.mapperBuilder
- builder provider instance, e.g. a lambda function taking the builder
for MessagePackMapper
instanceTarantoolClientBuilder
TarantoolClientConfig.setMessagePackMapper(MessagePackMapper)
TarantoolClientBuilder withMessagePackMapper(MessagePackMapper mapper)
DefaultMessagePackMapperFactory
.mapper
- configured MessagePackMapper
instanceTarantoolClientBuilder
TarantoolClientConfig.setMessagePackMapper(MessagePackMapper)
TarantoolClientBuilder withRequestTimeout(int requestTimeout)
requestTimeout
- the timeout for receiving a response from the Tarantool server, in millisecondsTarantoolClientBuilder
TarantoolClientConfig.setRequestTimeout(int)
TarantoolClientBuilder withConnectTimeout(int connectTimeout)
connectTimeout
- the timeout for connecting to the Tarantool server, in millisecondsTarantoolClientBuilder
TarantoolClientConfig.setConnectTimeout(int)
TarantoolClientBuilder withReadTimeout(int readTimeout)
readTimeout
- the timeout for reading the responses from Tarantool server, in millisecondsTarantoolClientBuilder
TarantoolClientConfig.setReadTimeout(int)
TarantoolClientBuilder withSecure(boolean isSecure)
isSecure
- boolean flagTarantoolClientBuilder
TarantoolClientBuilder withConnectionSelectionStrategy(ConnectionSelectionStrategyFactory connectionSelectionStrategyFactory)
connectionSelectionStrategyFactory
- connection selection strategy factory instanceTarantoolClientBuilder
TarantoolClientBuilder withConnectionSelectionStrategy(TarantoolConnectionSelectionStrategyType connectionSelectionStrategyType)
connectionSelectionStrategyType
- built-in connection selection strategy factory typeTarantoolClientBuilder
TarantoolClientBuilder withSslContext(io.netty.handler.ssl.SslContext sslContext)
sslContext
- SslContext
instanceTarantoolClientBuilder
TarantoolClientBuilder withTarantoolClientConfig(TarantoolClientConfig config)
It overrides previous settings for config
config
- tarantool client configTarantoolClientBuilder
TarantoolClientBuilder withEventLoopThreadsNumber(int eventLoopThreadsNumber)
eventLoopThreadsNumber
- number of threadsTarantoolClient<TarantoolTuple,TarantoolResult<TarantoolTuple>> build()
build
in interface TarantoolClientConfigurator<TarantoolClientBuilder>
TarantoolClient
Copyright © 2025 Picodata. All rights reserved.