Package io.tarantool.driver.core
Class AbstractTarantoolClient<T extends Packable,R extends Collection<T>>
- java.lang.Object
-
- io.tarantool.driver.core.AbstractTarantoolClient<T,R>
-
- Type Parameters:
T- target tuple typeR- target tuple collection type
- All Implemented Interfaces:
TarantoolCallOperations,TarantoolClient<T,R>,TarantoolEvalOperations,AutoCloseable
- Direct Known Subclasses:
ClusterTarantoolClient
public abstract class AbstractTarantoolClient<T extends Packable,R extends Collection<T>> extends Object implements TarantoolClient<T,R>
Basic Tarantool client implementation. Subclasses must provide the connection manager.
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractTarantoolClient(TarantoolClientConfig config)Create a client.protectedAbstractTarantoolClient(TarantoolClientConfig config, ConnectionSelectionStrategyFactory selectionStrategyFactory, TarantoolConnectionListeners listeners)Deprecated.AbstractTarantoolClient(TarantoolClientConfig config, TarantoolConnectionListeners listeners)Create a client, specifying the connection established event listeners.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CompletableFuture<List<?>>call(String functionName)Execute a function defined on Tarantool instance.<T> CompletableFuture<TarantoolResult<T>>call(String functionName, CallResultMapper<TarantoolResult<T>,SingleValueCallResult<TarantoolResult<T>>> resultMapper)Execute a function defined on Tarantool instance.<T> CompletableFuture<TarantoolResult<T>>call(String functionName, Class<T> tupleClass)Execute a function defined on Tarantool instance.CompletableFuture<List<?>>call(String functionName, Object... arguments)Execute a function defined on Tarantool instance, The value mapper specified in the client configuration will be used for converting the result values from MessagePack entities to objects.CompletableFuture<List<?>>call(String functionName, List<?> arguments)Execute a function defined on Tarantool instance.<T> CompletableFuture<TarantoolResult<T>>call(String functionName, List<?> arguments, CallResultMapper<TarantoolResult<T>,SingleValueCallResult<TarantoolResult<T>>> resultMapper)Execute a function defined on Tarantool instance.CompletableFuture<List<?>>call(String functionName, List<?> arguments, MessagePackMapper mapper)Execute a function defined on Tarantool instance<T> CompletableFuture<TarantoolResult<T>>call(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, CallResultMapper<TarantoolResult<T>,SingleValueCallResult<TarantoolResult<T>>> resultMapper)Execute a function defined on Tarantool instance.<T> CompletableFuture<TarantoolResult<T>>call(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Class<T> tupleClass)Execute a function defined on Tarantool instance.<T> CompletableFuture<TarantoolResult<T>>call(String functionName, List<?> arguments, Class<T> tupleClass)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, CallResultMapper<R,MultiValueCallResult<T,R>> resultMapper)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, Supplier<R> resultContainerSupplier, ValueConverter<org.msgpack.value.Value,T> valueConverter)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, Supplier<R> resultContainerSupplier, Class<T> resultClass)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, List<?> arguments, CallResultMapper<R,MultiValueCallResult<T,R>> resultMapper)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, CallResultMapper<R,MultiValueCallResult<T,R>> resultMapper)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Supplier<R> resultContainerSupplier, ValueConverter<org.msgpack.value.Value,T> valueConverter)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Supplier<R> resultContainerSupplier, Class<T> resultClass)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, List<?> arguments, Supplier<R> resultContainerSupplier, ValueConverter<org.msgpack.value.Value,T> valueConverter)Execute a function defined on Tarantool instance.<T,R extends List<T>>
CompletableFuture<R>callForMultiResult(String functionName, List<?> arguments, Supplier<R> resultContainerSupplier, Class<T> resultClass)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, CallResultMapper<S,SingleValueCallResult<S>> resultMapper)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, ValueConverter<org.msgpack.value.Value,S> valueConverter)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, Class<S> resultClass)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, List<?> arguments, CallResultMapper<S,SingleValueCallResult<S>> resultMapper)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, List<?> arguments, ValueConverter<org.msgpack.value.Value,S> valueConverter)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, CallResultMapper<S,SingleValueCallResult<S>> resultMapper)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, ValueConverter<org.msgpack.value.Value,S> valueConverter)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Class<S> resultClass)Execute a function defined on Tarantool instance.<S> CompletableFuture<S>callForSingleResult(String functionName, List<?> arguments, Class<S> resultClass)Execute a function defined on Tarantool instance.voidclose()protected abstract TarantoolConnectionManagerconnectionManager(TarantoolClientConfig config, TarantoolConnectionFactory connectionFactory, TarantoolConnectionListeners listeners)Provides a connection manager for Tarantool server connectionsCompletableFuture<List<?>>eval(String expression)Execute a Lua expression in the Tarantool instance.CompletableFuture<List<?>>eval(String expression, MessagePackValueMapper resultMapper)Execute a Lua expression in the Tarantool instance.CompletableFuture<List<?>>eval(String expression, List<?> arguments)Execute a Lua expression in the Tarantool instance.CompletableFuture<List<?>>eval(String expression, List<?> arguments, MessagePackObjectMapper argumentsMapper, MessagePackValueMapper resultMapper)Execute a Lua expression in the Tarantool instance.CompletableFuture<List<?>>eval(String expression, List<?> arguments, MessagePackValueMapper resultMapper)Execute a Lua expression in the Tarantool instance.protected io.netty.bootstrap.BootstrapgetBootstrap()TarantoolClientConfiggetConfig()Get the Tarantool client config passed to this clientTarantoolConnectionListenersgetConnectionListeners()Get collection of connection listeners.ResultMapperFactoryFactorygetResultMapperFactoryFactory()Get the default factory for result mapper factory instancesTarantoolVersiongetVersion()Get the Tarantool server versionTarantoolMetadataOperationsmetadata()Provides operations for Tarantool spaces and indexes metadataTarantoolMetadataProvidermetadataProvider()Provides implementation of retrieving the metadata for spaces and instances from Tarantool serversbooleanrefresh()Starts the process of establishing lacking connections to each hostTarantoolSpaceOperations<T,R>space(int spaceId)Provides CRUD and other operations for a Tarantool spaceTarantoolSpaceOperations<T,R>space(String spaceName)Provides CRUD and other operations for a Tarantool spaceprotected abstract TarantoolSpaceOperations<T,R>spaceOperations(TarantoolClientConfig config, TarantoolConnectionManager connectionManager, TarantoolMetadataOperations metadata, TarantoolSpaceMetadata spaceMetadata)Creates a space API implementation instance for the specified space
-
-
-
Constructor Detail
-
AbstractTarantoolClient
public AbstractTarantoolClient(TarantoolClientConfig config)
Create a client.- Parameters:
config- the client configuration- See Also:
TarantoolClientConfig
-
AbstractTarantoolClient
protected AbstractTarantoolClient(TarantoolClientConfig config, ConnectionSelectionStrategyFactory selectionStrategyFactory, TarantoolConnectionListeners listeners)
Deprecated.Create a client, specifying the connection established event listeners.- Parameters:
config- the client configurationselectionStrategyFactory- instantiates strategies which provide the algorithm of selecting connections from the connection pool for performing the next requestlisteners- connection established event listeners- See Also:
TarantoolClientConfig
-
AbstractTarantoolClient
public AbstractTarantoolClient(TarantoolClientConfig config, TarantoolConnectionListeners listeners)
Create a client, specifying the connection established event listeners.- Parameters:
config- the client configurationlisteners- connection established event listeners- See Also:
TarantoolClientConfig
-
-
Method Detail
-
connectionManager
protected abstract TarantoolConnectionManager connectionManager(TarantoolClientConfig config, TarantoolConnectionFactory connectionFactory, TarantoolConnectionListeners listeners)
Provides a connection manager for Tarantool server connections- Parameters:
config- contains Tarantool client configuration optionsconnectionFactory- provides helper methods for connection instantiationlisteners- listeners which will be invoked once all connections are established- Returns:
- connection manager
-
refresh
public boolean refresh()
Description copied from interface:TarantoolClientStarts the process of establishing lacking connections to each host- Specified by:
refreshin interfaceTarantoolClient<T extends Packable,R extends Collection<T>>- Returns:
- returns true if the establishing process has been started, else false
-
getVersion
public TarantoolVersion getVersion() throws TarantoolClientException
Description copied from interface:TarantoolClientGet the Tarantool server version- Specified by:
getVersionin interfaceTarantoolClient<T extends Packable,R extends Collection<T>>- Returns:
TarantoolVersion- Throws:
TarantoolClientException- if the client is not connected
-
space
public TarantoolSpaceOperations<T,R> space(String spaceName) throws TarantoolClientException
Description copied from interface:TarantoolClientProvides CRUD and other operations for a Tarantool space- Specified by:
spacein interfaceTarantoolClient<T extends Packable,R extends Collection<T>>- Parameters:
spaceName- name of the space, must not be null or empty- Returns:
- Tarantool space operations interface
- Throws:
TarantoolClientException- if the client is not connected
-
space
public TarantoolSpaceOperations<T,R> space(int spaceId) throws TarantoolClientException
Description copied from interface:TarantoolClientProvides CRUD and other operations for a Tarantool space- Specified by:
spacein interfaceTarantoolClient<T extends Packable,R extends Collection<T>>- Parameters:
spaceId- ID of the space, must be greater than 0- Returns:
- Tarantool space operations implementation
- Throws:
TarantoolClientException- if the client is not connected
-
spaceOperations
protected abstract TarantoolSpaceOperations<T,R> spaceOperations(TarantoolClientConfig config, TarantoolConnectionManager connectionManager, TarantoolMetadataOperations metadata, TarantoolSpaceMetadata spaceMetadata)
Creates a space API implementation instance for the specified space- Parameters:
config- Tarantool client configurationconnectionManager- configured internal connection managermetadata- metadata operationsspaceMetadata- current space metadata- Returns:
- space API implementation instance
-
metadata
public TarantoolMetadataOperations metadata() throws TarantoolClientException
Description copied from interface:TarantoolClientProvides operations for Tarantool spaces and indexes metadata- Specified by:
metadatain interfaceTarantoolClient<T extends Packable,R extends Collection<T>>- Returns:
- Tarantool metadata operations implementation
- Throws:
TarantoolClientException- if the client is not connected
-
metadataProvider
public TarantoolMetadataProvider metadataProvider()
Description copied from interface:TarantoolClientProvides implementation of retrieving the metadata for spaces and instances from Tarantool servers- Specified by:
metadataProviderin interfaceTarantoolClient<T extends Packable,R extends Collection<T>>- Returns:
- metadata provider instance
-
call
public CompletableFuture<List<?>> call(String functionName) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The value mapper specified in the client configuration will be used for converting the result values from MessagePack entities to objects. TODO example function call- Specified by:
callin interfaceTarantoolCallOperations- Parameters:
functionName- function name, must not be null or empty- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
call
public CompletableFuture<List<?>> call(String functionName, Object... arguments) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance, The value mapper specified in the client configuration will be used for converting the result values from MessagePack entities to objects.- Specified by:
callin interfaceTarantoolCallOperations- Parameters:
functionName- function name, must not be null or emptyarguments- vararg array of function arguments. The object mapper specified in the client configuration will be used for arguments conversion to MessagePack entities- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
call
public CompletableFuture<List<?>> call(String functionName, List<?> arguments) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The value mapper specified in the client configuration will be used for converting the result values from MessagePack entities to objects.- Specified by:
callin interfaceTarantoolCallOperations- Parameters:
functionName- function name, must not be null or emptyarguments- list of function arguments. The object mapper specified in the client configuration will be used for arguments conversion to MessagePack entities- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
call
public CompletableFuture<List<?>> call(String functionName, List<?> arguments, MessagePackMapper mapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance- Specified by:
callin interfaceTarantoolCallOperations- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsmapper- mapper for arguments object-to-MessagePack entity conversion and result values conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected
-
call
public <T> CompletableFuture<TarantoolResult<T>> call(String functionName, Class<T> tupleClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The call result is interpreted as an array of tuples. The value mapper specified in the client configuration will be used for converting the result values from MessagePack arrays to the specified entity type.- Specified by:
callin interfaceTarantoolCallOperations- Type Parameters:
T- desired function call result type- Parameters:
functionName- function name, must not be null or emptytupleClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
call
public <T> CompletableFuture<TarantoolResult<T>> call(String functionName, CallResultMapper<TarantoolResult<T>,SingleValueCallResult<TarantoolResult<T>>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The call result is interpreted as an array of tuples.- Specified by:
callin interfaceTarantoolCallOperations- Type Parameters:
T- desired function call result type- Parameters:
functionName- function name, must not be null or emptyresultMapper- mapper for result value MessagePack entity-to-object conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
call
public <T> CompletableFuture<TarantoolResult<T>> call(String functionName, List<?> arguments, Class<T> tupleClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The call result is interpreted as an array of tuples. The value mapper specified in the client configuration will be used for converting the result values from MessagePack arrays to the specified entity type.- Specified by:
callin interfaceTarantoolCallOperations- Type Parameters:
T- desired function call result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function arguments. The object mapper specified in the client configuration will be used for arguments conversion to MessagePack entitiestupleClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
call
public <T> CompletableFuture<TarantoolResult<T>> call(String functionName, List<?> arguments, CallResultMapper<TarantoolResult<T>,SingleValueCallResult<TarantoolResult<T>>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The call result is interpreted as an array of tuples.- Specified by:
callin interfaceTarantoolCallOperations- Type Parameters:
T- desired function call result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function arguments. The object mapper specified in the client configuration will be used for arguments conversion to MessagePack entitiesresultMapper- mapper for result value MessagePack entity-to-object conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
call
public <T> CompletableFuture<TarantoolResult<T>> call(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Class<T> tupleClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The call result is interpreted as an array of tuples. The value mapper specified in the client configuration will be used for converting the result values from MessagePack arrays to the specified entity type.- Specified by:
callin interfaceTarantoolCallOperations- Type Parameters:
T- desired function call result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversiontupleClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
call
public <T> CompletableFuture<TarantoolResult<T>> call(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, CallResultMapper<TarantoolResult<T>,SingleValueCallResult<TarantoolResult<T>>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The call result is interpreted as an array of tuples.- Specified by:
callin interfaceTarantoolCallOperations- Type Parameters:
T- desired function call result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversionresultMapper- mapper for result value MessagePack entity-to-object conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, List<?> arguments, Class<S> resultClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsresultClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, List<?> arguments, ValueConverter<org.msgpack.value.Value,S> valueConverter) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsvalueConverter- MessagePack value to entity converter for each result item- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, List<?> arguments, CallResultMapper<S,SingleValueCallResult<S>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsresultMapper- mapper for result conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, Class<S> resultClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyresultClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, ValueConverter<org.msgpack.value.Value,S> valueConverter) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyvalueConverter- MessagePack value to entity converter for each result item- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, CallResultMapper<S,SingleValueCallResult<S>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyresultMapper- mapper for result conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Class<S> resultClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversionresultClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, ValueConverter<org.msgpack.value.Value,S> valueConverter) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversionvalueConverter- MessagePack value to entity converter for each result item- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForSingleResult
public <S> CompletableFuture<S> callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, CallResultMapper<S,SingleValueCallResult<S>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. The first item of the call result will be interpreted as a value, and the second -- as an error- Specified by:
callForSingleResultin interfaceTarantoolCallOperations- Type Parameters:
S- target result content type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversionresultMapper- mapper for result conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, List<?> arguments, Supplier<R> resultContainerSupplier, Class<T> resultClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsresultContainerSupplier- supplier function for new empty result collectionresultClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, List<?> arguments, Supplier<R> resultContainerSupplier, ValueConverter<org.msgpack.value.Value,T> valueConverter) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsresultContainerSupplier- supplier function for new empty result collectionvalueConverter- MessagePack value to entity converter for each result item- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, List<?> arguments, CallResultMapper<R,MultiValueCallResult<T,R>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsresultMapper- mapper for result conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, Supplier<R> resultContainerSupplier, Class<T> resultClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyresultContainerSupplier- supplier function for new empty result collectionresultClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, Supplier<R> resultContainerSupplier, ValueConverter<org.msgpack.value.Value,T> valueConverter) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyresultContainerSupplier- supplier function for new empty result collectionvalueConverter- MessagePack value to entity converter for each result item- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, CallResultMapper<R,MultiValueCallResult<T,R>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyresultMapper- mapper for result conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Supplier<R> resultContainerSupplier, Class<T> resultClass) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversionresultContainerSupplier- supplier function for new empty result collectionresultClass- target result entity class- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Supplier<R> resultContainerSupplier, ValueConverter<org.msgpack.value.Value,T> valueConverter) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversionresultContainerSupplier- supplier function for new empty result collectionvalueConverter- MessagePack value to entity converter for each result item- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
callForMultiResult
public <T,R extends List<T>> CompletableFuture<R> callForMultiResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, CallResultMapper<R,MultiValueCallResult<T,R>> resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolCallOperationsExecute a function defined on Tarantool instance. All multi-return result items will be put into a list- Specified by:
callForMultiResultin interfaceTarantoolCallOperations- Type Parameters:
T- target result content typeR- target result type- Parameters:
functionName- function name, must not be null or emptyarguments- list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversionresultMapper- mapper for result conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected or some other error occurred
-
eval
public CompletableFuture<List<?>> eval(String expression) throws TarantoolClientException
Description copied from interface:TarantoolEvalOperationsExecute a Lua expression in the Tarantool instance. If a result is expected, the expression must start with keywordreturn. The value mapper specified in the client configuration will be used for converting the result values from MessagePack entities to objects.- Specified by:
evalin interfaceTarantoolEvalOperations- Parameters:
expression- lua expression, must not be null or empty- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected
-
eval
public CompletableFuture<List<?>> eval(String expression, List<?> arguments) throws TarantoolClientException
Description copied from interface:TarantoolEvalOperationsExecute a Lua expression in the Tarantool instance. If a result is expected, the expression must start with keywordreturn. The value mapper specified in the client configuration will be used for converting the result values from MessagePack entities to objects.- Specified by:
evalin interfaceTarantoolEvalOperations- Parameters:
expression- lua expression, must not be null or emptyarguments- the list of function arguments. The object mapper specified in the client configuration will be used for arguments conversion to MessagePack entities- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected
-
eval
public CompletableFuture<List<?>> eval(String expression, MessagePackValueMapper resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolEvalOperationsExecute a Lua expression in the Tarantool instance. If a result is expected, the expression must start with keywordreturn.- Specified by:
evalin interfaceTarantoolEvalOperations- Parameters:
expression- lua expression, must not be null or emptyresultMapper- mapper for result value MessagePack entity-to-object conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected
-
eval
public CompletableFuture<List<?>> eval(String expression, List<?> arguments, MessagePackValueMapper resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolEvalOperationsExecute a Lua expression in the Tarantool instance. If a result is expected, the expression must start with keywordreturn.- Specified by:
evalin interfaceTarantoolEvalOperations- Parameters:
expression- lua expression, must not be null or emptyarguments- the list of function arguments. The object mapper specified in the client configuration will be used for arguments conversion to MessagePack entitiesresultMapper- mapper for result value MessagePack entity-to-object conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected
-
eval
public CompletableFuture<List<?>> eval(String expression, List<?> arguments, MessagePackObjectMapper argumentsMapper, MessagePackValueMapper resultMapper) throws TarantoolClientException
Description copied from interface:TarantoolEvalOperationsExecute a Lua expression in the Tarantool instance. If a result is expected, the expression must start with keywordreturn.- Specified by:
evalin interfaceTarantoolEvalOperations- Parameters:
expression- lua expression, must not be null or emptyarguments- the list of function argumentsargumentsMapper- mapper for arguments object-to-MessagePack entity conversionresultMapper- mapper for result value MessagePack entity-to-object conversion- Returns:
- some result
- Throws:
TarantoolClientException- if the client is not connected
-
getConfig
public TarantoolClientConfig getConfig()
Description copied from interface:TarantoolClientGet the Tarantool client config passed to this client- Specified by:
getConfigin interfaceTarantoolClient<T extends Packable,R extends Collection<T>>- Returns:
TarantoolClientConfiginstance
-
getBootstrap
protected io.netty.bootstrap.Bootstrap getBootstrap()
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getConnectionListeners
public TarantoolConnectionListeners getConnectionListeners()
Description copied from interface:TarantoolClientGet collection of connection listeners. Used for adding new listeners, removing listeners or examining the collection- Specified by:
getConnectionListenersin interfaceTarantoolClient<T extends Packable,R extends Collection<T>>- Returns:
- connection listeners
-
getResultMapperFactoryFactory
public ResultMapperFactoryFactory getResultMapperFactoryFactory()
Description copied from interface:TarantoolCallOperationsGet the default factory for result mapper factory instances- Specified by:
getResultMapperFactoryFactoryin interfaceTarantoolCallOperations- Returns:
- result mapper factory instances factory instance
-
-