Interface ServerRetrReplyHandler
- All Superinterfaces:
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleMessageComplete(ClientTransactionState transaction) Called when the entire message has been received.voidhandleMessageContent(ByteBuffer content) Called with a chunk of message content.voidhandleMessageDeleted(ClientTransactionState transaction, String message) Called when the specified message has been marked deleted (-ERR).voidhandleNoSuchMessage(ClientTransactionState transaction, String message) Called when the specified message does not exist (-ERR).voidsetResumeCallback(Runnable callback) Provides a callback to invoke when the handler is ready for more message content after a pause.booleanReturns whether the handler needs a read pause after processing message content.Methods inherited from interface org.bluezoo.gumdrop.pop3.client.handler.ServerReplyHandler
handleServiceClosing
-
Method Details
-
handleMessageContent
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
Called when the entire message has been received.- Parameters:
transaction- operations to continue in the TRANSACTION state
-
handleNoSuchMessage
Called when the specified message does not exist (-ERR).- Parameters:
transaction- operations to continue in the TRANSACTION statemessage- the server's error message
-
handleMessageDeleted
Called when the specified message has been marked deleted (-ERR).- Parameters:
transaction- operations to continue in the TRANSACTION statemessage- the server's error message
-
wantsPause
boolean wantsPause()Returns whether the handler needs a read pause after processing message content. Called after eachhandleMessageContent(java.nio.ByteBuffer)invocation.- Returns:
- true if reading should be paused
-
setResumeCallback
Provides a callback to invoke when the handler is ready for more message content after a pause.- Parameters:
callback- the resume callback
-