Interface ServerRetrReplyHandler

All Superinterfaces:
ServerReplyHandler

public interface ServerRetrReplyHandler extends ServerReplyHandler
Handler for RETR command response.

Message content is streamed as chunks of ByteBuffer. Dot-unstuffing is handled transparently by the protocol handler - the handler receives decoded message content.

handleMessageContent(java.nio.ByteBuffer) may be called multiple times as data arrives from the network. handleMessageComplete(org.bluezoo.gumdrop.pop3.client.handler.ClientTransactionState) is called once when the terminating dot line is received.

Author:
Chris Burdess
See Also:
  • Method Details

    • handleMessageContent

      void handleMessageContent(ByteBuffer content)
      Called with a chunk of message content.

      This method may be called multiple times. The content has been dot-unstuffed and does not include the terminating dot line. The ByteBuffer is only valid for the duration of this call.

      Parameters:
      content - a chunk of decoded message content
    • handleMessageComplete

      void handleMessageComplete(ClientTransactionState transaction)
      Called when the entire message has been received.
      Parameters:
      transaction - operations to continue in the TRANSACTION state
    • handleNoSuchMessage

      void handleNoSuchMessage(ClientTransactionState transaction, String message)
      Called when the specified message does not exist (-ERR).
      Parameters:
      transaction - operations to continue in the TRANSACTION state
      message - the server's error message
    • handleMessageDeleted

      void handleMessageDeleted(ClientTransactionState transaction, String message)
      Called when the specified message has been marked deleted (-ERR).
      Parameters:
      transaction - operations to continue in the TRANSACTION state
      message - the server's error message
    • wantsPause

      boolean wantsPause()
      Returns whether the handler needs a read pause after processing message content. Called after each handleMessageContent(java.nio.ByteBuffer) invocation.
      Returns:
      true if reading should be paused
    • setResumeCallback

      void setResumeCallback(Runnable callback)
      Provides a callback to invoke when the handler is ready for more message content after a pause.
      Parameters:
      callback - the resume callback