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
Modifier and TypeFieldDescriptionprotected CommandOptions
<?> Default command options when not overrideprotected RetryHttpClient
Http client reused when properties not override. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
The subclass should provide the endpoint, url to post request.protected <T> T
mapAsDocument
(ApiResponse api, Class<T> documentClass) Document Mapping.runCommand
(Command command, CommandOptions<?> overridingOptions) Command to return the payload as a Map.<T> T
runCommand
(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, wait
Methods 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:
runCommand
in 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:
runCommand
in 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
-