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.
|
<T> T |
dispatch(ProtocolKeyword type,
CommandOutput<K,V,T> output)
Dispatch a command to the Redis Server.
|
<T> T |
dispatch(ProtocolKeyword type,
CommandOutput<K,V,T> output,
CommandArgs<K,V> args)
Dispatch a command to the Redis Server.
|
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 milliseconds<T> T dispatch(ProtocolKeyword type, CommandOutput<K,V,T> output)
T
- response typetype
- the command, must not be null.output
- the command output, must not be null.<T> T dispatch(ProtocolKeyword type, CommandOutput<K,V,T> output, CommandArgs<K,V> args)
T
- response typetype
- the command, must not be null.output
- the command output, must not be null.args
- the command arguments, must not be null.void close()
close
in interface AutoCloseable
close
in interface Closeable
boolean isOpen()
Copyright © 2016. All rights reserved.