K - Key type.V - Value type.public interface BaseRedisCommands<K,V>
| Modifier and Type | Method and Description |
|---|---|
<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.
|
boolean |
isOpen() |
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()
Instructs Redis to disconnect 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.
|
void |
reset()
Reset the command state.
|
List<Object> |
role()
Return the role of the instance in the context of replication.
|
Long |
waitForReplication(int replicas,
long timeout)
Wait for replication.
|
Long publish(K channel, V message)
channel - the channel type: key.message - the message type: value.List<K> pubsubChannels()
List<K> pubsubChannels(K channel)
channel - the key.Map<K,Long> pubsubNumsub(K... channels)
channels - channel keys.Long pubsubNumpat()
V echo(V msg)
msg - the message type: value.List<Object> role()
String ping()
String readOnly()
String readWrite()
String quit()
StatefulConnection.close() to close connections and
release resources.Long waitForReplication(int replicas, long timeout)
replicas - minimum number of replicas.timeout - timeout in milliseconds.<T> T dispatch(ProtocolKeyword type, CommandOutput<K,V,T> output)
T - response type.type - 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 type.type - the command, must not be null.output - the command output, must not be null.args - the command arguments, must not be null.boolean isOpen()
true if the connection is open (connected and not closed).void reset()
Copyright © 2020 lettuce.io. All rights reserved.