Class CompositeMailReaderHandler<T>
java.lang.Object
ch.tocco.nice2.messaging.mail.api.AbstractMailboxReaderHandler<T>
ch.tocco.nice2.messaging.mail.api.CompositeMailReaderHandler<T>
- All Implemented Interfaces:
MailboxReaderHandler<T>,Iterable<MailboxReaderHandler<T>>
public class CompositeMailReaderHandler<T>
extends AbstractMailboxReaderHandler<T>
implements Iterable<MailboxReaderHandler<T>>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCompositeMailReaderHandler(MailboxReaderHandler<T>... handlers) CompositeMailReaderHandler(Iterable<MailboxReaderHandler<T>> handlers) CompositeMailReaderHandler(Iterable<MailboxReaderHandler<T>> handlers, CompositeMailReaderHandler.Progress<?> progress) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHandler(int index, MailboxReaderHandler<T> handler) voidaddHandler(MailboxReaderHandler<T> handler) voidaddHandlers(MailboxReaderHandler<T>... handlers) voidaddHandlers(Iterable<MailboxReaderHandler<T>> handlers) copy()copyWithProgress(CompositeMailReaderHandler.Progress<R> progress) voidfinish(MailboxReader.Context<T> context) Called once after iterating finished, regardless of error.getHandler(int index) intvoidinit(MailboxReader.Context<T> context) Called once before the reading process starts.iterator()voidonMessage(jakarta.mail.Message message, MailboxReader.Context<T> context) Called for each message.voidremoveHandler(MailboxReaderHandler<T> handler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CompositeMailReaderHandler
public CompositeMailReaderHandler(Iterable<MailboxReaderHandler<T>> handlers, CompositeMailReaderHandler.Progress<?> progress) -
CompositeMailReaderHandler
-
CompositeMailReaderHandler
-
-
Method Details
-
addHandler
-
addHandler
-
addHandlers
-
addHandlers
-
removeHandler
-
getHandler
-
getHandlerCount
public int getHandlerCount() -
init
Description copied from interface:MailboxReaderHandlerCalled once before the reading process starts.- Specified by:
initin interfaceMailboxReaderHandler<T>- Overrides:
initin classAbstractMailboxReaderHandler<T>
-
finish
Description copied from interface:MailboxReaderHandlerCalled once after iterating finished, regardless of error.- Specified by:
finishin interfaceMailboxReaderHandler<T>- Overrides:
finishin classAbstractMailboxReaderHandler<T>
-
onMessage
public void onMessage(jakarta.mail.Message message, MailboxReader.Context<T> 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).- Specified by:
onMessagein interfaceMailboxReaderHandler<T>- Throws:
jakarta.mail.MessagingException
-
iterator
-
copy
-
copyWithProgress
public <R> CompositeMailReaderHandler<T> copyWithProgress(CompositeMailReaderHandler.Progress<R> progress)
-