Package ch.astorm.smtp4j.core
Interface SmtpMessageHandler
- All Superinterfaces:
SmtpServerListener
- All Known Implementing Classes:
DefaultSmtpMessageHandler
Represents a message handler that will process any incoming message.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a simpleSmtpMessageiterator. -
Method Summary
Modifier and TypeMethodDescriptionReturns a newSmtpMessageReaderthat loops over the received messages.Retrieves the received messages and clears the list.Methods inherited from interface ch.astorm.smtp4j.core.SmtpServerListener
notifyClose, notifyMessage, notifyStart
-
Method Details
-
messageReader
SmtpMessageHandler.SmtpMessageReader messageReader()Returns a newSmtpMessageReaderthat loops over the received messages. Note that if you create multipleSmtpMessageReaderinstances, the will compete over the same message list and the messages will be received only by one of the readers.- Returns:
- A new
SmtpMessageReaderinstance.
-
readMessages
List<SmtpMessage> readMessages()Retrieves the received messages and clears the list. If no new message has been received since the last notification, an empty list will be returned.- Returns:
- All the (newly) received messages or an empty list if none.
-