public final class PagingProviderEmailDelegate<T extends BaseEmailAttributes> extends Object implements org.mule.runtime.extension.api.runtime.streaming.PagingProvider<MailboxConnection,org.mule.runtime.extension.api.runtime.operation.Result<Object,T>>
PagingProvider implementation for list emails operation.| Constructor and Description |
|---|
PagingProviderEmailDelegate(MailboxAccessConfiguration configuration,
String folderName,
BaseEmailPredicateBuilder matcherBuilder,
int pageSize,
boolean deleteAfterRetrieve,
Consumer<BaseEmailAttributes> deleteAfterReadCallback) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
List<org.mule.runtime.extension.api.runtime.operation.Result<Object,T>> |
getPage(MailboxConnection connection) |
Optional<Integer> |
getTotalResults(MailboxConnection connection) |
public PagingProviderEmailDelegate(MailboxAccessConfiguration configuration, String folderName, BaseEmailPredicateBuilder matcherBuilder, int pageSize, boolean deleteAfterRetrieve, Consumer<BaseEmailAttributes> deleteAfterReadCallback)
configuration - The MailboxAccessConfiguration associated to this operation.folderName - the name of the folder where the emails are stored.matcherBuilder - a Predicate of BaseEmailAttributes used to filter the output list @return a
List of Message carrying all the emails and it's corresponding attributes.pageSize - size of the block that would be retrieved from the email server. This page doesn't represent the page size to
be returned by the PagingProvider because emails must be tested against the BaseEmailPredicateBuilder
matcher after retrieval to see if they fulfill matcher's condition.deleteAfterRetrieve - whether the emails should be deleted after retrievaldeleteAfterReadCallback - callback for deleting each emailpublic List<org.mule.runtime.extension.api.runtime.operation.Result<Object,T>> getPage(MailboxConnection connection)
getPage in interface org.mule.runtime.extension.api.runtime.streaming.PagingProvider<MailboxConnection,org.mule.runtime.extension.api.runtime.operation.Result<Object,T extends BaseEmailAttributes>>public Optional<Integer> getTotalResults(MailboxConnection connection)
getTotalResults in interface org.mule.runtime.extension.api.runtime.streaming.PagingProvider<MailboxConnection,org.mule.runtime.extension.api.runtime.operation.Result<Object,T extends BaseEmailAttributes>>connection - The connection to be used to do the query.Optional.empty() because a priori there is no way for knowing how many emails are going to be tested
true against the BaseEmailPredicateBuilder matcher.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.