Class ImapIdleChannelAdapterSpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,P>
org.springframework.integration.dsl.MessageProducerSpec<ImapIdleChannelAdapterSpec,ImapIdleChannelAdapter>
org.springframework.integration.mail.dsl.ImapIdleChannelAdapterSpec
- All Implemented Interfaces:
DisposableBean
,FactoryBean<ImapIdleChannelAdapter>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
public class ImapIdleChannelAdapterSpec
extends MessageProducerSpec<ImapIdleChannelAdapterSpec,ImapIdleChannelAdapter>
implements ComponentsRegistration
- Since:
- 5.0
- Author:
- Gary Russell, Artem Bilan, Freya Nair
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ModifierConstructorDescriptionprotected
ImapIdleChannelAdapterSpec
(ImapMailReceiver receiver) protected
ImapIdleChannelAdapterSpec
(ImapMailReceiver receiver, boolean externalReceiver) -
Method Summary
Modifier and TypeMethodDescriptionadviceChain
(Advice... adviceChain) Configure a chain ofAdvice
objects for message delivery, applied to the downstream flow.autoCloseFolder
(boolean autoCloseFolder) When configured tofalse
, the folder is not closed automatically after a fetch.cancelIdleInterval
(long interval) How often to recycle the idle task (in case of a silently dropped connection).embeddedPartsAsBytes
(boolean embeddedPartsAsBytes) headerMapper
(HeaderMapper<MimeMessage> headerMapper) Set the header mapper; if a header mapper is not provided, the message payload is aMimeMessage
, when provided, the headers are mapped and the payload is theMimeMessage
content.javaMailAuthenticator
(Authenticator javaMailAuthenticator) javaMailProperties
(Consumer<PropertiesBuilder> configurer) Configure thejavaMailProperties
by invoking aConsumer
callback which is invoked with aPropertiesBuilder
.javaMailProperties
(Properties javaMailProperties) maxFetchSize
(int maxFetchSize) reconnectDelay
(long reconnectDelay) The time between connection attempts in milliseconds (default 10 seconds).searchTermStrategy
(SearchTermStrategy searchTermStrategy) selector
(Function<MimeMessage, Boolean> selectorFunction) Configure aFunction
to select messages.selectorExpression
(String selectorExpression) Configure a SpEL expression to select messages.selectorExpression
(Expression selectorExpression) Configure anExpression
to select messages.A Java MailSession
to use.shouldDeleteMessages
(boolean shouldDeleteMessages) shouldMarkMessagesAsRead
(boolean shouldMarkMessagesAsRead) shouldReconnectAutomatically
(boolean shouldReconnectAutomatically) simpleContent
(boolean simpleContent) Determine how the content is rendered.taskExecutor
(Executor taskExecutor) Provide a managedExecutor
to schedule a receiving IDLE task.Specify aTransactionInterceptor
Advice
with defaultPlatformTransactionManager
andDefaultTransactionAttribute
for the downstream flow.transactional
(TransactionInterceptor transactionInterceptor) Specify aTransactionInterceptor
Advice
for the downstream flow.transactional
(TransactionManager transactionManager) Specify aTransactionInterceptor
Advice
with the providedTransactionManager
and defaultDefaultTransactionAttribute
for the downstream flow.transactionSynchronizationFactory
(TransactionSynchronizationFactory transactionSynchronizationFactory) Configure aTransactionSynchronizationFactory
.Set the name of the flag to use to flag messages when the server does not support \Recent but supports user flags; default "spring-integration-mail-adapter".Methods inherited from class org.springframework.integration.dsl.MessageProducerSpec
autoStartup, errorChannel, errorChannel, errorMessageStrategy, id, observationConvention, outputChannel, outputChannel, phase, sendTimeout, shouldTrack
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Field Details
-
receiver
-
componentsToRegister
-
externalReceiver
protected final boolean externalReceiver
-
-
Constructor Details
-
ImapIdleChannelAdapterSpec
-
ImapIdleChannelAdapterSpec
-
-
Method Details
-
selectorExpression
Configure a SpEL expression to select messages. The root object for the expression evaluation is aMimeMessage
which should return a boolean result (true means select the message).- Parameters:
selectorExpression
- the selectorExpression.- Returns:
- the spec.
-
selectorExpression
Configure anExpression
to select messages. The root object for the expression evaluation is aMimeMessage
which should return a boolean result (true means select the message).- Parameters:
selectorExpression
- the selectorExpression.- Returns:
- the spec.
-
selector
Configure aFunction
to select messages. The argument for the function is aMimeMessage
;apply
returns a boolean result (true means select the message).- Parameters:
selectorFunction
- the selectorFunction.- Returns:
- the spec.
- See Also:
-
session
A Java MailSession
to use.- Parameters:
session
- the session.- Returns:
- the spec.
- See Also:
-
javaMailProperties
- Parameters:
javaMailProperties
- the javaMailProperties.- Returns:
- the spec.
- See Also:
-
javaMailProperties
Configure thejavaMailProperties
by invoking aConsumer
callback which is invoked with aPropertiesBuilder
.- Parameters:
configurer
- the configurer.- Returns:
- the spec.
- See Also:
-
javaMailAuthenticator
- Parameters:
javaMailAuthenticator
- the javaMailAuthenticator.- Returns:
- the spec.
- See Also:
-
maxFetchSize
- Parameters:
maxFetchSize
- the maxFetchSize.- Returns:
- the spec.
- See Also:
-
shouldDeleteMessages
- Parameters:
shouldDeleteMessages
- the shouldDeleteMessages.- Returns:
- the spec.
- See Also:
-
searchTermStrategy
- Parameters:
searchTermStrategy
- the searchTermStrategy.- Returns:
- the spec.
- See Also:
-
shouldMarkMessagesAsRead
- Parameters:
shouldMarkMessagesAsRead
- the shouldMarkMessagesAsRead.- Returns:
- the spec.
- See Also:
-
userFlag
Set the name of the flag to use to flag messages when the server does not support \Recent but supports user flags; default "spring-integration-mail-adapter".- Parameters:
userFlag
- the flag.- Returns:
- the spec.
- See Also:
-
headerMapper
Set the header mapper; if a header mapper is not provided, the message payload is aMimeMessage
, when provided, the headers are mapped and the payload is theMimeMessage
content.- Parameters:
headerMapper
- the header mapper.- Returns:
- the spec.
- See Also:
-
embeddedPartsAsBytes
When a header mapper is provided determine whether an embeddedPart
(e.gMessage
orMultipart
content is rendered as a byte[] in the payload. Otherwise, leave as aPart
. 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
.- Parameters:
embeddedPartsAsBytes
- the embeddedPartsAsBytes to set.- Returns:
- the spec.
- See Also:
-
autoCloseFolder
When configured tofalse
, the folder is not closed automatically after a fetch. It is the target application's responsibility to close it using theIntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE
header from the message produced by this channel adapter.- Parameters:
autoCloseFolder
- set tofalse
to keep folder opened.- Returns:
- the spec.
- Since:
- 5.2
- See Also:
-
transactionSynchronizationFactory
public ImapIdleChannelAdapterSpec transactionSynchronizationFactory(TransactionSynchronizationFactory transactionSynchronizationFactory) Configure aTransactionSynchronizationFactory
. Usually used to synchronize message deletion with some external transaction manager.- Parameters:
transactionSynchronizationFactory
- the transactionSynchronizationFactory.- Returns:
- the spec.
-
adviceChain
Configure a chain ofAdvice
objects for message delivery, applied to the downstream flow.- Parameters:
adviceChain
- the advice chain.- Returns:
- the spec.
-
transactional
Specify aTransactionInterceptor
Advice
with the providedTransactionManager
and defaultDefaultTransactionAttribute
for the downstream flow.- Parameters:
transactionManager
- theTransactionManager
to use.- Returns:
- the spec.
- Since:
- 5.2.5
-
transactional
Specify aTransactionInterceptor
Advice
for the downstream flow.- Parameters:
transactionInterceptor
- theTransactionInterceptor
to use.- Returns:
- the spec.
- See Also:
-
transactional
Specify aTransactionInterceptor
Advice
with defaultPlatformTransactionManager
andDefaultTransactionAttribute
for the downstream flow.- Returns:
- the spec.
-
shouldReconnectAutomatically
public ImapIdleChannelAdapterSpec shouldReconnectAutomatically(boolean shouldReconnectAutomatically) - Parameters:
shouldReconnectAutomatically
- the shouldReconnectAutomatically.- Returns:
- the spec.
- See Also:
-
cancelIdleInterval
How often to recycle the idle task (in case of a silently dropped connection). Seconds; default 120 (2 minutes).- Parameters:
interval
- the interval.- Returns:
- the spec.
- Since:
- 5.2
- See Also:
-
reconnectDelay
The time between connection attempts in milliseconds (default 10 seconds).- Parameters:
reconnectDelay
- the reconnectDelay to set.- Returns:
- the spec.
- Since:
- 6.0
-
simpleContent
Determine how the content is rendered.- Parameters:
simpleContent
- true for simple content.- Returns:
- the spec.
- Since:
- 5.5
- See Also:
-
taskExecutor
Provide a managedExecutor
to schedule a receiving IDLE task.- Parameters:
taskExecutor
- theExecutor
to use.- Returns:
- the spec.
- Since:
- 6.2
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-