diff --git a/java/client/src/main/java/glide/api/commands/ConnectionManagementClusterCommands.java b/java/client/src/main/java/glide/api/commands/ConnectionManagementClusterCommands.java index 3179b22837..f19ea2db92 100644 --- a/java/client/src/main/java/glide/api/commands/ConnectionManagementClusterCommands.java +++ b/java/client/src/main/java/glide/api/commands/ConnectionManagementClusterCommands.java @@ -17,6 +17,11 @@ public interface ConnectionManagementClusterCommands { * * @see redis.io for details. * @return String with "PONG". + * @example + *
{@code
+     * String payload = clusterClient.ping().get();
+     * assert payload.equals("PONG");
+     * }
*/ CompletableFuture ping(); @@ -26,6 +31,11 @@ public interface ConnectionManagementClusterCommands { * @see redis.io for details. * @param message The server will respond with a copy of the message. * @return String with a copy of the argument message. + * @example + *
{@code
+     * String payload = clusterClient.ping("GLIDE").get();
+     * assert payload.equals("GLIDE");
+     * }
*/ CompletableFuture ping(String message); @@ -33,9 +43,14 @@ public interface ConnectionManagementClusterCommands { * Ping the Redis server. * * @see redis.io for details. - * @param route Routing configuration for the command. Client will route the command to the nodes - * defined. + * @param route Specifies the routing configuration for the command. The client will route the + * command to the defined nodes. * @return String with "PONG". + * @example + *
{@code
+     * String payload = clusterClient.ping(ALL_NODES).get();
+     * assert payload.equals("PONG");
+     * }
*/ CompletableFuture ping(Route route); @@ -44,9 +59,14 @@ public interface ConnectionManagementClusterCommands { * * @see redis.io for details. * @param message The ping argument that will be returned. - * @param route Routing configuration for the command. Client will route the command to the nodes - * defined. + * @param route Specifies the routing configuration for the command. The client will route the + * command to the defined nodes. * @return String with a copy of the argument message. + * @example + *
{@code
+     * String payload = clusterClient.ping("GLIDE", RANDOM).get();
+     * assert payload.equals("GLIDE");
+     * }
*/ CompletableFuture ping(String message, Route route); @@ -68,8 +88,8 @@ public interface ConnectionManagementClusterCommands { * Gets the current connection id. * * @see redis.io for details. - * @param route Routing configuration for the command. Client will route the command to the nodes - * defined. + * @param route Specifies the routing configuration for the command. The client will route the + * command to the defined nodes. * @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. @@ -79,7 +99,7 @@ public interface ConnectionManagementClusterCommands { * assert id > 0; * * Map idPerNode = client.clientId(ALL_NODES).get().getMultiValue(); - * assert idPerNode.get("") > 0; + * assert idPerNode.get("node1.example.com:6379") > 0; * */ CompletableFuture> clientId(Route route); @@ -103,8 +123,8 @@ public interface ConnectionManagementClusterCommands { * Gets the name of the current connection. * * @see redis.io for details. - * @param route Routing configuration for the command. Client will route the command to the nodes - * defined. + * @param route Specifies the routing configuration for the command. The client will route the + * command to the defined nodes. * @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 name of the client connection as a string if a name is set, or null if no @@ -115,7 +135,7 @@ public interface ConnectionManagementClusterCommands { * assert clientName != null; * * Map clientNamePerNode = client.clientGetName(ALL_NODES).get().getMultiValue(); - * assert clientNamePerNode.get("") != null + * assert clientNamePerNode.get("node1.example.com:6379") != null; * } */ CompletableFuture> clientGetName(Route route); diff --git a/java/client/src/main/java/glide/api/commands/ConnectionManagementCommands.java b/java/client/src/main/java/glide/api/commands/ConnectionManagementCommands.java index 064fce4733..6bb0547388 100644 --- a/java/client/src/main/java/glide/api/commands/ConnectionManagementCommands.java +++ b/java/client/src/main/java/glide/api/commands/ConnectionManagementCommands.java @@ -15,6 +15,11 @@ public interface ConnectionManagementCommands { * * @see redis.io for details. * @return String with "PONG". + * @example + *
{@code
+     * String payload = client.ping().get();
+     * assert payload.equals("PONG");
+     * }
*/ CompletableFuture ping(); @@ -24,6 +29,11 @@ public interface ConnectionManagementCommands { * @see redis.io for details. * @param message The server will respond with a copy of the message. * @return String with a copy of the argument message. + * @example + *
{@code
+     * String payload = client.ping("GLIDE").get();
+     * assert payload.equals("GLIDE");
+     * }
*/ CompletableFuture ping(String message);