K - Key type.V - Value type.public interface BaseRedisConnection<K,V> extends Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection.
|
String |
digest(V script)
Create a SHA1 digest from a Lua script.
|
String |
discard()
Discard all commands issued after MULTI.
|
V |
echo(V msg)
Echo the given string.
|
List<Object> |
exec()
Execute all commands issued after MULTI.
|
boolean |
isOpen() |
String |
multi()
Mark the start of a transaction block.
|
String |
ping()
Ping the server.
|
Long |
publish(K channel,
V message)
Post a message to a channel.
|
List<K> |
pubsubChannels()
Lists the currently *active channels*.
|
List<K> |
pubsubChannels(K channel)
Lists the currently *active channels*.
|
Long |
pubsubNumpat()
Returns the number of subscriptions to patterns.
|
Map<K,Long> |
pubsubNumsub(K... channels)
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.
|
String |
quit()
Close the connection.
|
String |
readOnly()
Switch connection to Read-Only mode when connecting to a cluster.
|
String |
readWrite()
Switch connection to Read-Write mode (default) when connecting to a cluster.
|
List<Object> |
role()
Return the role of the instance in the context of replication.
|
String |
unwatch()
Forget about all watched keys.
|
Long |
waitForReplication(int replicas,
long timeout)
Wait for replication.
|
String |
watch(K... keys)
Watch the given keys to determine execution of the MULTI/EXEC block.
|
Long publish(K channel, V message)
channel - the channel type: keymessage - the message type: valueList<K> pubsubChannels()
List<K> pubsubChannels(K channel)
channel - the keyMap<K,Long> pubsubNumsub(K... channels)
channels - channel keysLong pubsubNumpat()
V echo(V msg)
msg - the message type: valueList<Object> role()
String ping()
String readOnly()
String readWrite()
String quit()
String digest(V script)
script - script contentString discard()
OK.List<Object> exec()
WATCH, EXEC can return aString multi()
OK.String watch(K... keys)
keys - the keyOK.String unwatch()
OK.Long waitForReplication(int replicas, long timeout)
replicas - minimum number of replicastimeout - timeout in millisecondsvoid close()
close in interface AutoCloseableclose in interface Closeableboolean isOpen()
Copyright © 2016. All rights reserved.