public class TrackingArgs extends Object implements CompositeArgument
TrackingArgs.Builder and chain the method calls: enabled().bcast().
TrackingArgs is a mutable object and instances should be used only once to avoid shared mutable state.
| Modifier and Type | Class and Description |
|---|---|
static class |
TrackingArgs.Builder
Builder entry points for
TrackingArgs. |
| Constructor and Description |
|---|
TrackingArgs() |
| Modifier and Type | Method and Description |
|---|---|
TrackingArgs |
bcast()
Enable tracking in broadcasting mode.
|
<K,V> void |
build(CommandArgs<K,V> args)
Build command arguments and contribute arguments to
CommandArgs. |
TrackingArgs |
enabled(boolean enabled)
Controls whether to enable key tracking for the currently connected client.
|
TrackingArgs |
noloop()
Don't send notifications about keys modified by this connection itself.
|
TrackingArgs |
optin()
When broadcasting is NOT active, normally don't track keys in read only commands, unless they are called immediately
after a CLIENT CACHING yes command.
|
TrackingArgs |
optout()
When broadcasting is NOT active, normally track keys in read only commands, unless they are called immediately after a
CLIENT CACHING no command.
|
TrackingArgs |
prefixes(Charset charset,
String... prefixes)
For broadcasting, register a given key prefix, so that notifications will be provided only for keys starting with this
string.
|
TrackingArgs |
prefixes(String... prefixes)
For broadcasting, register a given key prefix, so that notifications will be provided only for keys starting with this
string.
|
TrackingArgs |
redirect(long clientId)
Send redirection messages to the connection with the specified ID.
|
public TrackingArgs enabled(boolean enabled)
enabled - whether to enable key tracking for the currently connected client.this TrackingArgs.public TrackingArgs redirect(long clientId)
CLIENT ID. If the connection we are redirecting to is terminated, when in RESP3 mode the
connection with tracking enabled will receive tracking-redir-broken push messages in order to signal the condition.clientId - process Id of the client for notification redirection.this TrackingArgs.public TrackingArgs bcast()
this TrackingArgs.public TrackingArgs prefixes(String... prefixes)
prefixes - the key prefixes for broadcasting of change notifications. Encoded using
StandardCharsets.UTF_8.this TrackingArgs.public TrackingArgs prefixes(Charset charset, String... prefixes)
charset - the charset to use for prefixes encoding.prefixes - the key prefixes for broadcasting of change notifications.this TrackingArgs.public TrackingArgs optin()
this TrackingArgs.public TrackingArgs optout()
this TrackingArgs.public TrackingArgs noloop()
this TrackingArgs.public <K,V> void build(CommandArgs<K,V> args)
CompositeArgumentCommandArgs.
Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.
build in interface CompositeArgumentK - Key type.V - Value type.args - the command arguments, must not be null.Copyright © 2021 lettuce.io. All rights reserved.