Package com.io7m.cardant.client.basic.internal

# Class CAHandler1

java.lang.Object
com.io7m.cardant.client.basic.internal.CAHandlerAbstract
com.io7m.cardant.client.basic.internal.CAHandler1

All Implemented Interfaces:
  `CAHandlerType`, `com.io7m.hibiscus.basic.HBClientHandlerType<CAClientException,CAICommandType<?>,CAIResponseType,CAIResponseType,CAIResponseError,CAClientEventType,CAClientCredentials>`

public final class CAHandler1 extends CAHandlerAbstract
The version 1 protocol handler.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onDisconnect()`
  `com.io7m.hibiscus.api.HBResultType<CAIResponseType,CAIResponseError>`
  `onExecuteCommand(CAICommandType<?> command)`
  `com.io7m.hibiscus.api.HBResultType<Path,CAIResponseError>`
  `onExecuteFileDownload(CAFileID fileID, Path file, Path fileTmp, long size, String hashAlgorithm, String hashValue, Consumer<CAClientTransferStatistics> statistics)`
  Download the data associated with the given file.
  `com.io7m.hibiscus.api.HBResultType<CAFileID,CAIResponseError>`
  `onExecuteFileUpload(CAFileID fileID, Path file, String contentType, String description, Consumer<CAClientTransferStatistics> statistics)`
  Upload the data associated with the given file.
  `com.io7m.hibiscus.api.HBResultType<CAClientUnit,CAIResponseError>`
  `onExecuteGarbage()`
  Send garbage to the server.
  `com.io7m.hibiscus.api.HBResultType<CAClientUnit,CAIResponseError>`
  `onExecuteInvalid()`
  Send a well-formed but invalid command to the server.
  `com.io7m.hibiscus.api.HBResultType<com.io7m.hibiscus.basic.HBClientNewHandler<CAClientException,CAICommandType<?>,CAIResponseType,CAIResponseType,CAIResponseError,CAClientEventType,CAClientCredentials>,CAIResponseError>`
  `onExecuteLogin(CAClientCredentials credentials)`
  `boolean`
  `onIsConnected()`
  `List<CAClientEventType>`
  `onPollEvents()`
  `String`
  `toString()`

  ### Methods inherited from class com.io7m.cardant.client.basic.internal.CAHandlerAbstract

  `configuration, httpClient, strings`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### onIsConnected

    public boolean onIsConnected()

  - ### onPollEvents

    public List<CAClientEventType> onPollEvents() throws InterruptedException
    Throws:
      `InterruptedException`

  - ### onExecuteLogin

    public com.io7m.hibiscus.api.HBResultType<com.io7m.hibiscus.basic.HBClientNewHandler<CAClientException,CAICommandType<?>,CAIResponseType,CAIResponseType,CAIResponseError,CAClientEventType,CAClientCredentials>,CAIResponseError> onExecuteLogin(CAClientCredentials credentials) throws InterruptedException
    Throws:
      `InterruptedException`

  - ### onExecuteCommand

    public com.io7m.hibiscus.api.HBResultType<CAIResponseType,CAIResponseError> onExecuteCommand(CAICommandType<?> command) throws InterruptedException
    Throws:
      `InterruptedException`

  - ### onDisconnect

    public void onDisconnect()

  - ### onExecuteFileDownload

    public com.io7m.hibiscus.api.HBResultType<Path,CAIResponseError> onExecuteFileDownload(CAFileID fileID, Path file, Path fileTmp, long size, String hashAlgorithm, String hashValue, Consumer<CAClientTransferStatistics> statistics)
    Description copied from interface: `CAHandlerType`
    Download the data associated with the given file. The file will be downloaded to a temporary file and then, if everything succeeds and the hash value matches, the temporary file will atomically replace the output file.
    Parameters:
      `fileID` - The file ID
      `file` - The output file
      `fileTmp` - The temporary output file
      `size` - The expected size
      `hashAlgorithm` - The hash algorithm
      `hashValue` - The expected hash value
      `statistics` - A receiver of transfer statistics
    Returns:
      The result

  - ### onExecuteFileUpload

    public com.io7m.hibiscus.api.HBResultType<CAFileID,CAIResponseError> onExecuteFileUpload(CAFileID fileID, Path file, String contentType, String description, Consumer<CAClientTransferStatistics> statistics) throws InterruptedException
    Description copied from interface: `CAHandlerType`
    Upload the data associated with the given file.
    Parameters:
      `fileID` - The file ID
      `file` - The input file
      `contentType` - The content type
      `description` - The file description
      `statistics` - A receiver of transfer statistics
    Returns:
      The result
    Throws:
      `InterruptedException` - On interruption

  - ### onExecuteGarbage

    public com.io7m.hibiscus.api.HBResultType<CAClientUnit,CAIResponseError> onExecuteGarbage() throws InterruptedException
    Description copied from interface: `CAHandlerType`
    Send garbage to the server.
    Returns:
      The result
    Throws:
      `InterruptedException` - On interruption

  - ### onExecuteInvalid

    public com.io7m.hibiscus.api.HBResultType<CAClientUnit,CAIResponseError> onExecuteInvalid() throws InterruptedException
    Description copied from interface: `CAHandlerType`
    Send a well-formed but invalid command to the server.
    Returns:
      The result
    Throws:
      `InterruptedException` - On interruption

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`