Class IncomeMailHandler
java.lang.Object
ch.tocco.nice2.messaging.mail.api.AbstractMailboxReaderHandler<ReaderResult>
ch.tocco.nice2.optional.mailintegration.impl.handler.IncomeMailHandler
- All Implemented Interfaces:
MailboxReaderHandler<ReaderResult>
Creates a
IncomeMail
object from each Message
and sets it into
the MailboxReader.Context
using the hashCode()
of the
Message
object as key.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
createKey
(jakarta.mail.Message message) void
init
(MailboxReader.Context<ReaderResult> context) Called once before the reading process starts.void
onMessage
(jakarta.mail.Message message, MailboxReader.Context<ReaderResult> context) Called for each message.Methods inherited from class ch.tocco.nice2.messaging.mail.api.AbstractMailboxReaderHandler
finish
-
Constructor Details
-
IncomeMailHandler
-
-
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>
-
onMessage
public void onMessage(jakarta.mail.Message message, MailboxReader.Context<ReaderResult> context) 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
-
createKey
-