Class CAHandlerDisconnected
java.lang.Object
com.io7m.cardant.client.basic.internal.CAHandlerAbstract
com.io7m.cardant.client.basic.internal.CAHandlerDisconnected
- All Implemented Interfaces:
CAHandlerType,com.io7m.hibiscus.basic.HBClientHandlerType<CAClientException,CAICommandType<?>, CAIResponseType, CAIResponseType, CAIResponseError, CAClientEventType, CAClientCredentials>
The initial "disconnected" 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> statisticsConsumer) 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) booleanMethods inherited from class com.io7m.cardant.client.basic.internal.CAHandlerAbstract
configuration, httpClient, strings
-
Method Details
-
onIsConnected
public boolean onIsConnected() -
onPollEvents
-
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) -
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> statisticsConsumer) 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 descriptionstatisticsConsumer- A receiver of transfer statistics- Returns:
- The result
-
onExecuteGarbage
Description copied from interface:CAHandlerTypeSend garbage to the server.- Returns:
- The result
-
onExecuteInvalid
Description copied from interface:CAHandlerTypeSend a well-formed but invalid command to the server.- Returns:
- The result
-