S - the target MailInboundChannelAdapterSpec implementation type.R - the target AbstractMailReceiver implementation type.public abstract class MailInboundChannelAdapterSpec<S extends MailInboundChannelAdapterSpec<S,R>,R extends AbstractMailReceiver> extends org.springframework.integration.dsl.MessageSourceSpec<S,MailReceivingMessageSource> implements org.springframework.integration.dsl.ComponentsRegistration
MessageSourceSpec for a MailReceivingMessageSource.| Modifier and Type | Field and Description | 
|---|---|
protected boolean | 
externalReceiver  | 
protected R | 
receiver  | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
MailInboundChannelAdapterSpec(R receiver)  | 
protected  | 
MailInboundChannelAdapterSpec(R receiver,
                             boolean externalReceiver)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
assertReceiver()  | 
S | 
autoCloseFolder(boolean autoCloseFolder)
When configured to  
false, the folder is not closed automatically after a fetch. | 
MailReceivingMessageSource | 
doGet()  | 
S | 
embeddedPartsAsBytes(boolean embeddedPartsAsBytes)
When a header mapper is provided determine whether an embedded
  
Part (e.g Message or
 Multipart content is rendered as a byte[] in the payload. | 
java.util.Map<java.lang.Object,java.lang.String> | 
getComponentsToRegister()  | 
S | 
headerMapper(org.springframework.integration.mapping.HeaderMapper<javax.mail.internet.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. | 
S | 
javaMailAuthenticator(javax.mail.Authenticator javaMailAuthenticator)
The Java Mail  
Authenticator. | 
S | 
javaMailProperties(java.util.function.Consumer<org.springframework.integration.support.PropertiesBuilder> configurer)
Configure the  
javaMailProperties by invoking a Consumer callback which
 is invoked with a PropertiesBuilder. | 
S | 
javaMailProperties(java.util.Properties javaMailProperties)
The Java Mail properties. 
 | 
S | 
maxFetchSize(int maxFetchSize)
The maximum for fetch size. 
 | 
S | 
selector(java.util.function.Function<javax.mail.internet.MimeMessage,java.lang.Boolean> selectorFunction)
Configure a  
Function to select messages. | 
S | 
selectorExpression(org.springframework.expression.Expression selectorExpression)
Configure a SpEL expression to select messages. 
 | 
S | 
selectorExpression(java.lang.String selectorExpression)
Configure a SpEL expression to select messages. 
 | 
S | 
session(javax.mail.Session session)
Provide the Java Mail  
Session to use. | 
S | 
shouldDeleteMessages(boolean shouldDeleteMessages)
A flag to specify if messages should be deleted after receive. 
 | 
S | 
simpleContent(boolean simpleContent)
Determine how the content is rendered. 
 | 
S | 
userFlag(java.lang.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 . 
 | 
_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopprotected final R extends AbstractMailReceiver receiver
protected final boolean externalReceiver
protected MailInboundChannelAdapterSpec(R receiver)
protected MailInboundChannelAdapterSpec(R receiver, boolean externalReceiver)
public S selectorExpression(java.lang.String selectorExpression)
MimeMessage which should return a boolean
 result (true means select the message).selectorExpression - the selectorExpression.protected void assertReceiver()
public S selectorExpression(org.springframework.expression.Expression selectorExpression)
MimeMessage which should return a boolean
 result (true means select the message).selectorExpression - the selectorExpression.public S selector(java.util.function.Function<javax.mail.internet.MimeMessage,java.lang.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.FunctionExpressionpublic S session(javax.mail.Session session)
Session to use.session - the session.AbstractMailReceiver.setSession(Session)public S javaMailProperties(java.util.Properties javaMailProperties)
javaMailProperties - the javaMailProperties.AbstractMailReceiver.setJavaMailProperties(Properties)public S javaMailProperties(java.util.function.Consumer<org.springframework.integration.support.PropertiesBuilder> configurer)
javaMailProperties by invoking a Consumer callback which
 is invoked with a PropertiesBuilder.configurer - the configurer.AbstractMailReceiver.setJavaMailProperties(Properties)public S javaMailAuthenticator(javax.mail.Authenticator javaMailAuthenticator)
Authenticator.javaMailAuthenticator - the javaMailAuthenticator.AbstractMailReceiver.setJavaMailAuthenticator(Authenticator)public S maxFetchSize(int maxFetchSize)
maxFetchSize - the maxFetchSize.AbstractMailReceiver.setMaxFetchSize(int)public S shouldDeleteMessages(boolean shouldDeleteMessages)
shouldDeleteMessages - the shouldDeleteMessages.AbstractMailReceiver.setShouldDeleteMessages(boolean)public S userFlag(java.lang.String userFlag)
userFlag - the flag.AbstractMailReceiver.setUserFlag(String)public S headerMapper(org.springframework.integration.mapping.HeaderMapper<javax.mail.internet.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 S 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 S simpleContent(boolean simpleContent)
simpleContent - true for simple content.AbstractMailReceiver.setSimpleContent(boolean)public S 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 java.util.Map<java.lang.Object,java.lang.String> getComponentsToRegister()
getComponentsToRegister in interface org.springframework.integration.dsl.ComponentsRegistrationpublic MailReceivingMessageSource doGet()
doGet in class org.springframework.integration.dsl.IntegrationComponentSpec<S extends MailInboundChannelAdapterSpec<S,R>,MailReceivingMessageSource>