Class AbstractCommandRunner
java.lang.Object
com.datastax.astra.internal.command.AbstractCommandRunner
- All Implemented Interfaces:
CommandRunner
- Direct Known Subclasses:
Collection,DataAPIDatabaseAdmin,Database
Execute the command and parse results throwing DataApiResponseException when needed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandOptions<?> Default command options when not overrideprotected RetryHttpClientHttp client reused when properties not override. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringThe subclass should provide the endpoint, url to post request.protected <T> TmapAsDocument(ApiResponse api, Class<T> documentClass) Document Mapping.runCommand(Command command, CommandOptions<?> overridingOptions) Command to return the payload as a Map.<T> TrunCommand(Command command, CommandOptions<?> options, Class<T> documentClass) Extension point to run any command with typing constraints.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.datastax.astra.client.model.CommandRunner
runCommand, runCommand
-
Field Details
-
httpClient
Http client reused when properties not override. -
commandOptions
Default command options when not override
-
-
Constructor Details
-
AbstractCommandRunner
protected AbstractCommandRunner()Default constructor.
-
-
Method Details
-
runCommand
Command to return the payload as a Map.- Specified by:
runCommandin interfaceCommandRunner- Parameters:
command- command to executeoverridingOptions- options when running the command- Returns:
- result as a document map
-
runCommand
Extension point to run any command with typing constraints.- Specified by:
runCommandin interfaceCommandRunner- Type Parameters:
T- document type to use- Parameters:
command- command as a json Payloadoptions- options when running the commanddocumentClass- document class to use for marshalling- Returns:
- instance of expecting type.
-
mapAsDocument
Document Mapping.- Type Parameters:
T- document type- Parameters:
api- api responsedocumentClass- document class- Returns:
- document
-
getApiEndpoint
The subclass should provide the endpoint, url to post request.- Returns:
- url on which to post the request
-