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:
AsyncCloseable
,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>
async
protected RedisCodec<K,V>
codec
protected RedisSentinelReactiveCommands<K,V>
reactive
protected RedisSentinelCommands<K,V>
sync
-
Constructor Summary
Constructors Constructor Description StatefulRedisSentinelConnectionImpl(RedisChannelWriter writer, RedisCodec<K,V> codec, Duration timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RedisSentinelAsyncCommands<K,V>
async()
Returns theRedisSentinelAsyncCommands
API 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.ConnectionState
getConnectionState()
RedisSentinelReactiveCommands<K,V>
reactive()
Returns theRedisSentinelReactiveCommands
API for the current connection.void
setClientName(String clientName)
Deprecated.since 6.0, useRedisSentinelAsyncCommands.clientSetname(Object)
.RedisSentinelCommands<K,V>
sync()
Returns theRedisSentinelCommands
API for the current connection.-
Methods inherited from class io.lettuce.core.RedisChannelHandler
activated, addListener, addListener, close, closeAsync, deactivated, flushCommands, getChannelWriter, getConnectionEvents, getOptions, getResources, getTimeout, isClosed, isOpen, registerCloseables, removeListener, reset, setAutoFlushCommands, setOptions, setTimeout, syncHandler
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.lettuce.core.api.StatefulConnection
addListener, close, closeAsync, flushCommands, getOptions, getResources, getTimeout, isOpen, removeListener, reset, setAutoFlushCommands, setTimeout
-
-
-
-
Field Detail
-
codec
protected final RedisCodec<K,V> codec
-
sync
protected final RedisSentinelCommands<K,V> sync
-
async
protected final RedisSentinelAsyncCommands<K,V> async
-
reactive
protected final RedisSentinelReactiveCommands<K,V> reactive
-
-
Constructor Detail
-
StatefulRedisSentinelConnectionImpl
public StatefulRedisSentinelConnectionImpl(RedisChannelWriter writer, RedisCodec<K,V> codec, Duration timeout)
-
-
Method Detail
-
dispatch
public <T> RedisCommand<K,V,T> dispatch(RedisCommand<K,V,T> command)
Description copied from interface:StatefulConnection
Dispatch 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:
dispatch
in interfaceStatefulConnection<K,V>
- Overrides:
dispatch
in 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:StatefulConnection
Dispatch 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:
dispatch
in interfaceStatefulConnection<K,V>
- Overrides:
dispatch
in classRedisChannelHandler<K,V>
- Parameters:
commands
- the Redis commands.- Returns:
- the written Redis commands.
-
sync
public RedisSentinelCommands<K,V> sync()
Description copied from interface:StatefulRedisSentinelConnection
Returns theRedisSentinelCommands
API for the current connection. Does not create a new connection.- Specified by:
sync
in interfaceStatefulRedisSentinelConnection<K,V>
- Returns:
- the synchronous API for the underlying connection.
-
async
public RedisSentinelAsyncCommands<K,V> async()
Description copied from interface:StatefulRedisSentinelConnection
Returns theRedisSentinelAsyncCommands
API for the current connection. Does not create a new connection.- Specified by:
async
in interfaceStatefulRedisSentinelConnection<K,V>
- Returns:
- the asynchronous API for the underlying connection.
-
reactive
public RedisSentinelReactiveCommands<K,V> reactive()
Description copied from interface:StatefulRedisSentinelConnection
Returns theRedisSentinelReactiveCommands
API for the current connection. Does not create a new connection.- Specified by:
reactive
in interfaceStatefulRedisSentinelConnection<K,V>
- Returns:
- the reactive API for the underlying connection.
-
setClientName
@Deprecated public void setClientName(String clientName)
Deprecated.since 6.0, useRedisSentinelAsyncCommands.clientSetname(Object)
.- Parameters:
clientName
-
-
getConnectionState
public ConnectionState getConnectionState()
-
-