Package com.datastax.astra.client.model
Interface CommandRunner
- All Known Implementing Classes:
AbstractCommandRunner
,Collection
,DataAPIDatabaseAdmin
,Database
public interface CommandRunner
Use to initialize the HTTPClient.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ApiResponse
runCommand
(Command command) Command to return the payload as a Map.runCommand
(Command command, CommandOptions<?> options) 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.default <T> T
runCommand
(Command command, Class<T> documentClass) Extension point to run any command with typing constraints.
-
Method Details
-
runCommand
Command to return the payload as a Map.- Parameters:
command
- command to execute- Returns:
- result as a document map
- Throws:
DataApiResponseException
- if the returned object contains error response is encapsulated in a DataApiResponseException.
-
runCommand
Command to return the payload as a Map.- Parameters:
command
- command to executeoptions
- options when running the command- Returns:
- result as a document map
- Throws:
DataApiResponseException
- if the returned object contains error response is encapsulated in a DataApiResponseException.
-
runCommand
Extension point to run any command with typing constraints.- Type Parameters:
T
- document type to use- Parameters:
command
- command as a json PayloaddocumentClass
- document class to use for marshalling- Returns:
- instance of expecting type.
- Throws:
DataApiResponseException
- if the returned object contains error response is encapsulated in a DataApiResponseException.
-
runCommand
<T> T runCommand(Command command, CommandOptions<?> options, Class<T> documentClass) throws DataApiResponseException Extension point to run any command with typing constraints.- 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.
- Throws:
DataApiResponseException
- if the returned object contains error response is encapsulated in a DataApiResponseException.
-