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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateKey(jakarta.mail.Message message) voidonMessage(jakarta.mail.Message message, MailboxReader.Context<ReaderResult> context) Called for each message.Methods inherited from class 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: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
-
createKey
-