Interface CommandRunner

All Known Implementing Classes:
AbstractCommandRunner, Collection, DataAPIDatabaseAdmin, Database

public interface CommandRunner
Use to initialize the HTTPClient.
  • Method Details

    • runCommand

      default ApiResponse runCommand(Command command)
      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

      ApiResponse runCommand(Command command, CommandOptions<?> options) throws DataApiResponseException
      Command to return the payload as a Map.
      Parameters:
      command - command to execute
      options - 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

      default <T> T runCommand(Command command, Class<T> documentClass)
      Extension point to run any command with typing constraints.
      Type Parameters:
      T - document type to use
      Parameters:
      command - command as a json Payload
      documentClass - 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 Payload
      options - options when running the command
      documentClass - 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.