|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.context.IntegrationObjectSupport org.springframework.integration.endpoint.AbstractEndpoint org.springframework.integration.file.AbstractInboundRemoteFileSystemSynchronizingMessageSource<Y,T>
public abstract class AbstractInboundRemoteFileSystemSynchronizingMessageSource<Y,T extends AbstractInboundRemoteFileSystemSychronizer<Y>>
Ultimately, this factors out a lot of the common logic between the FTP and SFTP adapters. Designed to be extendable to handle adapters whose task it is to synchronize a remote file system with a local file system (NB: this does *NOT* handle pushing files TO the remote file system that exist uniquely in the local file system. It only handles bringing down the remote file system - as you'd expect an 'inbound' adapter would).
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 implementaton specific). This class is to be used as a pair with an implementation oforg.springframework.integration.file.AbstractInboundRemoteFileSystemSychronizer
. This synchronizer
must handle the work of actually connecting to the remote file system and delivering new File
s.
The synchronizer is designed to be
Field Summary | |
---|---|
protected boolean |
autoCreateDirectories
Should the endpoint attempt to create the local directory and / or the remote directory? |
protected FileReadingMessageSource |
fileSource
The actual FileReadingMessageSource that we continue to trust to do the job monitoring the filesystem once files are moved down |
static String |
INCOMPLETE_EXTENSION
Extension used when downloading files. |
protected Resource |
localDirectory
What directory should things be synced to locally ? |
protected EntryListFilter<Y> |
remotePredicate
The predicate to use in scanning the remote Fs for downloads |
protected T |
synchronizer
An implementation that will handle the chores of actually connecting to and syncing up the remote FS with the local one, in an inbound direction |
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
AbstractInboundRemoteFileSystemSynchronizingMessageSource()
|
Method Summary | |
---|---|
protected void |
onInit()
Subclasses may implement this for initialization logic. |
Message<File> |
receive()
Retrieve the next available message from this source. |
void |
setAutoCreateDirectories(boolean autoCreateDirectories)
|
void |
setLocalDirectory(Resource localDirectory)
|
void |
setRemotePredicate(EntryListFilter<Y> remotePredicate)
|
void |
setSynchronizer(T synchronizer)
|
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint |
---|
doStart, doStop, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getRequiredMetadataPersister, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String INCOMPLETE_EXTENSION
protected volatile boolean autoCreateDirectories
protected volatile T extends AbstractInboundRemoteFileSystemSychronizer<Y> synchronizer
protected volatile Resource localDirectory
protected volatile FileReadingMessageSource fileSource
FileReadingMessageSource
that we continue to trust to do the job monitoring the filesystem once files are moved down
protected EntryListFilter<Y> remotePredicate
Constructor Detail |
---|
public AbstractInboundRemoteFileSystemSynchronizingMessageSource()
Method Detail |
---|
public void setAutoCreateDirectories(boolean autoCreateDirectories)
public void setSynchronizer(T synchronizer)
public void setLocalDirectory(Resource localDirectory)
public void setRemotePredicate(EntryListFilter<Y> remotePredicate)
protected void onInit() throws Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
Exception
public Message<File> receive()
MessageSource
null
if no message is available.
receive
in interface MessageSource<File>
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |