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 target RemoteFileInboundChannelAdapterSpec implementation type.
MS - the target AbstractInboundFileSynchronizingMessageSource implementation type.
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<MS>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.integration.dsl.ComponentsRegistration

public abstract class RemoteFileInboundChannelAdapterSpec<F,S extends RemoteFileInboundChannelAdapterSpec<F,S,MS>,MS extends AbstractInboundFileSynchronizingMessageSource<F>> extends org.springframework.integration.dsl.MessageSourceSpec<S,MS> implements org.springframework.integration.dsl.ComponentsRegistration
Since:
5.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     

    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

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    autoCreateLocalDirectory(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.
    Configure a FileListFilter to be applied to the remote files before copying them.
    filterFunction(Function<F,Boolean> filterFunction)
     
    localDirectory(File localDirectory)
    Configure the local directory to copy files to.
    localFilename(Function<String,String> localFilenameFunction)
    Configure a Function to be invoked to generate the local file name; argument passed to the apply 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(org.springframework.expression.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)
    A FileListFilter 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
    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
    Configure a regex pattern filter (e.g.
    remoteComparator(Comparator<? extends F> remoteComparator)
    Set a comparator to sort the retrieved list of F (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(org.springframework.expression.Expression remoteDirectoryExpression)
    Specify an expression that evaluates to the full path to the remote directory.
    remoteFileMetadataStore(org.springframework.integration.metadata.MetadataStore remoteFileMetadataStore)
    Configure a MetadataStore for remote files metadata.
    remoteFileSeparator(String remoteFileSeparator)
    Configure the file name path separator used by the remote system.
    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, get, 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

  • Constructor Details

  • Method Details

    • autoCreateLocalDirectory

      public S autoCreateLocalDirectory(boolean autoCreateLocalDirectory)
      Configure whether the local directory should be created by the adapter.
      Parameters:
      autoCreateLocalDirectory - the autoCreateLocalDirectory
      Returns:
      the spec.
    • localDirectory

      public S localDirectory(File localDirectory)
      Configure the local directory to copy files to.
      Parameters:
      localDirectory - the localDirectory.
      Returns:
      the spec.
    • localFilter

      public S localFilter(FileListFilter<File> localFileListFilter)
      A FileListFilter used to determine which files will generate messages after they have been synchronized.
      Parameters:
      localFileListFilter - the localFileListFilter.
      Returns:
      the spec.
      See Also:
    • remoteFileSeparator

      public S remoteFileSeparator(String remoteFileSeparator)
      Configure the file name path separator used by the remote system. Defaults to '/'.
      Parameters:
      remoteFileSeparator - the remoteFileSeparator.
      Returns:
      the spec.
    • localFilenameExpression

      public S localFilenameExpression(String 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

      public S localFilename(Function<String,String> localFilenameFunction)
      Configure a Function to be invoked to generate the local file name; argument passed to the apply method is the remote file name.
      Parameters:
      localFilenameFunction - the localFilenameFunction.
      Returns:
      the spec.
      See Also:
      • FunctionExpression
    • localFilenameExpression

      public S localFilenameExpression(org.springframework.expression.Expression 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

      public S temporaryFileSuffix(String 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

      public S remoteDirectory(String remoteDirectory)
      Specify the full path to the remote directory.
      Parameters:
      remoteDirectory - the remoteDirectory.
      Returns:
      the spec.
      See Also:
    • remoteDirectoryExpression

      public S remoteDirectoryExpression(org.springframework.expression.Expression remoteDirectoryExpression)
      Specify an expression that evaluates to the full path to the remote directory.
      Parameters:
      remoteDirectoryExpression - The remote directory expression.
      Returns:
      the spec.
    • filter

      public S filter(FileListFilter<F> filter)
      Configure a FileListFilter to be applied to the remote files before copying them.
      Parameters:
      filter - the filter.
      Returns:
      the spec.
    • filterExpression

      public S filterExpression(String expression)
      Parameters:
      expression - the SpEL expression for files filtering.
      Returns:
      the spec.
      See Also:
    • filterFunction

      public S filterFunction(Function<F,Boolean> filterFunction)
      Parameters:
      filterFunction - the Function for files filtering.
      Returns:
      the spec.
      See Also:
    • patternFilter

      public abstract S patternFilter(String pattern)
      Configure a simple pattern filter (e.g. '*.txt').
      Parameters:
      pattern - the pattern.
      Returns:
      the spec.
      See Also:
    • regexFilter

      public abstract S regexFilter(String regex)
      Configure a regex pattern filter (e.g. '[0-9].*.txt').
      Parameters:
      regex - the regex.
      Returns:
      the spec.
      See Also:
    • deleteRemoteFiles

      public S deleteRemoteFiles(boolean deleteRemoteFiles)
      Set to true to enable deletion of remote files after successful transfer.
      Parameters:
      deleteRemoteFiles - true to delete.
      Returns:
      the spec.
    • preserveTimestamp

      public S preserveTimestamp(boolean preserveTimestamp)
      Set to true to enable the preservation of the remote file timestamp when transferring.
      Parameters:
      preserveTimestamp - true to preserve.
      Returns:
      the spec.
    • maxFetchSize

      public S maxFetchSize(int 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:
      • MessageSourceManagement.setMaxFetchSize(int)
    • remoteFileMetadataStore

      public S remoteFileMetadataStore(org.springframework.integration.metadata.MetadataStore remoteFileMetadataStore)
      Configure a MetadataStore for remote files metadata.
      Parameters:
      remoteFileMetadataStore - the MetadataStore to use.
      Returns:
      the spec.
      Since:
      5.2
      See Also:
    • metadataStorePrefix

      public S metadataStorePrefix(String 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

      public S scanner(DirectoryScanner 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

      public S remoteComparator(Comparator<? extends F> remoteComparator)
      Set a comparator to sort the retrieved list of F (the Type that represents the remote file) prior to applying filters and max fetch size.
      Parameters:
      remoteComparator - the Comparator for remote files.
      Returns:
      the spec.
      Since:
      5.2.9
    • getComponentsToRegister

      public Map<Object,String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface org.springframework.integration.dsl.ComponentsRegistration