Class RemoteFileInboundChannelAdapterSpec<F,S extends RemoteFileInboundChannelAdapterSpec<F,S,MS>,MS extends AbstractInboundFileSynchronizingMessageSource<F>>
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageSourceSpec<S,MS>
org.springframework.integration.file.dsl.RemoteFileInboundChannelAdapterSpec<F,S,MS>
- Type Parameters:
F
- the target file type.S
- the targetRemoteFileInboundChannelAdapterSpec
implementation type.MS
- the targetAbstractInboundFileSynchronizingMessageSource
implementation type.
- All Implemented Interfaces:
DisposableBean
,FactoryBean<MS>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
- Direct Known Subclasses:
FtpInboundChannelAdapterSpec
,SftpInboundChannelAdapterSpec
,SmbInboundChannelAdapterSpec
public abstract class RemoteFileInboundChannelAdapterSpec<F,S extends RemoteFileInboundChannelAdapterSpec<F,S,MS>,MS extends AbstractInboundFileSynchronizingMessageSource<F>>
extends MessageSourceSpec<S,MS>
implements ComponentsRegistration
- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ModifierConstructorDescriptionprotected
RemoteFileInboundChannelAdapterSpec
(AbstractInboundFileSynchronizer<F> synchronizer) -
Method Summary
Modifier and TypeMethodDescriptionautoCreateLocalDirectory
(boolean autoCreateLocalDirectory) Configure whether the local directory should be created by the adapter.deleteRemoteFiles
(boolean deleteRemoteFiles) Set to true to enable deletion of remote files after successful transfer.filter
(FileListFilter<F> filter) Configure aFileListFilter
to be applied to the remote files before copying them.filterExpression
(String expression) Configure theExpressionFileListFilter
.filterFunction
(Function<F, Boolean> filterFunction) Configure theExpressionFileListFilter
.localDirectory
(File localDirectory) Configure the local directory to copy files to.localFilename
(Function<String, String> localFilenameFunction) Configure aFunction
to be invoked to generate the local file name; argument passed to theapply
method is the remote file name.localFilenameExpression
(String localFilenameExpression) Configure a SpEL expression to generate the local file name; the root object for the evaluation is the remote file name.localFilenameExpression
(Expression localFilenameExpression) Configure a SpEL expression to generate the local file name; the root object for the evaluation is the remote file name.localFilter
(FileListFilter<File> localFileListFilter) AFileListFilter
used to determine which files will generate messages after they have been synchronized.maxFetchSize
(int maxFetchSize) Specify the maximum number of remote files that will be fetched on each fetch attempt.metadataStorePrefix
(String metadataStorePrefix) Configure a prefix for remote files metadata keys.abstract S
patternFilter
(String pattern) Configure a simple pattern filter (e.g.preserveTimestamp
(boolean preserveTimestamp) Set to true to enable the preservation of the remote file timestamp when transferring.abstract S
regexFilter
(String regex) Configure a regex pattern filter (e.g.remoteComparator
(Comparator<? extends F> remoteComparator) Set a comparator to sort the retrieved list ofF
(the Type that represents the remote file) prior to applying filters and max fetch size.remoteDirectory
(String remoteDirectory) Specify the full path to the remote directory.remoteDirectoryExpression
(Expression remoteDirectoryExpression) Specify an expression that evaluates to the full path to the remote directory.remoteFileMetadataStore
(MetadataStore remoteFileMetadataStore) Configure aMetadataStore
for remote files metadata.remoteFileSeparator
(String remoteFileSeparator) Configure the file name path separator used by the remote system.scanner
(DirectoryScanner scanner) Configure a scanner to use for the file system scan after transfer.temporaryFileSuffix
(String temporaryFileSuffix) Configure a suffix to temporarily apply to the local filename; when copied the file is renamed to its final name.Methods inherited from class org.springframework.integration.dsl.MessageSourceSpec
messageHeaders
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Field Details
-
synchronizer
-
-
Constructor Details
-
RemoteFileInboundChannelAdapterSpec
-
-
Method Details
-
autoCreateLocalDirectory
Configure whether the local directory should be created by the adapter.- Parameters:
autoCreateLocalDirectory
- the autoCreateLocalDirectory- Returns:
- the spec.
-
localDirectory
Configure the local directory to copy files to.- Parameters:
localDirectory
- the localDirectory.- Returns:
- the spec.
-
localFilter
AFileListFilter
used to determine which files will generate messages after they have been synchronized.- Parameters:
localFileListFilter
- the localFileListFilter.- Returns:
- the spec.
- See Also:
-
remoteFileSeparator
Configure the file name path separator used by the remote system. Defaults to '/'.- Parameters:
remoteFileSeparator
- the remoteFileSeparator.- Returns:
- the spec.
-
localFilenameExpression
Configure a SpEL expression to generate the local file name; the root object for the evaluation is the remote file name.- Parameters:
localFilenameExpression
- the localFilenameExpression.- Returns:
- the spec.
-
localFilename
Configure aFunction
to be invoked to generate the local file name; argument passed to theapply
method is the remote file name.- Parameters:
localFilenameFunction
- the localFilenameFunction.- Returns:
- the spec.
- See Also:
-
localFilenameExpression
Configure a SpEL expression to generate the local file name; the root object for the evaluation is the remote file name.- Parameters:
localFilenameExpression
- the localFilenameExpression.- Returns:
- the spec.
-
temporaryFileSuffix
Configure a suffix to temporarily apply to the local filename; when copied the file is renamed to its final name. Default: '.writing'.- Parameters:
temporaryFileSuffix
- the temporaryFileSuffix.- Returns:
- the spec.
-
remoteDirectory
Specify the full path to the remote directory.- Parameters:
remoteDirectory
- the remoteDirectory.- Returns:
- the spec.
- See Also:
-
remoteDirectoryExpression
Specify an expression that evaluates to the full path to the remote directory.- Parameters:
remoteDirectoryExpression
- The remote directory expression.- Returns:
- the spec.
-
filter
Configure aFileListFilter
to be applied to the remote files before copying them.- Parameters:
filter
- the filter.- Returns:
- the spec.
-
filterExpression
Configure theExpressionFileListFilter
.- Parameters:
expression
- the SpEL expression for files filtering.- Returns:
- the spec.
- See Also:
-
filterFunction
Configure theExpressionFileListFilter
.- Parameters:
filterFunction
- theFunction
for files filtering.- Returns:
- the spec.
- See Also:
-
patternFilter
Configure a simple pattern filter (e.g. '*.txt').- Parameters:
pattern
- the pattern.- Returns:
- the spec.
- See Also:
-
regexFilter
Configure a regex pattern filter (e.g. '[0-9].*.txt').- Parameters:
regex
- the regex.- Returns:
- the spec.
- See Also:
-
deleteRemoteFiles
Set to true to enable deletion of remote files after successful transfer.- Parameters:
deleteRemoteFiles
- true to delete.- Returns:
- the spec.
-
preserveTimestamp
Set to true to enable the preservation of the remote file timestamp when transferring.- Parameters:
preserveTimestamp
- true to preserve.- Returns:
- the spec.
-
maxFetchSize
Specify the maximum number of remote files that will be fetched on each fetch attempt. A small number is recommended when multiple application instances are running, to avoid one instance from "grabbing" all the files.- Parameters:
maxFetchSize
- the max fetch size.- Returns:
- the spec.
- See Also:
-
remoteFileMetadataStore
Configure aMetadataStore
for remote files metadata.- Parameters:
remoteFileMetadataStore
- theMetadataStore
to use.- Returns:
- the spec.
- Since:
- 5.2
- See Also:
-
metadataStorePrefix
Configure a prefix for remote files metadata keys.- Parameters:
metadataStorePrefix
- the metadata key prefix to use.- Returns:
- the spec.
- Since:
- 5.2
- See Also:
-
scanner
Configure a scanner to use for the file system scan after transfer.- Parameters:
scanner
- the scanner.- Returns:
- the spec.
- Since:
- 5.2.4
-
remoteComparator
Set a comparator to sort the retrieved list ofF
(the Type that represents the remote file) prior to applying filters and max fetch size.- Parameters:
remoteComparator
- theComparator
for remote files.- Returns:
- the spec.
- Since:
- 5.2.9
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-