public abstract class AbstractInboundFileSynchronizingMessageSource<F>
extends org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<java.io.File>
implements org.springframework.context.Lifecycle
The base class supports configuration of whether the remote file system and local file system's directories should be created on start (what 'creating a directory' means to the specific adapter is of course implementation specific).
This class is to be used as a pair with an implementation of
AbstractInboundFileSynchronizer. The synchronizer must
handle the work of actually connecting to the remote file system and
delivering new Files.
| Constructor and Description |
|---|
AbstractInboundFileSynchronizingMessageSource(AbstractInboundFileSynchronizer<F> synchronizer) |
AbstractInboundFileSynchronizingMessageSource(AbstractInboundFileSynchronizer<F> synchronizer,
java.util.Comparator<java.io.File> comparator) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.integration.support.AbstractIntegrationMessageBuilder<java.io.File> |
doReceive(int maxFetchSize)
Polls from the file source.
|
AbstractInboundFileSynchronizer<F> |
getSynchronizer()
Return the underlying synchronizer.
|
boolean |
isRunning() |
protected void |
onInit() |
void |
setAutoCreateLocalDirectory(boolean autoCreateLocalDirectory) |
void |
setLocalDirectory(java.io.File localDirectory) |
void |
setLocalFilter(FileListFilter<java.io.File> localFileListFilter)
A
FileListFilter used to determine which files will generate messages
after they have been synchronized. |
void |
setScanner(DirectoryScanner scanner)
Switch the local
FileReadingMessageSource to use a custom
DirectoryScanner. |
void |
setUseWatchService(boolean useWatchService)
Switch the local
FileReadingMessageSource to use its internal
FileReadingMessageSource.WatchServiceDirectoryScanner. |
void |
start() |
void |
stop() |
doReceive, getMaxFetchSize, setMaxFetchSizebuildMessage, getComponentName, getManagedName, getManagedType, getMessageCount, getMessageCountLong, getOverrides, isCountsEnabled, isLoggingEnabled, receive, registerMetricsCaptor, reset, setBeanName, setCountsEnabled, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedTypeafterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionServiceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetManagedName, getManagedType, getMessageCount, getMessageCountLong, setCounter, setManagedName, setManagedTypepublic AbstractInboundFileSynchronizingMessageSource(AbstractInboundFileSynchronizer<F> synchronizer)
public AbstractInboundFileSynchronizingMessageSource(AbstractInboundFileSynchronizer<F> synchronizer, java.util.Comparator<java.io.File> comparator)
public void setAutoCreateLocalDirectory(boolean autoCreateLocalDirectory)
public void setLocalDirectory(java.io.File localDirectory)
public void setLocalFilter(FileListFilter<java.io.File> localFileListFilter)
FileListFilter used to determine which files will generate messages
after they have been synchronized. It will be combined with a filter that
will prevent accessing files that are in the process of being synchronized
(files having the AbstractInboundFileSynchronizer.getTemporaryFileSuffix()).
The default is an FileSystemPersistentAcceptOnceFileListFilter
which filters duplicate file names (processed during the current execution).
localFileListFilter - The local file list filter.public void setUseWatchService(boolean useWatchService)
FileReadingMessageSource to use its internal
FileReadingMessageSource.WatchServiceDirectoryScanner.useWatchService - the boolean flag to switch to
FileReadingMessageSource.WatchServiceDirectoryScanner on true.public void setScanner(DirectoryScanner scanner)
FileReadingMessageSource to use a custom
DirectoryScanner.scanner - the DirectoryScanner to use.public AbstractInboundFileSynchronizer<F> getSynchronizer()
protected void onInit()
onInit in class org.springframework.integration.util.AbstractExpressionEvaluatorpublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic final org.springframework.integration.support.AbstractIntegrationMessageBuilder<java.io.File> doReceive(int maxFetchSize)
doReceive in class org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<java.io.File>maxFetchSize - the maximum files to fetch.