public class RedisClientBase
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
RedisClientBase.SubscriptionsDispatcher |
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
ALPHA |
protected static java.lang.String |
AUTH |
protected static byte[] |
AUTH_BYTES |
static byte[] |
BY |
private static java.util.Comparator<byte[]> |
BYTES |
static byte[] |
DESC |
private static Command |
DISCARD |
private com.google.common.util.concurrent.ListeningExecutorService |
es |
private static Command |
EXEC |
static byte[] |
GET |
private java.lang.String |
host |
static byte[] |
LIMIT |
private static byte[] |
MESSAGE |
private static Command |
MULTI
Transaction support
|
private boolean |
parseAttempted |
protected java.util.concurrent.atomic.AtomicInteger |
pipelined |
private static byte[] |
PMESSAGE |
private int |
port |
private static byte[] |
PSUBSCRIBE |
private static byte[] |
PUNSUBSCRIBE |
protected RedisProtocol |
redisProtocol |
private java.util.List<ReplyListener> |
replyListeners |
private boolean |
retrying |
static byte[] |
STORE |
private static byte[] |
SUBSCRIBE |
private boolean |
subscribed |
private boolean |
tx |
private java.util.Queue<com.google.common.util.concurrent.SettableFuture<Reply>> |
txReplies |
private static byte[] |
UNSUBSCRIBE |
protected int |
version |
private static java.util.regex.Pattern |
versionMatcher |
static byte[] |
WEIGHTS |
static byte[] |
WITHSCORES |
| Modifier | Constructor and Description |
|---|---|
protected |
RedisClientBase(java.lang.String host,
int port,
java.util.concurrent.ExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ReplyListener replyListener)
Add a reply listener to this client for subscriptions.
|
StatusReply |
auth(java.lang.Object password0)
Authenticate to the server
Connection
|
void |
close() |
private boolean |
connect() |
StatusReply |
discard() |
java.util.concurrent.Future<java.lang.Boolean> |
exec() |
Reply |
execute(java.lang.String name,
Command command) |
RedisProtocol |
getRedisProtocol() |
StatusReply |
multi() |
private void |
parseInfo() |
static int |
parseVersion(java.lang.String value) |
com.google.common.util.concurrent.ListenableFuture<? extends Reply> |
pipeline(java.lang.String name,
Command command) |
void |
psubscribe(java.lang.Object... subscriptions)
Subscribes the client to the specified patterns.
|
void |
punsubscribe(java.lang.Object... subscriptions)
Unsubscribes the client to the specified patterns.
|
boolean |
removeListener(ReplyListener replyListener)
Remove a reply listener from this client.
|
private void |
subscribe() |
void |
subscribe(java.lang.Object... subscriptions)
Subscribes the client to the specified channels.
|
void |
unsubscribe(java.lang.Object... subscriptions)
Unsubscribes the client to the specified channels.
|
private static final java.util.Comparator<byte[]> BYTES
public static final byte[] WEIGHTS
public static final byte[] WITHSCORES
public static final byte[] ALPHA
public static final byte[] LIMIT
public static final byte[] DESC
public static final byte[] BY
public static final byte[] STORE
public static final byte[] GET
private final java.lang.String host
private final int port
private com.google.common.util.concurrent.ListeningExecutorService es
protected RedisProtocol redisProtocol
private static final java.util.regex.Pattern versionMatcher
protected java.util.concurrent.atomic.AtomicInteger pipelined
protected int version
private boolean parseAttempted
private java.util.Queue<com.google.common.util.concurrent.SettableFuture<Reply>> txReplies
private boolean retrying
private static final Command MULTI
private static final Command EXEC
private static final Command DISCARD
private boolean tx
private java.util.List<ReplyListener> replyListeners
private boolean subscribed
private static final byte[] MESSAGE
private static final byte[] PMESSAGE
private static final byte[] SUBSCRIBE
private static final byte[] UNSUBSCRIBE
private static final byte[] PSUBSCRIBE
private static final byte[] PUNSUBSCRIBE
protected static final java.lang.String AUTH
protected static final byte[] AUTH_BYTES
protected RedisClientBase(java.lang.String host,
int port,
java.util.concurrent.ExecutorService executorService)
throws RedisException
RedisExceptionprivate boolean connect()
throws RedisException
RedisExceptionprivate void parseInfo()
public static int parseVersion(java.lang.String value)
public com.google.common.util.concurrent.ListenableFuture<? extends Reply> pipeline(java.lang.String name, Command command) throws RedisException
RedisExceptionpublic Reply execute(java.lang.String name, Command command) throws RedisException
RedisExceptionpublic RedisProtocol getRedisProtocol()
public void close()
throws java.io.IOException
java.io.IOExceptionpublic StatusReply multi()
public StatusReply discard()
public java.util.concurrent.Future<java.lang.Boolean> exec()
public void addListener(ReplyListener replyListener)
public boolean removeListener(ReplyListener replyListener)
public void subscribe(java.lang.Object... subscriptions)
subscriptions - public void psubscribe(java.lang.Object... subscriptions)
subscriptions - public void unsubscribe(java.lang.Object... subscriptions)
subscriptions - public void punsubscribe(java.lang.Object... subscriptions)
subscriptions - private void subscribe()
public StatusReply auth(java.lang.Object password0) throws RedisException
password0 - RedisException