forked from valkey-io/valkey-glide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `CLIENT ID` and `CLIENT GETNAME` commands. Signed-off-by: Yury-Fridlyand <[email protected]>
- Loading branch information
1 parent
2b9f9f7
commit 68ba1a0
Showing
12 changed files
with
392 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
java/client/src/main/java/glide/api/commands/ConnectionManagementBaseCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0 */ | ||
package glide.api.commands; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
/** | ||
* Connection Management Commands interface for both standalone and cluster clients. | ||
* | ||
* @see <a href="https://redis.io/commands/?group=connection">Connection Management Commands</a> | ||
*/ | ||
public interface ConnectionManagementBaseCommands { | ||
|
||
/** | ||
* Ping the Redis server. | ||
* | ||
* @see <a href="https://redis.io/commands/ping/">redis.io</a> for details. | ||
* @return Response from Redis containing a <code>String</code> with "PONG". | ||
*/ | ||
CompletableFuture<String> ping(); | ||
|
||
/** | ||
* Ping the Redis server. | ||
* | ||
* @see <a href="https://redis.io/commands/ping/">redis.io</a> for details. | ||
* @param str The ping argument that will be returned. | ||
* @return Response from Redis containing a <code>String</code> with a copy of the argument <code> | ||
* str</code>. | ||
*/ | ||
CompletableFuture<String> ping(String str); | ||
|
||
/** | ||
* Gets the current connection id. | ||
* | ||
* @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(); | ||
|
||
/** | ||
* Gets the name of the current connection. | ||
* | ||
* @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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
java/client/src/main/java/glide/api/commands/ConnectionManagementCommands.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.