Package ch.astorm.smtp4j.core
Interface SmtpMessageHandler
- All Known Implementing Classes:
SmtpMessageStorage
public interface SmtpMessageHandler
Represents a message handler that will process any incoming message.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a simpleSmtpMessageiterator. -
Method Summary
Modifier and TypeMethodDescriptioniterator()Returns a newSmtpMessageIteratorthat loops over the received messages.Retrieves the received messages and clears the list.voidreceive(SmtpMessage smtpMessage) Receives the givensmtpMessage.
-
Method Details
-
receive
Receives the givensmtpMessage.- Parameters:
smtpMessage- The message received within the transaction.
-
iterator
SmtpMessageHandler.SmtpMessageIterator iterator()Returns a newSmtpMessageIteratorthat loops over the received messages.- Returns:
- A new
SmtpMessageIteratorinstance.
-
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.
-