Class ProxyTarantoolClient<T extends Packable,R extends Collection<T>>
- java.lang.Object
-
- io.tarantool.driver.core.ProxyTarantoolClient<T,R>
-
- Type Parameters:
T- target tuple typeR- target tuple collection type
- All Implemented Interfaces:
TarantoolCallOperations,TarantoolClient<T,R>,TarantoolEvalOperations,AutoCloseable
- Direct Known Subclasses:
ProxyTarantoolTupleClient
public abstract class ProxyTarantoolClient<T extends Packable,R extends Collection<T>> extends Object implements TarantoolClient<T,R>
Client implementation that decorates aTarantoolClientinstance, proxying all CRUD operations through the instance'scallmethod to the proxy functions defined on the Tarantool instance(s).Proxy functions to be called can be specified by overriding the methods of the implemented
ProxyOperationsMappingConfiginterface. These functions must be public API functions available on the Tarantool instance for the connected API user.It is recommended to use this client with the CRUD module ( https://github.com/tarantool/crud) installed on the target Tarantool instance. Be sure that the server instances you are connecting to with this client have the
crud-routerrole enabled.The default implementation of metadata retrieving function is provided by the DDL module (https://github.com/tarantool/ddl). It is available by default on the Cartridge instances. In the other cases, you'll have to expose the DDL module as public API on the target Tarantool instance or use some other implementation of that function.
See https://github.com/tarantool/examples/blob/master/profile-storage/README.md
-
-
Constructor Summary
Constructors Constructor Description ProxyTarantoolClient(TarantoolClient<T,R> decoratedClient, ProxyOperationsMappingConfig mappingConfig)Basic constructor
-
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> entityClass)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> entityClass)Execute a function defined on Tarantool instance.<T> CompletableFuture<TarantoolResult<T>>call(String functionName, List<?> arguments, Class<T> entityClass)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.<T> CompletableFuture<T>callForSingleResult(String functionName, CallResultMapper<T,SingleValueCallResult<T>> resultMapper)Execute a function defined on Tarantool instance.<T> CompletableFuture<T>callForSingleResult(String functionName, ValueConverter<org.msgpack.value.Value,T> valueConverter)Execute a function defined on Tarantool instance.<T> CompletableFuture<T>callForSingleResult(String functionName, Class<T> resultClass)Execute a function defined on Tarantool instance.<T> CompletableFuture<T>callForSingleResult(String functionName, List<?> arguments, CallResultMapper<T,SingleValueCallResult<T>> resultMapper)Execute a function defined on Tarantool instance.<T> CompletableFuture<T>callForSingleResult(String functionName, List<?> arguments, ValueConverter<org.msgpack.value.Value,T> valueConverter)Execute a function defined on Tarantool instance.<T> CompletableFuture<T>callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, CallResultMapper<T,SingleValueCallResult<T>> resultMapper)Execute a function defined on Tarantool instance.<T> CompletableFuture<T>callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, ValueConverter<org.msgpack.value.Value,T> valueConverter)Execute a function defined on Tarantool instance.<T> CompletableFuture<T>callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Class<T> resultClass)Execute a function defined on Tarantool instance.<T> CompletableFuture<T>callForSingleResult(String functionName, List<?> arguments, Class<T> resultClass)Execute a function defined on Tarantool instance.voidclose()CompletableFuture<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.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, TarantoolCallOperations client, ProxyOperationsMappingConfig mappingConfig, TarantoolMetadataOperations metadata, TarantoolSpaceMetadata spaceMetadata)Creates a space API implementation instance for the specified space
-
-
-
Constructor Detail
-
ProxyTarantoolClient
public ProxyTarantoolClient(TarantoolClient<T,R> decoratedClient, ProxyOperationsMappingConfig mappingConfig)
Basic constructor- Parameters:
decoratedClient- configured Tarantool clientmappingConfig- config for proxy operations mapping
-
-
Method Detail
-
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
-
space
public TarantoolSpaceOperations<T,R> space(String spaceName)
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
-
spaceOperations
protected abstract TarantoolSpaceOperations<T,R> spaceOperations(TarantoolClientConfig config, TarantoolCallOperations client, ProxyOperationsMappingConfig mappingConfig, TarantoolMetadataOperations metadata, TarantoolSpaceMetadata spaceMetadata)
Creates a space API implementation instance for the specified space- Parameters:
config- Tarantool client configurationclient- configured client instancemappingConfig- proxy operations mapping configurationmetadata- 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
-
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
-
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
-
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
-
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> entityClass) 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 emptyentityClass- 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> entityClass) 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 entitiesentityClass- 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> entityClass) 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 conversionentityClass- 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 <T> CompletableFuture<T> callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, Class<T> 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:
T- 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 <T> CompletableFuture<T> callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, ValueConverter<org.msgpack.value.Value,T> 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:
T- 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 <T> CompletableFuture<T> callForSingleResult(String functionName, List<?> arguments, MessagePackObjectMapper argumentsMapper, CallResultMapper<T,SingleValueCallResult<T>> 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:
T- 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
-
callForSingleResult
public <T> CompletableFuture<T> callForSingleResult(String functionName, List<?> arguments, Class<T> 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:
T- 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 <T> CompletableFuture<T> callForSingleResult(String functionName, List<?> arguments, ValueConverter<org.msgpack.value.Value,T> 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:
T- 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 <T> CompletableFuture<T> callForSingleResult(String functionName, List<?> arguments, CallResultMapper<T,SingleValueCallResult<T>> 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:
T- 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 <T> CompletableFuture<T> callForSingleResult(String functionName, Class<T> 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:
T- 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 <T> CompletableFuture<T> callForSingleResult(String functionName, ValueConverter<org.msgpack.value.Value,T> 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:
T- 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 <T> CompletableFuture<T> callForSingleResult(String functionName, CallResultMapper<T,SingleValueCallResult<T>> 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:
T- 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
-
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
-
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
-
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
-
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
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-