Skip to content

Commit

Permalink
javajavadocdoc
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Feb 21, 2024
1 parent 4f3f614 commit 88649d9
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public interface ConnectionManagementBaseCommands {
*
* @see <a href="https://redis.io/commands/client-id/">redis.io</a> for details.
* @return The id of the client.
* @example
* <pre>
* long id = client.clientId().get();
* assert id > 0
* </pre>
*/
CompletableFuture<Long> clientId();

Expand All @@ -42,6 +47,11 @@ public interface ConnectionManagementBaseCommands {
* @see <a href="https://redis.io/commands/client-getname/">redis.io</a> for details.
* @return The name of the client connection as a string if a name is set, or <code>null</code> if
* no name is assigned.
* @example
* <pre>
* String clientName = client.clientGetName().get();
* assert clientName != null
* </pre>
*/
CompletableFuture<String> clientGetName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @see <a href="https://redis.io/commands/?group=connection">Connection Management Commands</a>
*/
public interface ConnectionManagementClusterCommands extends ConnectionManagementBaseCommands {
public interface ConnectionManagementClusterCommands {

/**
* Ping the Redis server.
Expand All @@ -34,10 +34,33 @@ public interface ConnectionManagementClusterCommands extends ConnectionManagemen
*/
CompletableFuture<String> ping(String str, Route route);

/** {@inheritDoc} The command will be routed a random node. */
/**
* Get the current connection id.<br>
* The command will be routed a random node.
*
* @see <a href="https://redis.io/commands/client-id/">redis.io</a> for details.
* @return The id of the client.
* @example
* <pre>
* long id = client.clientId().get();
* assert id > 0
* </pre>
*/
CompletableFuture<Long> clientId();

/** {@inheritDoc} The command will be routed a random node. */
/**
* Get the name of the current connection.<br>
* The command will be routed a random node.
*
* @see <a href="https://redis.io/commands/client-getname/">redis.io</a> for details.
* @return The name of the client connection as a string if a name is set, or <code>null</code> if
* no name is assigned.
* @example
* <pre>
* String clientName = client.clientGetName().get();
* assert clientName != null
* </pre>
*/
CompletableFuture<String> clientGetName();

/**
Expand All @@ -49,6 +72,17 @@ public interface ConnectionManagementClusterCommands extends ConnectionManagemen
* @return A {@link ClusterValue} which holds a single value if single node route is used or a
* dictionary where each address is the key and its corresponding node response is the value.
* The value is the id of the client on that node.
* @example
* <pre>
* long id = client.clientId(new SlotIdRoute(...)).get().getSingleValue();
* assert id > 0
* </pre>
*
* @example
* <pre>
* Map&lt;String, Long&gt; idPerNode = client.clientId(ALL_NODES).get().getMultiValue();
* assert idPerNode.get("&lt;node 1 address&gt;") > 0
* </pre>
*/
CompletableFuture<ClusterValue<Long>> clientId(Route route);

Expand All @@ -62,6 +96,17 @@ public interface ConnectionManagementClusterCommands extends ConnectionManagemen
* dictionary where each address is the key and its corresponding node response is the value.
* The value is the name of the client connection as a string if a name is set, or null if no
* name is assigned.
* @example
* <pre>
* String clientName = client.clientGetName(new SlotIdRoute(...)).get().getSingleValue();
* assert clientName != null
* </pre>
*
* @example
* <pre>
* Map&lt;String, String&gt; clientNamePerNode = client.clientGetName(ALL_NODES).get().getMultiValue();
* assert clientNamePerNode.get("&lt;node 1 address&gt;") != null
* </pre>
*/
CompletableFuture<ClusterValue<String>> clientGetName(Route route);
}

0 comments on commit 88649d9

Please sign in to comment.