Spring Data Key-Value

org.springframework.data.keyvalue.redis.connection
Interface Subscription


public interface Subscription

Subscription for Redis channels.

Author:
Costin Leau

Method Summary
 Collection<byte[]> getChannels()
          Returns the (named) channels for this subscription.
 MessageListener getListener()
          Returns the listener used for this subscription.
 Collection<byte[]> getPatterns()
          Returns the channel patters for this subscription.
 boolean isAlive()
          Indicates whether this subscription is still 'alive' or not.
 void pSubscribe(byte[]... patterns)
          Adds the given channel patterns to the current subscription.
 void pUnsubscribe()
          Cancels the subscription for all channels matched by patterns.
 void pUnsubscribe(byte[]... patterns)
          Cancels the subscription for all channels matching the given patterns.
 void subscribe(byte[]... channels)
          Adds the given channels to the current subscription.
 void unsubscribe()
          Cancels the current subscription for all channels given by name.
 void unsubscribe(byte[]... channels)
          Cancels the current subscription for all given channels.
 

Method Detail

subscribe

void subscribe(byte[]... channels)
Adds the given channels to the current subscription.

Parameters:
channels - channel names

pSubscribe

void pSubscribe(byte[]... patterns)
Adds the given channel patterns to the current subscription.

Parameters:
patterns - channel patterns

unsubscribe

void unsubscribe()
Cancels the current subscription for all channels given by name.


unsubscribe

void unsubscribe(byte[]... channels)
Cancels the current subscription for all given channels.

Parameters:
channels - channel names

pUnsubscribe

void pUnsubscribe()
Cancels the subscription for all channels matched by patterns.


pUnsubscribe

void pUnsubscribe(byte[]... patterns)
Cancels the subscription for all channels matching the given patterns.

Parameters:
patterns -

getChannels

Collection<byte[]> getChannels()
Returns the (named) channels for this subscription.

Returns:
collection of named channels

getPatterns

Collection<byte[]> getPatterns()
Returns the channel patters for this subscription.

Returns:
collection of channel patterns

getListener

MessageListener getListener()
Returns the listener used for this subscription.

Returns:
the listener used for this subscription.

isAlive

boolean isAlive()
Indicates whether this subscription is still 'alive' or not.

Returns:
true if the subscription still applies, false otherwise.

Spring Data Key-Value

Copyright © 2010-2011 SpringSource. All Rights Reserved.