Class LoggingHandler
java.lang.Object
ch.tocco.nice2.messaging.mail.api.AbstractMailboxReaderHandler<ReaderResult>
ch.tocco.nice2.optional.mailintegration.impl.handler.LoggingHandler
- All Implemented Interfaces:
MailboxReaderHandler<ReaderResult>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
finish
(MailboxReader.Context<ReaderResult> readerResultContext) Called once after iterating finished, regardless of error.void
init
(MailboxReader.Context<ReaderResult> context) Called once before the reading process starts.void
onMessage
(jakarta.mail.Message message, MailboxReader.Context<ReaderResult> readerResultContext) Called for each message.
-
Constructor Details
-
LoggingHandler
public LoggingHandler(org.slf4j.Logger log)
-
-
Method Details
-
init
Description copied from interface:MailboxReaderHandler
Called once before the reading process starts.- Specified by:
init
in interfaceMailboxReaderHandler<ReaderResult>
- Overrides:
init
in classAbstractMailboxReaderHandler<ReaderResult>
-
finish
Description copied from interface:MailboxReaderHandler
Called once after iterating finished, regardless of error.- Specified by:
finish
in interfaceMailboxReaderHandler<ReaderResult>
- Overrides:
finish
in classAbstractMailboxReaderHandler<ReaderResult>
-
onMessage
public void onMessage(jakarta.mail.Message message, MailboxReader.Context<ReaderResult> readerResultContext) throws jakarta.mail.MessagingException Description copied from interface:MailboxReaderHandler
Called for each message. TheMessagingException
is wrapped in aMailException
to comply to the api of this module. All other execptions are propagated (wrapped inRuntimeException
if necessary).- Throws:
jakarta.mail.MessagingException
-