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
FieldsFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedImapIdleChannelAdapterSpec(ImapMailReceiver receiver) protectedImapIdleChannelAdapterSpec(ImapMailReceiver receiver, boolean externalReceiver) -
Method Summary
Modifier and TypeMethodDescriptionadviceChain(Advice... adviceChain) Configure a chain ofAdviceobjects 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 theMimeMessagecontent.javaMailAuthenticator(Authenticator javaMailAuthenticator) javaMailProperties(Consumer<PropertiesBuilder> configurer) Configure thejavaMailPropertiesby invoking aConsumercallback 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 aFunctionto select messages.selectorExpression(String selectorExpression) Configure a SpEL expression to select messages.selectorExpression(Expression selectorExpression) Configure anExpressionto select messages.A Java MailSessionto use.shouldDeleteMessages(boolean shouldDeleteMessages) shouldMarkMessagesAsRead(boolean shouldMarkMessagesAsRead) shouldReconnectAutomatically(boolean shouldReconnectAutomatically) simpleContent(boolean simpleContent) Determine how the content is rendered.taskExecutor(Executor taskExecutor) Provide a managedExecutorto schedule a receiving IDLE task.Specify aTransactionInterceptorAdvicewith defaultPlatformTransactionManagerandDefaultTransactionAttributefor the downstream flow.transactional(TransactionInterceptor transactionInterceptor) Specify aTransactionInterceptorAdvicefor the downstream flow.transactional(TransactionManager transactionManager) Specify aTransactionInterceptorAdvicewith the providedTransactionManagerand defaultDefaultTransactionAttributefor 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, shouldTrackMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 aMimeMessagewhich should return a boolean result (true means select the message).- Parameters:
selectorExpression- the selectorExpression.- Returns:
- the spec.
-
selectorExpression
Configure anExpressionto select messages. The root object for the expression evaluation is aMimeMessagewhich should return a boolean result (true means select the message).- Parameters:
selectorExpression- the selectorExpression.- Returns:
- the spec.
-
selector
Configure aFunctionto select messages. The argument for the function is aMimeMessage;applyreturns a boolean result (true means select the message).- Parameters:
selectorFunction- the selectorFunction.- Returns:
- the spec.
- See Also:
-
session
A Java MailSessionto use.- Parameters:
session- the session.- Returns:
- the spec.
- See Also:
-
javaMailProperties
- Parameters:
javaMailProperties- the javaMailProperties.- Returns:
- the spec.
- See Also:
-
javaMailProperties
Configure thejavaMailPropertiesby invoking aConsumercallback 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 theMimeMessagecontent.- Parameters:
headerMapper- the header mapper.- Returns:
- the spec.
- See Also:
-
embeddedPartsAsBytes
When a header mapper is provided determine whether an embeddedPart(e.gMessageorMultipartcontent 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_RESOURCEheader from the message produced by this channel adapter.- Parameters:
autoCloseFolder- set tofalseto 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 ofAdviceobjects for message delivery, applied to the downstream flow.- Parameters:
adviceChain- the advice chain.- Returns:
- the spec.
-
transactional
Specify aTransactionInterceptorAdvicewith the providedTransactionManagerand defaultDefaultTransactionAttributefor the downstream flow.- Parameters:
transactionManager- theTransactionManagerto use.- Returns:
- the spec.
- Since:
- 5.2.5
-
transactional
Specify aTransactionInterceptorAdvicefor the downstream flow.- Parameters:
transactionInterceptor- theTransactionInterceptorto use.- Returns:
- the spec.
- See Also:
-
transactional
Specify aTransactionInterceptorAdvicewith defaultPlatformTransactionManagerandDefaultTransactionAttributefor 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 managedExecutorto schedule a receiving IDLE task.- Parameters:
taskExecutor- theExecutorto use.- Returns:
- the spec.
- Since:
- 6.2
-
getComponentsToRegister
- Specified by:
getComponentsToRegisterin interfaceComponentsRegistration
-