Class MailProcessorHandler
java.lang.Object
ch.tocco.nice2.messaging.mail.api.AbstractMailboxReaderHandler<ReaderResult>
ch.tocco.nice2.optional.mailintegration.impl.handler.MailProcessorHandler
- All Implemented Interfaces:
MailboxReaderHandler<ReaderResult>
Gets the
IncomeMail object from the context and feeds in into the MailProcessor. If
this was successful, the message is marked for deletion so it is removed from the inbox after the
reader completes. The message is only deleted, if MessageDeleteHandler is configured as
the last MailboxReaderHandler.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinish(MailboxReader.Context<ReaderResult> context) Called once after iterating finished, regardless of error.voidinit(MailboxReader.Context<ReaderResult> context) Called once before the reading process starts.voidonMessage(jakarta.mail.Message message, MailboxReader.Context<ReaderResult> context) Called for each message.voidsetExceptionHandler(ExceptionHandler<IncomeMail> exceptionHandler)
-
Constructor Details
-
MailProcessorHandler
-
-
Method Details
-
setExceptionHandler
-
init
Description copied from interface:MailboxReaderHandlerCalled once before the reading process starts.- Specified by:
initin interfaceMailboxReaderHandler<ReaderResult>- Overrides:
initin classAbstractMailboxReaderHandler<ReaderResult>
-
finish
Description copied from interface:MailboxReaderHandlerCalled once after iterating finished, regardless of error.- Specified by:
finishin interfaceMailboxReaderHandler<ReaderResult>- Overrides:
finishin classAbstractMailboxReaderHandler<ReaderResult>
-
onMessage
public void onMessage(jakarta.mail.Message message, MailboxReader.Context<ReaderResult> context) throws jakarta.mail.MessagingException Description copied from interface:MailboxReaderHandlerCalled for each message. TheMessagingExceptionis wrapped in aMailExceptionto comply to the api of this module. All other execptions are propagated (wrapped inRuntimeExceptionif necessary).- Throws:
jakarta.mail.MessagingException
-