Class MailInboundChannelAdapterSpec<S extends MailInboundChannelAdapterSpec<S,R>, R extends AbstractMailReceiver> 
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S, MailReceivingMessageSource>
org.springframework.integration.dsl.MessageSourceSpec<S, MailReceivingMessageSource>
org.springframework.integration.mail.dsl.MailInboundChannelAdapterSpec<S,R> 
- Type Parameters:
- S- the target- MailInboundChannelAdapterSpecimplementation type.
- R- the target- AbstractMailReceiverimplementation type.
- All Implemented Interfaces:
- DisposableBean,- FactoryBean<MailReceivingMessageSource>,- InitializingBean,- Lifecycle,- Phased,- SmartLifecycle,- ComponentsRegistration
- Direct Known Subclasses:
- ImapMailInboundChannelAdapterSpec,- Pop3MailInboundChannelAdapterSpec
public abstract class MailInboundChannelAdapterSpec<S extends MailInboundChannelAdapterSpec<S,R>, R extends AbstractMailReceiver> 
extends MessageSourceSpec<S, MailReceivingMessageSource>
implements ComponentsRegistration
- Since:
- 5.0
- Author:
- Gary Russell, Artem Bilan
- 
Field SummaryFieldsFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpeclogger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedMailInboundChannelAdapterSpec(R receiver) protectedMailInboundChannelAdapterSpec(R receiver, boolean externalReceiver) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidautoCloseFolder(boolean autoCloseFolder) When configured tofalse, the folder is not closed automatically after a fetch.doGet()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) The Java MailAuthenticator.javaMailProperties(Consumer<PropertiesBuilder> configurer) Configure thejavaMailPropertiesby invoking aConsumercallback which is invoked with aPropertiesBuilder.javaMailProperties(Properties javaMailProperties) The Java Mail properties.maxFetchSize(int maxFetchSize) The maximum for fetch size.selector(Function<MimeMessage, Boolean> selectorFunction) Configure aFunctionto select messages.selectorExpression(String selectorExpression) Configure a SpEL expression to select messages.selectorExpression(Expression selectorExpression) Configure a SpEL expression to select messages.Provide the Java MailSessionto use.shouldDeleteMessages(boolean shouldDeleteMessages) A flag to specify if messages should be deleted after receive.simpleContent(boolean simpleContent) Determine how the content is rendered.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.MessageSourceSpecmessageHeadersMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec_this, afterPropertiesSet, destroy, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Field Details- 
receiver
- 
externalReceiverprotected final boolean externalReceiver
 
- 
- 
Constructor Details- 
MailInboundChannelAdapterSpec
- 
MailInboundChannelAdapterSpec
 
- 
- 
Method Details- 
selectorExpressionConfigure 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.
 
- 
assertReceiverprotected void assertReceiver()
- 
selectorExpressionConfigure 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.
 
- 
selectorConfigure 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
- 
javaMailPropertiesThe Java Mail properties.- Parameters:
- javaMailProperties- the javaMailProperties.
- Returns:
- the spec.
- See Also:
 
- 
javaMailPropertiesConfigure thejavaMailPropertiesby invoking aConsumercallback which is invoked with aPropertiesBuilder.- Parameters:
- configurer- the configurer.
- Returns:
- the spec.
- See Also:
 
- 
javaMailAuthenticatorThe Java MailAuthenticator.- Parameters:
- javaMailAuthenticator- the javaMailAuthenticator.
- Returns:
- the spec.
- See Also:
 
- 
maxFetchSizeThe maximum for fetch size.- Parameters:
- maxFetchSize- the maxFetchSize.
- Returns:
- the spec.
- See Also:
 
- 
shouldDeleteMessagesA flag to specify if messages should be deleted after receive.- Parameters:
- shouldDeleteMessages- the shouldDeleteMessages.
- Returns:
- the spec.
- See Also:
 
- 
userFlagSet 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:
 
- 
headerMapperSet 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:
 
- 
embeddedPartsAsBytesWhen 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:
 
- 
simpleContentDetermine how the content is rendered.- Parameters:
- simpleContent- true for simple content.
- Returns:
- the spec.
- See Also:
 
- 
autoCloseFolderWhen 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 to- falseto keep folder opened.
- Returns:
- the spec.
- Since:
- 5.2
- See Also:
 
- 
getComponentsToRegister- Specified by:
- getComponentsToRegisterin interface- ComponentsRegistration
 
- 
doGet- Overrides:
- doGetin class- IntegrationComponentSpec<S extends MailInboundChannelAdapterSpec<S,- R>, MailReceivingMessageSource> 
 
 
-