Class AbstractRemoteFileStreamingMessageSource<F>
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<InputStream>
org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<InputStream>
org.springframework.integration.file.remote.AbstractRemoteFileStreamingMessageSource<F>
- Type Parameters:
- F- The target protocol file type.
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- Lifecycle,- MessageSource<InputStream>,- IntegrationPattern,- NamedComponent,- IntegrationInboundManagement,- IntegrationManagement,- ManageableLifecycle,- MessageSourceManagement
- Direct Known Subclasses:
- FtpStreamingMessageSource,- SftpStreamingMessageSource,- SmbStreamingMessageSource
public abstract class AbstractRemoteFileStreamingMessageSource<F>
extends AbstractFetchLimitingMessageSource<InputStream>
implements ManageableLifecycle
A message source that produces a message with an 
InputStream payload
 referencing a remote file.- Since:
- 4.3
- Author:
- Gary Russell, Artem Bilan, Lukas Gemela, Trung Pham
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.util.AbstractExpressionEvaluatorEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractRemoteFileStreamingMessageSource(RemoteFileTemplate<? extends F> template, Comparator<? extends F> comparator) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract List<AbstractFileInfo<F>> asFileInfoList(Collection<F> files) protected voiddoInit()Subclasses can override to perform initialization - called fromInitializingBean.afterPropertiesSet().protected ObjectdoReceive(int maxFetchSize) Subclasses must implement this method.protected final voiddoSetFilter(FileListFilter<F> filterToSet) protected RemoteFileTemplate<? extends F> protected abstract booleanisDirectory(F file) booleanfinal voidonInit()protected AbstractFileInfo<F> poll()protected StringremotePath(AbstractFileInfo<F> file) protected voidrollbackFromFileToListEnd(List<F> filteredFiles, F file) voidsetFileInfoJson(boolean fileInfoJson) voidsetFilter(FileListFilter<F> filter) Set the filter to be applied to the remote files before transferring.voidsetRemoteDirectory(String remoteDirectory) Specify the full path to the remote directory.voidsetRemoteDirectoryExpression(Expression remoteDirectoryExpression) Specify an expression that evaluates to the full path to the remote directory.voidsetRemoteFileSeparator(String remoteFileSeparator) Set the remote file separator; default '/'.voidsetStrictOrder(boolean strictOrder) The flag indicating if the local cache has to be fully clear on failure to preserve a processing order of remote files on the nextAbstractMessageSource.receive()attempt.voidstart()voidstop()Methods inherited from class org.springframework.integration.endpoint.AbstractFetchLimitingMessageSourcedoReceive, getMaxFetchSize, setMaxFetchSizeMethods inherited from class org.springframework.integration.endpoint.AbstractMessageSourcebuildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedTypeMethods inherited from class org.springframework.integration.util.AbstractExpressionEvaluatorafterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionServiceMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAs, isObserved, registerObservationRegistryMethods inherited from interface org.springframework.integration.core.MessageSourcegetIntegrationPatternTypeMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetComponentType
- 
Constructor Details- 
AbstractRemoteFileStreamingMessageSourceprotected AbstractRemoteFileStreamingMessageSource(RemoteFileTemplate<? extends F> template, @Nullable Comparator<? extends F> comparator) 
 
- 
- 
Method Details- 
setRemoteDirectorySpecify the full path to the remote directory.- Parameters:
- remoteDirectory- The remote directory.
 
- 
setRemoteDirectoryExpressionSpecify an expression that evaluates to the full path to the remote directory.- Parameters:
- remoteDirectoryExpression- The remote directory expression.
 
- 
setRemoteFileSeparatorSet the remote file separator; default '/'.- Parameters:
- remoteFileSeparator- the remote file separator.
 
- 
setFilterSet the filter to be applied to the remote files before transferring.- Parameters:
- filter- the file list filter.
 
- 
doSetFilter
- 
setFileInfoJsonpublic void setFileInfoJson(boolean fileInfoJson) Set tofalseto add theFileHeaders.REMOTE_FILE_INFOheader to the rawFileInfo. Default is true meaning that common file information properties are provided in that header as JSON.- Parameters:
- fileInfoJson- false to set the raw object.
- Since:
- 5.0
 
- 
setStrictOrderpublic void setStrictOrder(boolean strictOrder) The flag indicating if the local cache has to be fully clear on failure to preserve a processing order of remote files on the nextAbstractMessageSource.receive()attempt. By default, only the failed file will be re-fetched from remote directory, but only when local cache is already empty, essential out of order.- Parameters:
- strictOrder- if cached files has to be cleared on failure.
- Since:
- 5.5.17
 
- 
getRemoteFileTemplate
- 
onInitpublic final void onInit()- Overrides:
- onInitin class- AbstractExpressionEvaluator
 
- 
doInitprotected void doInit()Subclasses can override to perform initialization - called fromInitializingBean.afterPropertiesSet().
- 
startpublic void start()- Specified by:
- startin interface- Lifecycle
- Specified by:
- startin interface- ManageableLifecycle
 
- 
stoppublic void stop()- Specified by:
- stopin interface- Lifecycle
- Specified by:
- stopin interface- ManageableLifecycle
 
- 
isRunningpublic boolean isRunning()- Specified by:
- isRunningin interface- Lifecycle
- Specified by:
- isRunningin interface- ManageableLifecycle
 
- 
doReceiveDescription copied from class:AbstractFetchLimitingMessageSourceSubclasses must implement this method. Typically the returned value will be the payload of type T, but the returned value may also be a Message instance whose payload is of type T.- Specified by:
- doReceivein class- AbstractFetchLimitingMessageSource<InputStream>
- Parameters:
- maxFetchSize- the maximum number of messages to fetch if a fetch is necessary.
- Returns:
- The value returned.
 
- 
poll
- 
remotePath
- 
rollbackFromFileToListEnd
- 
asFileInfoList
- 
isDirectory
 
-