org.springframework.integration.adapter.ftp
Class FtpSource
java.lang.Object
org.springframework.integration.adapter.file.AbstractDirectorySource<java.util.List<java.io.File>>
org.springframework.integration.adapter.ftp.FtpSource
- All Implemented Interfaces:
- MessageDeliveryAware, MessageSource<java.util.List<java.io.File>>, PollableSource<java.util.List<java.io.File>>
public class FtpSource
- extends AbstractDirectorySource<java.util.List<java.io.File>>
A source adapter for receiving files via FTP.
- Author:
- Marius Bogoevici, Mark Fisher, Iwein Fuld
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private final org.apache.commons.logging.Log logger
localWorkingDirectory
private volatile java.io.File localWorkingDirectory
maxFilesPerPayload
private int maxFilesPerPayload
clientPool
private final FTPClientPool clientPool
FtpSource
public FtpSource(MessageCreator<java.util.List<java.io.File>,java.util.List<java.io.File>> messageCreator,
FTPClientPool clientPool)
setMaxMessagesPerPayload
public void setMaxMessagesPerPayload(int maxMessagesPerPayload)
setLocalWorkingDirectory
public void setLocalWorkingDirectory(java.io.File localWorkingDirectory)
refreshSnapshotAndMarkProcessing
protected void refreshSnapshotAndMarkProcessing(Backlog<FileInfo> directoryContentManager)
throws java.io.IOException
- Description copied from class:
AbstractDirectorySource
- Naive implementation that ignores thread safety. Subclasses that want to
be thread safe and use the reservation facilities of
Backlog
should override this method and call
directoryContentManager.fileProcessing(...)
with the appropriate arguments.
- Overrides:
refreshSnapshotAndMarkProcessing
in class AbstractDirectorySource<java.util.List<java.io.File>>
- Throws:
java.io.IOException
populateSnapshot
protected void populateSnapshot(java.util.Map<java.lang.String,FileInfo> snapshot)
throws java.io.IOException
- Description copied from class:
AbstractDirectorySource
- Constructs the snapshot by iterating files.
- Specified by:
populateSnapshot
in class AbstractDirectorySource<java.util.List<java.io.File>>
- Throws:
java.io.IOException
retrieveNextPayload
protected java.util.List<java.io.File> retrieveNextPayload()
throws java.io.IOException
- Description copied from class:
AbstractDirectorySource
- Returns the next file, based on the backlog data.
- Specified by:
retrieveNextPayload
in class AbstractDirectorySource<java.util.List<java.io.File>>
- Returns:
-
- Throws:
java.io.IOException
onSend
public void onSend(Message<?> message)
- Description copied from interface:
MessageDeliveryAware
- Callback method invoked after a message is sent successfully.
- Specified by:
onSend
in interface MessageDeliveryAware
- Specified by:
onSend
in class AbstractDirectorySource<java.util.List<java.io.File>>