Package org.jgrapes.mail.events
Class MailFoldersUpdated
- All Implemented Interfaces:
Future<Void>
,Associator
,Eligible
Signals the retrieval of mails (update) by a
MailMonitor
.Must be fired on a MailChannel
.
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
Fields inherited from class org.jgrapes.core.internal.EventBase
completed, completionEvents, invokedFor
-
Constructor Summary
ConstructorDescriptionMailFoldersUpdated
(List<Folder> folders, List<Message> newMessages) Instantiates a new event. -
Method Summary
Modifier and TypeMethodDescriptionfolders()
Returns the folders.Return all messages (which are not deleted) from the folder.Return all (or max) messages (which are not deleted) from the folder, starting with the newest message.Return the new messages.static <R> R
withFolder
(Folder folder, Function<Folder, R> action) Execute the action with the given folder.Methods inherited from class org.jgrapes.core.Event
addCompletionEvent, associated, cancel, channels, channels, completionEvents, currentResults, defaultCriterion, forChannels, get, get, handled, handlingError, isCancelled, isDone, isEligibleFor, isStopped, processedBy, results, results, resumeHandling, setAssociated, setChannels, setRequiresResult, setResult, stop, suspendHandling, suspendHandling, tieTo, toString
Methods inherited from class org.jgrapes.core.internal.EventBase
disableTracking, enqueued, firstResultAssigned, isTracked, onCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associatedGet
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
MailFoldersUpdated
Instantiates a new event.- Parameters:
folders
- the foldersnewMessages
- the new messages
-
-
Method Details
-
folders
Returns the folders.- Returns:
- the list
-
newMessages
Return the new messages.New messages have not been reported before by an event.
- Returns:
- the list
-
withFolder
Execute the action with the given folder.The method ensures that the folder is open.
- Parameters:
folder
- the folderaction
- the action- Throws:
MessagingException
- the messaging exception
-
messages
Return all messages (which are not deleted) from the folder.- Parameters:
folder
- the folder- Returns:
- the message[]
- Throws:
MessagingException
- the messaging exception
-
messages
Return all (or max) messages (which are not deleted) from the folder, starting with the newest message.- Parameters:
folder
- the foldermax
- the limit- Returns:
- the message[]
- Throws:
MessagingException
- the messaging exception
-