Package io.lettuce.core.cluster
Class PubSubClusterEndpoint<K,V>
- java.lang.Object
-
- io.lettuce.core.protocol.DefaultEndpoint
-
- io.lettuce.core.pubsub.PubSubEndpoint<K,V>
-
- io.lettuce.core.cluster.PubSubClusterEndpoint<K,V>
-
- All Implemented Interfaces:
AsyncCloseable
,AsyncCloseable
,Endpoint
,PushHandler
,RedisChannelWriter
,Closeable
,AutoCloseable
public class PubSubClusterEndpoint<K,V> extends PubSubEndpoint<K,V>
- Author:
- Mark Paluch
-
-
Field Summary
-
Fields inherited from class io.lettuce.core.protocol.DefaultEndpoint
channel
-
-
Constructor Summary
Constructors Constructor Description PubSubClusterEndpoint(ClientOptions clientOptions, ClientResources clientResources)
Initialize a new instance that handles commands from the supplied queue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(RedisClusterPubSubListener<K,V> listener)
Add a newlistener
.RedisClusterPubSubListener<K,V>
getUpstreamListener()
protected void
notifyListeners(PubSubMessage<K,V> output)
void
removeListener(RedisClusterPubSubListener<K,V> listener)
Remove an existinglistener
.void
setNodeMessagePropagation(boolean nodeMessagePropagation)
-
Methods inherited from class io.lettuce.core.pubsub.PubSubEndpoint
addListener, containsViolatingCommands, getChannels, getListeners, getPatterns, hasChannelSubscriptions, hasPatternSubscriptions, isSubscribed, notifyChannelActive, rejectCommand, rejectCommands, removeListener, write, write
-
Methods inherited from class io.lettuce.core.protocol.DefaultEndpoint
addListener, close, closeAsync, disconnect, doExclusive, drainCommands, flushCommands, getClientResources, getId, getProtocolVersion, getPushListeners, initialState, isClosed, logPrefix, notifyChannelInactive, notifyDrainQueuedCommands, notifyException, registerConnectionWatchdog, removeListener, reset, setAutoFlushCommands, setConnectionFacade, writeToBuffer
-
-
-
-
Constructor Detail
-
PubSubClusterEndpoint
public PubSubClusterEndpoint(ClientOptions clientOptions, ClientResources clientResources)
Initialize a new instance that handles commands from the supplied queue.- Parameters:
clientOptions
- client options for this connection, must not benull
clientResources
- client resources for this connection, must not benull
.
-
-
Method Detail
-
addListener
public void addListener(RedisClusterPubSubListener<K,V> listener)
Add a newlistener
.- Parameters:
listener
- the listener, must not benull
.
-
getUpstreamListener
public RedisClusterPubSubListener<K,V> getUpstreamListener()
-
removeListener
public void removeListener(RedisClusterPubSubListener<K,V> listener)
Remove an existinglistener
.- Parameters:
listener
- the listener, must not benull
.
-
setNodeMessagePropagation
public void setNodeMessagePropagation(boolean nodeMessagePropagation)
-
notifyListeners
protected void notifyListeners(PubSubMessage<K,V> output)
- Overrides:
notifyListeners
in classPubSubEndpoint<K,V>
-
-