public class ImapIdleChannelAdapterSpec extends MessageProducerSpec<ImapIdleChannelAdapterSpec,ImapIdleChannelAdapter> implements ComponentsRegistration
Modifier and Type | Field and Description |
---|---|
protected Map<Object,String> |
componentsToRegister |
protected boolean |
externalReceiver |
protected ImapMailReceiver |
receiver |
PARSER, target
logger
DEFAULT_PHASE
OBJECT_TYPE_ATTRIBUTE
Modifier | Constructor and Description |
---|---|
protected |
ImapIdleChannelAdapterSpec(ImapMailReceiver receiver) |
protected |
ImapIdleChannelAdapterSpec(ImapMailReceiver receiver,
boolean externalReceiver) |
Modifier and Type | Method and Description |
---|---|
ImapIdleChannelAdapterSpec |
adviceChain(Advice... adviceChain)
Configure a chain of
Advice objects for message delivery, applied to
the downstream flow. |
ImapIdleChannelAdapterSpec |
autoCloseFolder(boolean autoCloseFolder)
When configured to
false , the folder is not closed automatically after a fetch. |
ImapIdleChannelAdapterSpec |
cancelIdleInterval(long interval)
How often to recycle the idle task (in case of a silently dropped connection).
|
ImapIdleChannelAdapterSpec |
embeddedPartsAsBytes(boolean embeddedPartsAsBytes)
|
Map<Object,String> |
getComponentsToRegister() |
ImapIdleChannelAdapterSpec |
headerMapper(HeaderMapper<MimeMessage> headerMapper)
Set the header mapper; if a header mapper is not provided, the message payload is
a
MimeMessage , when provided, the headers are mapped and the payload is
the MimeMessage content. |
ImapIdleChannelAdapterSpec |
javaMailAuthenticator(Authenticator javaMailAuthenticator) |
ImapIdleChannelAdapterSpec |
javaMailProperties(java.util.function.Consumer<PropertiesBuilder> configurer)
Configure the
javaMailProperties by invoking a Consumer callback which
is invoked with a PropertiesBuilder . |
ImapIdleChannelAdapterSpec |
javaMailProperties(Properties javaMailProperties) |
ImapIdleChannelAdapterSpec |
maxFetchSize(int maxFetchSize) |
ImapIdleChannelAdapterSpec |
searchTermStrategy(SearchTermStrategy searchTermStrategy) |
ImapIdleChannelAdapterSpec |
selector(java.util.function.Function<MimeMessage,Boolean> selectorFunction)
Configure a
Function to select messages. |
ImapIdleChannelAdapterSpec |
selectorExpression(Expression selectorExpression)
Configure an
Expression to select messages. |
ImapIdleChannelAdapterSpec |
selectorExpression(String selectorExpression)
Configure a SpEL expression to select messages.
|
ImapIdleChannelAdapterSpec |
sendingTaskExecutor(Executor sendingTaskExecutor)
Specify a task executor to be used to send messages to the downstream flow.
|
ImapIdleChannelAdapterSpec |
session(Session session)
A Java Mail
Session to use. |
ImapIdleChannelAdapterSpec |
shouldDeleteMessages(boolean shouldDeleteMessages) |
ImapIdleChannelAdapterSpec |
shouldMarkMessagesAsRead(boolean shouldMarkMessagesAsRead) |
ImapIdleChannelAdapterSpec |
shouldReconnectAutomatically(boolean shouldReconnectAutomatically) |
ImapIdleChannelAdapterSpec |
transactional()
Specify a
TransactionInterceptor Advice with default
PlatformTransactionManager and
DefaultTransactionAttribute for the
downstream flow. |
ImapIdleChannelAdapterSpec |
transactional(TransactionInterceptor transactionInterceptor)
Specify a
TransactionInterceptor Advice for the
downstream flow. |
ImapIdleChannelAdapterSpec |
transactional(TransactionManager transactionManager)
Specify a
TransactionInterceptor Advice with the provided
TransactionManager and default
DefaultTransactionAttribute
for the downstream flow. |
ImapIdleChannelAdapterSpec |
transactionSynchronizationFactory(TransactionSynchronizationFactory transactionSynchronizationFactory)
Configure a
TransactionSynchronizationFactory . |
ImapIdleChannelAdapterSpec |
userFlag(String userFlag)
Set the name of the flag to use to flag messages when the server does
not support \Recent but supports user flags;
default .
|
autoStartup, errorChannel, errorChannel, errorMessageStrategy, id, outputChannel, outputChannel, phase, sendTimeout, shouldTrack
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
protected final ImapMailReceiver receiver
protected final boolean externalReceiver
protected ImapIdleChannelAdapterSpec(ImapMailReceiver receiver)
protected ImapIdleChannelAdapterSpec(ImapMailReceiver receiver, boolean externalReceiver)
public ImapIdleChannelAdapterSpec selectorExpression(String selectorExpression)
MimeMessage
which should return a boolean
result (true means select the message).selectorExpression
- the selectorExpression.public ImapIdleChannelAdapterSpec selectorExpression(Expression selectorExpression)
Expression
to select messages. The root object for the expression
evaluation is a MimeMessage
which should return a boolean
result (true means select the message).selectorExpression
- the selectorExpression.public ImapIdleChannelAdapterSpec selector(java.util.function.Function<MimeMessage,Boolean> selectorFunction)
Function
to select messages. The argument for the function
is a MimeMessage
; apply
returns a boolean
result (true means select the message).selectorFunction
- the selectorFunction.FunctionExpression
public ImapIdleChannelAdapterSpec session(Session session)
Session
to use.session
- the session.AbstractMailReceiver.setSession(Session)
public ImapIdleChannelAdapterSpec javaMailProperties(Properties javaMailProperties)
javaMailProperties
- the javaMailProperties.AbstractMailReceiver.setJavaMailProperties(Properties)
public ImapIdleChannelAdapterSpec javaMailProperties(java.util.function.Consumer<PropertiesBuilder> configurer)
javaMailProperties
by invoking a Consumer
callback which
is invoked with a PropertiesBuilder
.configurer
- the configurer.AbstractMailReceiver.setJavaMailProperties(Properties)
public ImapIdleChannelAdapterSpec javaMailAuthenticator(Authenticator javaMailAuthenticator)
javaMailAuthenticator
- the javaMailAuthenticator.AbstractMailReceiver.setJavaMailAuthenticator(Authenticator)
public ImapIdleChannelAdapterSpec maxFetchSize(int maxFetchSize)
maxFetchSize
- the maxFetchSize.AbstractMailReceiver.setMaxFetchSize(int)
public ImapIdleChannelAdapterSpec shouldDeleteMessages(boolean shouldDeleteMessages)
shouldDeleteMessages
- the shouldDeleteMessages.AbstractMailReceiver.setShouldDeleteMessages(boolean)
public ImapIdleChannelAdapterSpec searchTermStrategy(SearchTermStrategy searchTermStrategy)
searchTermStrategy
- the searchTermStrategy.ImapMailReceiver.setSearchTermStrategy(SearchTermStrategy)
public ImapIdleChannelAdapterSpec shouldMarkMessagesAsRead(boolean shouldMarkMessagesAsRead)
shouldMarkMessagesAsRead
- the shouldMarkMessagesAsRead.ImapMailReceiver.setShouldMarkMessagesAsRead(Boolean)
public ImapIdleChannelAdapterSpec userFlag(String userFlag)
userFlag
- the flag.AbstractMailReceiver.setUserFlag(String)
public ImapIdleChannelAdapterSpec headerMapper(HeaderMapper<MimeMessage> headerMapper)
MimeMessage
, when provided, the headers are mapped and the payload is
the MimeMessage
content.headerMapper
- the header mapper.AbstractMailReceiver.setUserFlag(String)
,
embeddedPartsAsBytes(boolean)
public ImapIdleChannelAdapterSpec embeddedPartsAsBytes(boolean embeddedPartsAsBytes)
Part
(e.g Message
or
Multipart
content is rendered as a byte[] in the payload.
Otherwise, leave as a Part
. These objects are not suitable for
downstream serialization. Default: true.
This has no effect if there is no header mapper, in that case the payload is the
MimeMessage
.
embeddedPartsAsBytes
- the embeddedPartsAsBytes to set.headerMapper(HeaderMapper)
public ImapIdleChannelAdapterSpec autoCloseFolder(boolean autoCloseFolder)
false
, the folder is not closed automatically after a fetch.
It is the target application's responsibility to close it using the
IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE
header
from the message produced by this channel adapter.autoCloseFolder
- set to false
to keep folder opened.AbstractMailReceiver.setAutoCloseFolder(boolean)
public ImapIdleChannelAdapterSpec transactionSynchronizationFactory(TransactionSynchronizationFactory transactionSynchronizationFactory)
TransactionSynchronizationFactory
. Usually used to synchronize
message deletion with some external transaction manager.transactionSynchronizationFactory
- the transactionSynchronizationFactory.public ImapIdleChannelAdapterSpec adviceChain(Advice... adviceChain)
Advice
objects for message delivery, applied to
the downstream flow.adviceChain
- the advice chain.public ImapIdleChannelAdapterSpec transactional(TransactionManager transactionManager)
TransactionInterceptor
Advice
with the provided
TransactionManager
and default
DefaultTransactionAttribute
for the downstream flow.transactionManager
- the TransactionManager
to use.public ImapIdleChannelAdapterSpec transactional(TransactionInterceptor transactionInterceptor)
TransactionInterceptor
Advice
for the
downstream flow.transactionInterceptor
- the TransactionInterceptor
to use.TransactionInterceptorBuilder
public ImapIdleChannelAdapterSpec transactional()
TransactionInterceptor
Advice
with default
PlatformTransactionManager
and
DefaultTransactionAttribute
for the
downstream flow.public ImapIdleChannelAdapterSpec sendingTaskExecutor(Executor sendingTaskExecutor)
sendingTaskExecutor
- the sendingTaskExecutor.ImapIdleChannelAdapter.setSendingTaskExecutor(Executor)
public ImapIdleChannelAdapterSpec shouldReconnectAutomatically(boolean shouldReconnectAutomatically)
shouldReconnectAutomatically
- the shouldReconnectAutomatically.ImapIdleChannelAdapter.setShouldReconnectAutomatically(boolean)
public ImapIdleChannelAdapterSpec cancelIdleInterval(long interval)
interval
- the interval.ImapMailReceiver.setCancelIdleInterval(long)
public Map<Object,String> getComponentsToRegister()
getComponentsToRegister
in interface ComponentsRegistration