# Interface CATransportType

All Superinterfaces:
  `AutoCloseable, com.io7m.hibiscus.api.HBClientCloseableType<CAClientException>, com.io7m.hibiscus.api.HBIOOperationsType<CAIMessageType, CAClientException>, com.io7m.hibiscus.api.HBTransportType<CAIMessageType, CAClientException>`

All Known Implementing Classes:
  `CATransport1`

public interface CATransportType extends com.io7m.hibiscus.api.HBTransportType<CAIMessageType, CAClientException>
The type of message transports.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Path`
  `fileDownload(CAFileID fileID, Path file, Path fileTmp, long size, String hashAlgorithm, String hashValue, Consumer<CAClientTransferStatistics> statistics)`
  Download the data associated with the given file.
  `void`
  `fileUpload(CAFileID fileID, Path file, String contentType, String description, Consumer<CAClientTransferStatistics> statistics)`
  Upload the data associated with the given file.
  `List<CAIResponseType>`
  `transaction(List<CAICommandType<?>> commands)`
  Execute all the given commands in order, in a single transaction.

  ### Methods inherited from interface com.io7m.hibiscus.api.HBClientCloseableType

  `close, isClosed`

  ### Methods inherited from interface com.io7m.hibiscus.api.HBIOOperationsType

  `receive, send, sendAndForget, sendAndWait`

- ## Method Details

  - ### fileDownload

    Path fileDownload(CAFileID fileID, Path file, Path fileTmp, long size, String hashAlgorithm, String hashValue, Consumer<CAClientTransferStatistics> statistics) throws InterruptedException, CAClientException
    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
    Throws:
      `InterruptedException` - On interruption
      `CAClientException` - On errors

  - ### fileUpload

    void fileUpload(CAFileID fileID, Path file, String contentType, String description, Consumer<CAClientTransferStatistics> statistics) throws InterruptedException, CAClientException
    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
    Throws:
      `InterruptedException` - On interruption
      `CAClientException` - On errors

  - ### transaction

    List<CAIResponseType> transaction(List<CAICommandType<?>> commands) throws InterruptedException, CAClientException
    Execute all the given commands in order, in a single transaction.
    Parameters:
      `commands` - The commands
    Returns:
      The responses
    Throws:
      `InterruptedException` - On interruption
      `CAClientException` - On errors