Package glide.managers
Class CommandManager
- java.lang.Object
-
- glide.managers.CommandManager
-
public class CommandManager extends java.lang.ObjectCommandManager that submits command requests directly to the Rust glide-core. Handles command serialization, routing, and response processing for all client operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCommandManager.ClusterScanCursorDetailInternal interface for exposing implementation details about a ClusterScanCursor.
-
Constructor Summary
Constructors Constructor Description CommandManager(GlideCoreClient coreClient)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <ArgType> voidpopulateCommandWithArgs(ArgType[] arguments, CommandRequestOuterClass.Command.Builder outputBuilder)Add the given set of arguments to the output Command.Builder.protected CommandRequestOuterClass.CommandRequest.BuilderprepareCommandRequest(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments)Build a protobuf command request object.protected CommandRequestOuterClass.CommandRequest.BuilderprepareCommandRequest(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, RequestRoutingConfiguration.Route route)Build a protobuf command request object with routing options.protected CommandRequestOuterClass.CommandRequest.BuilderprepareCommandRequest(CommandRequestOuterClass.RequestType requestType, java.lang.String[] arguments)Build a protobuf command request object.protected CommandRequestOuterClass.CommandRequest.BuilderprepareCommandRequest(CommandRequestOuterClass.RequestType requestType, java.lang.String[] arguments, RequestRoutingConfiguration.Route route)Build a protobuf command request object with routing options.protected CommandRequestOuterClass.CommandRequest.BuilderprepareCommandRequest(Batch batch, boolean raiseOnError, java.util.Optional<BatchOptions> options)Build a protobuf Batch request object.protected CommandRequestOuterClass.CommandRequest.BuilderprepareCommandRequest(ClusterBatch batch, boolean raiseOnError, java.util.Optional<ClusterBatchOptions> options)Build a protobuf Batch request object with options.protected CommandRequestOuterClass.CommandRequest.BuilderprepareCursorRequest(@NonNull ClusterScanCursor cursor, @NonNull ScanOptions options)Build a protobuf cursor scan request.protected <T> java.util.concurrent.CompletableFuture<T>submitBatchToJni(CommandRequestOuterClass.CommandRequest.Builder command, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean expectUtf8Response)Submit batch request via JNI.<T> java.util.concurrent.CompletableFuture<T>submitClusterScan(ClusterScanCursor cursor, @NonNull ScanOptions options, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Submit a scan request with cursor.<T> java.util.concurrent.CompletableFuture<T>submitClusterScanToJni(ClusterScanCursor cursor, @NonNull ScanOptions options, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean expectUtf8Response)Internal: Submit a scan request with explicit response encoding expectation.protected <T> java.util.concurrent.CompletableFuture<T>submitCommandToJni(CommandRequestOuterClass.CommandRequest.Builder command, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean binaryMode)Take a command request and submit it (backward compatibility).protected <T> java.util.concurrent.CompletableFuture<T>submitCommandToJni(CommandRequestOuterClass.CommandRequest.Builder command, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean binaryMode, boolean expectUtf8Response)Take a command request and submit it.<T> java.util.concurrent.CompletableFuture<T>submitNewBatch(Batch batch, boolean raiseOnError, java.util.Optional<BatchOptions> options, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Build a Batch and submit it.<T> java.util.concurrent.CompletableFuture<T>submitNewBatch(ClusterBatch batch, boolean raiseOnError, java.util.Optional<ClusterBatchOptions> options, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Build a Cluster Batch and submit it.<T> java.util.concurrent.CompletableFuture<T>submitNewCommand(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Build a command and submit it.<T> java.util.concurrent.CompletableFuture<T>submitNewCommand(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Build a command and submit it.<T> java.util.concurrent.CompletableFuture<T>submitNewCommand(CommandRequestOuterClass.RequestType requestType, java.lang.String[] arguments, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Build a command and submit it.<T> java.util.concurrent.CompletableFuture<T>submitNewCommand(CommandRequestOuterClass.RequestType requestType, java.lang.String[] arguments, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Build a command and submit it.<T> java.util.concurrent.CompletableFuture<T>submitNewCommandWithResponseType(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean expectUtf8Response)Build a command with route and explicit response type expectation.<T> java.util.concurrent.CompletableFuture<T>submitNewCommandWithResponseType(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean expectUtf8Response)Build a command with explicit response type expectation.<T> java.util.concurrent.CompletableFuture<T>submitObjectEncoding(GlideString[] arguments, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Specialized path for ObjectEncoding with route.<T> java.util.concurrent.CompletableFuture<T>submitObjectEncoding(GlideString[] arguments, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Specialized path for ObjectEncoding with GlideString args but textual response.<T> java.util.concurrent.CompletableFuture<T>submitPasswordUpdate(java.util.Optional<java.lang.String> password, boolean immediateAuth, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Submit a password update request to GLIDE core.<T> java.util.concurrent.CompletableFuture<T>submitRefreshIamToken(GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Submit an IAM token refresh request to GLIDE core.<T> java.util.concurrent.CompletableFuture<T>submitScript(Script script, java.util.List<GlideString> args, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Build a Script (by hash) request with route to send to Valkey.<T> java.util.concurrent.CompletableFuture<T>submitScript(Script script, java.util.List<GlideString> keys, java.util.List<GlideString> args, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Build a Script (by hash) request to send to Valkey.
-
-
-
Constructor Detail
-
CommandManager
public CommandManager(GlideCoreClient coreClient)
-
-
Method Detail
-
submitNewCommand
public <T> java.util.concurrent.CompletableFuture<T> submitNewCommand(CommandRequestOuterClass.RequestType requestType, java.lang.String[] arguments, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Build a command and submit it.
-
submitNewCommand
public <T> java.util.concurrent.CompletableFuture<T> submitNewCommand(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Build a command and submit it.
-
submitNewCommandWithResponseType
public <T> java.util.concurrent.CompletableFuture<T> submitNewCommandWithResponseType(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean expectUtf8Response)
Build a command with explicit response type expectation.
-
submitNewCommandWithResponseType
public <T> java.util.concurrent.CompletableFuture<T> submitNewCommandWithResponseType(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean expectUtf8Response)
Build a command with route and explicit response type expectation.
-
submitNewCommand
public <T> java.util.concurrent.CompletableFuture<T> submitNewCommand(CommandRequestOuterClass.RequestType requestType, java.lang.String[] arguments, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Build a command and submit it.
-
submitNewCommand
public <T> java.util.concurrent.CompletableFuture<T> submitNewCommand(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Build a command and submit it.
-
submitObjectEncoding
public <T> java.util.concurrent.CompletableFuture<T> submitObjectEncoding(GlideString[] arguments, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Specialized path for ObjectEncoding with GlideString args but textual response.
-
submitObjectEncoding
public <T> java.util.concurrent.CompletableFuture<T> submitObjectEncoding(GlideString[] arguments, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Specialized path for ObjectEncoding with route.
-
submitNewBatch
public <T> java.util.concurrent.CompletableFuture<T> submitNewBatch(Batch batch, boolean raiseOnError, java.util.Optional<BatchOptions> options, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Build a Batch and submit it.
-
submitScript
public <T> java.util.concurrent.CompletableFuture<T> submitScript(Script script, java.util.List<GlideString> keys, java.util.List<GlideString> args, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Build a Script (by hash) request to send to Valkey.
-
submitScript
public <T> java.util.concurrent.CompletableFuture<T> submitScript(Script script, java.util.List<GlideString> args, RequestRoutingConfiguration.Route route, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Build a Script (by hash) request with route to send to Valkey.
-
submitNewBatch
public <T> java.util.concurrent.CompletableFuture<T> submitNewBatch(ClusterBatch batch, boolean raiseOnError, java.util.Optional<ClusterBatchOptions> options, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Build a Cluster Batch and submit it.
-
submitClusterScan
public <T> java.util.concurrent.CompletableFuture<T> submitClusterScan(ClusterScanCursor cursor, @NonNull @NonNull ScanOptions options, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Submit a scan request with cursor.
-
submitClusterScanToJni
public <T> java.util.concurrent.CompletableFuture<T> submitClusterScanToJni(ClusterScanCursor cursor, @NonNull @NonNull ScanOptions options, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean expectUtf8Response)
Internal: Submit a scan request with explicit response encoding expectation.
-
submitPasswordUpdate
public <T> java.util.concurrent.CompletableFuture<T> submitPasswordUpdate(java.util.Optional<java.lang.String> password, boolean immediateAuth, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)Submit a password update request to GLIDE core.
-
submitRefreshIamToken
public <T> java.util.concurrent.CompletableFuture<T> submitRefreshIamToken(GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler)
Submit an IAM token refresh request to GLIDE core.
-
submitCommandToJni
protected <T> java.util.concurrent.CompletableFuture<T> submitCommandToJni(CommandRequestOuterClass.CommandRequest.Builder command, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean binaryMode)
Take a command request and submit it (backward compatibility).
-
submitCommandToJni
protected <T> java.util.concurrent.CompletableFuture<T> submitCommandToJni(CommandRequestOuterClass.CommandRequest.Builder command, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean binaryMode, boolean expectUtf8Response)
Take a command request and submit it.
-
submitBatchToJni
protected <T> java.util.concurrent.CompletableFuture<T> submitBatchToJni(CommandRequestOuterClass.CommandRequest.Builder command, GlideExceptionCheckedFunction<ResponseOuterClass.Response,T> responseHandler, boolean expectUtf8Response)
Submit batch request via JNI.
-
prepareCommandRequest
protected CommandRequestOuterClass.CommandRequest.Builder prepareCommandRequest(CommandRequestOuterClass.RequestType requestType, java.lang.String[] arguments, RequestRoutingConfiguration.Route route)
Build a protobuf command request object with routing options.
-
prepareCommandRequest
protected CommandRequestOuterClass.CommandRequest.Builder prepareCommandRequest(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments, RequestRoutingConfiguration.Route route)
Build a protobuf command request object with routing options.
-
prepareCommandRequest
protected CommandRequestOuterClass.CommandRequest.Builder prepareCommandRequest(Batch batch, boolean raiseOnError, java.util.Optional<BatchOptions> options)
Build a protobuf Batch request object.
-
prepareCommandRequest
protected CommandRequestOuterClass.CommandRequest.Builder prepareCommandRequest(ClusterBatch batch, boolean raiseOnError, java.util.Optional<ClusterBatchOptions> options)
Build a protobuf Batch request object with options.
-
prepareCursorRequest
protected CommandRequestOuterClass.CommandRequest.Builder prepareCursorRequest(@NonNull @NonNull ClusterScanCursor cursor, @NonNull @NonNull ScanOptions options)
Build a protobuf cursor scan request.
-
prepareCommandRequest
protected CommandRequestOuterClass.CommandRequest.Builder prepareCommandRequest(CommandRequestOuterClass.RequestType requestType, java.lang.String[] arguments)
Build a protobuf command request object.
-
prepareCommandRequest
protected CommandRequestOuterClass.CommandRequest.Builder prepareCommandRequest(CommandRequestOuterClass.RequestType requestType, GlideString[] arguments)
Build a protobuf command request object.
-
populateCommandWithArgs
public static <ArgType> void populateCommandWithArgs(ArgType[] arguments, CommandRequestOuterClass.Command.Builder outputBuilder)Add the given set of arguments to the output Command.Builder.
-
-