Module lettuce.core
Package io.lettuce.core.sentinel
Class StatefulRedisSentinelConnectionImpl<K,V>
java.lang.Object
io.lettuce.core.RedisChannelHandler<K,V>
io.lettuce.core.sentinel.StatefulRedisSentinelConnectionImpl<K,V>
- All Implemented Interfaces:
StatefulConnection<K,V>,AsyncCloseable,ConnectionFacade,StatefulRedisSentinelConnection<K,V>,Closeable,AutoCloseable
public class StatefulRedisSentinelConnectionImpl<K,V> extends RedisChannelHandler<K,V> implements StatefulRedisSentinelConnection<K,V>
- Author:
- Mark Paluch
-
Field Summary
Fields Modifier and Type Field Description protected RedisSentinelAsyncCommands<K,V>asyncprotected RedisCodec<K,V>codecprotected RedisSentinelReactiveCommands<K,V>reactiveprotected RedisSentinelCommands<K,V>sync -
Constructor Summary
Constructors Constructor Description StatefulRedisSentinelConnectionImpl(RedisChannelWriter writer, RedisCodec<K,V> codec, Duration timeout) -
Method Summary
Modifier and Type Method Description RedisSentinelAsyncCommands<K,V>async()Returns theRedisSentinelAsyncCommandsAPI for the current connection.<T> RedisCommand<K,V,T>dispatch(RedisCommand<K,V,T> command)Dispatch a command.Collection<RedisCommand<K,V,?>>dispatch(Collection<? extends RedisCommand<K,V,?>> commands)Dispatch multiple command in a single write on the channel.ConnectionStategetConnectionState()RedisSentinelReactiveCommands<K,V>reactive()Returns theRedisSentinelReactiveCommandsAPI for the current connection.voidsetClientName(String clientName)Deprecated.RedisSentinelCommands<K,V>sync()Returns theRedisSentinelCommandsAPI for the current connection.Methods inherited from class io.lettuce.core.RedisChannelHandler
activated, addListener, close, closeAsync, deactivated, flushCommands, getChannelWriter, getOptions, getResources, getTimeout, isClosed, isOpen, registerCloseables, reset, setAutoFlushCommands, setOptions, setTimeout, syncHandlerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.lettuce.core.api.StatefulConnection
close, closeAsync, flushCommands, getOptions, getResources, getTimeout, isOpen, reset, setAutoFlushCommands, setTimeout
-
Field Details
-
codec
-
sync
-
async
-
reactive
-
-
Constructor Details
-
StatefulRedisSentinelConnectionImpl
public StatefulRedisSentinelConnectionImpl(RedisChannelWriter writer, RedisCodec<K,V> codec, Duration timeout)
-
-
Method Details
-
dispatch
Description copied from interface:StatefulConnectionDispatch a command. Write a command on the channel. The command may be changed/wrapped during write and the written instance is returned after the call. This command does not wait until the command completes and does not guarantee whether the command is executed successfully.- Specified by:
dispatchin interfaceStatefulConnection<K,V>- Overrides:
dispatchin classRedisChannelHandler<K,V>- Type Parameters:
T- result type- Parameters:
command- the Redis command.- Returns:
- the written Redis command.
-
dispatch
public Collection<RedisCommand<K,V,?>> dispatch(Collection<? extends RedisCommand<K,V,?>> commands)Description copied from interface:StatefulConnectionDispatch multiple command in a single write on the channel. The commands may be changed/wrapped during write and the written instance is returned after the call. This command does not wait until the command completes and does not guarantee whether the command is executed successfully.- Specified by:
dispatchin interfaceStatefulConnection<K,V>- Overrides:
dispatchin classRedisChannelHandler<K,V>- Parameters:
commands- the Redis commands.- Returns:
- the written Redis commands.
-
sync
Description copied from interface:StatefulRedisSentinelConnectionReturns theRedisSentinelCommandsAPI for the current connection. Does not create a new connection.- Specified by:
syncin interfaceStatefulRedisSentinelConnection<K,V>- Returns:
- the synchronous API for the underlying connection.
-
async
Description copied from interface:StatefulRedisSentinelConnectionReturns theRedisSentinelAsyncCommandsAPI for the current connection. Does not create a new connection.- Specified by:
asyncin interfaceStatefulRedisSentinelConnection<K,V>- Returns:
- the asynchronous API for the underlying connection.
-
reactive
Description copied from interface:StatefulRedisSentinelConnectionReturns theRedisSentinelReactiveCommandsAPI for the current connection. Does not create a new connection.- Specified by:
reactivein interfaceStatefulRedisSentinelConnection<K,V>- Returns:
- the reactive API for the underlying connection.
-
setClientName
Deprecated.since 6.0, useRedisSentinelAsyncCommands.clientSetname(Object).- Parameters:
clientName-
-
getConnectionState
-
RedisSentinelAsyncCommands.clientSetname(Object).