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>
The version 1 protocol handler.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcom.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> Send garbage to the server.com.io7m.hibiscus.api.HBResultType<CAClientUnit, CAIResponseError> 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) booleantoString()Methods inherited from class com.io7m.cardant.client.basic.internal.CAHandlerAbstract
configuration, httpClient, strings
-
Method Details
-
onIsConnected
public boolean onIsConnected() -
onPollEvents
- Throws:
InterruptedException
-
onExecuteLogin
public com.io7m.hibiscus.api.HBResultType<com.io7m.hibiscus.basic.HBClientNewHandler<CAClientException,CAICommandType<?>, onExecuteLoginCAIResponseType, CAIResponseType, CAIResponseError, CAClientEventType, CAClientCredentials>, CAIResponseError> (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:CAHandlerTypeDownload 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
-
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:CAHandlerTypeUpload 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
public com.io7m.hibiscus.api.HBResultType<CAClientUnit,CAIResponseError> onExecuteGarbage() throws InterruptedExceptionDescription copied from interface:CAHandlerTypeSend garbage to the server.- Returns:
- The result
- Throws:
InterruptedException- On interruption
-
onExecuteInvalid
public com.io7m.hibiscus.api.HBResultType<CAClientUnit,CAIResponseError> onExecuteInvalid() throws InterruptedExceptionDescription copied from interface:CAHandlerTypeSend a well-formed but invalid command to the server.- Returns:
- The result
- Throws:
InterruptedException- On interruption
-
toString
-