Interface CAHandlerType
- All Superinterfaces:
com.io7m.hibiscus.basic.HBClientHandlerType<CAClientException,CAICommandType<?>, CAIResponseType, CAIResponseType, CAIResponseError, CAClientEventType, CAClientCredentials>
- All Known Implementing Classes:
CAHandler1,CAHandlerAbstract,CAHandlerDisconnected
public interface CAHandlerType
extends com.io7m.hibiscus.basic.HBClientHandlerType<CAClientException,CAICommandType<?>,CAIResponseType,CAIResponseType,CAIResponseError,CAClientEventType,CAClientCredentials>
A versioned protocol handler.
-
Method Summary
Modifier and TypeMethodDescriptioncom.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> Send garbage to the server.com.io7m.hibiscus.api.HBResultType<CAClientUnit, CAIResponseError> Send a well-formed but invalid command to the server.Methods inherited from interface com.io7m.hibiscus.basic.HBClientHandlerType
onDisconnect, onExecuteCommand, onExecuteLogin, onIsConnected, onPollEvents
-
Method Details
-
onExecuteFileDownload
com.io7m.hibiscus.api.HBResultType<Path,CAIResponseError> onExecuteFileDownload(CAFileID fileID, Path file, Path fileTmp, long size, String hashAlgorithm, String hashValue, Consumer<CAClientTransferStatistics> statistics) throws InterruptedException 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 IDfile- The output filefileTmp- The temporary output filesize- The expected sizehashAlgorithm- The hash algorithmhashValue- The expected hash valuestatistics- A receiver of transfer statistics- Returns:
- The result
- Throws:
InterruptedException- On interruption
-
onExecuteFileUpload
com.io7m.hibiscus.api.HBResultType<CAFileID,CAIResponseError> onExecuteFileUpload(CAFileID fileID, Path file, String contentType, String description, Consumer<CAClientTransferStatistics> statistics) throws InterruptedException Upload the data associated with the given file.- Parameters:
fileID- The file IDfile- The input filecontentType- The content typedescription- The file descriptionstatistics- A receiver of transfer statistics- Returns:
- The result
- Throws:
InterruptedException- On interruption
-
onExecuteGarbage
com.io7m.hibiscus.api.HBResultType<CAClientUnit,CAIResponseError> onExecuteGarbage() throws InterruptedExceptionSend garbage to the server.- Returns:
- The result
- Throws:
InterruptedException- On interruption
-
onExecuteInvalid
com.io7m.hibiscus.api.HBResultType<CAClientUnit,CAIResponseError> onExecuteInvalid() throws InterruptedExceptionSend a well-formed but invalid command to the server.- Returns:
- The result
- Throws:
InterruptedException- On interruption
-