Class MessageDeleteHandler
java.lang.Object
ch.tocco.nice2.messaging.mail.api.AbstractMailboxReaderHandler<ReaderResult>
ch.tocco.nice2.optional.mailintegration.impl.handler.MessageDeleteHandler
- All Implemented Interfaces:
MailboxReaderHandler<ReaderResult>
Can be used as last handler with
CompositeMailReaderHandler
that will set the Flags.Flag.DELETED
flag on a message if the context contains a attribute.
Pre-executing handlers then set a flag on the MailboxReader.Context
instead of on the message
directly. This way deletion of message can be controlled by de/activating a handler which might
be more convenient (e.g. no need to touch existing code).-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
createKey
(jakarta.mail.Message message) 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, init
-
Constructor Details
-
MessageDeleteHandler
public MessageDeleteHandler()
-
-
Method Details
-
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
-