|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.file.synchronization.AbstractInboundRemoteFileSystemSynchronizingMessageSource<F,S>
public abstract class AbstractInboundRemoteFileSystemSynchronizingMessageSource<F,S extends AbstractInboundRemoteFileSystemSychronizer<F>>
Factors out the common logic between the FTP and SFTP adapters. Designed to be extensible 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 pulling from the remote file system - as you would expect from an 'inbound' adapter).
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 ofAbstractInboundRemoteFileSystemSychronizer
. The synchronizer must
handle the work of actually connecting to the remote file system and
delivering new File
s.
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 monitors the local filesystem once files are synched. |
static java.lang.String |
INCOMPLETE_EXTENSION
Extension used when downloading files. |
protected Resource |
localDirectory
Directory to which things should be synched locally. |
protected FileListFilter<F> |
remotePredicate
The predicate to use in scanning the remote File system for downloads. |
protected S |
synchronizer
An implementation that will handle the chores of actually connecting to and synching up the remote file system 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<java.io.File> |
receive()
Retrieve the next available message from this source. |
void |
setAutoCreateDirectories(boolean autoCreateDirectories)
|
void |
setLocalDirectory(Resource localDirectory)
|
void |
setRemotePredicate(FileListFilter<F> remotePredicate)
|
void |
setSynchronizer(S synchronizer)
|
Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport |
---|
doStart, doStop, sendMessage, setOutputChannel, setSendTimeout, setShouldTrack |
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint |
---|
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.integration.context.NamedComponent |
---|
getComponentName, getComponentType |
Field Detail |
---|
public static final java.lang.String INCOMPLETE_EXTENSION
protected volatile boolean autoCreateDirectories
protected volatile S extends AbstractInboundRemoteFileSystemSychronizer<F> synchronizer
protected volatile Resource localDirectory
protected volatile FileReadingMessageSource fileSource
FileReadingMessageSource
that monitors the local filesystem once files are synched.
protected FileListFilter<F> remotePredicate
Constructor Detail |
---|
public AbstractInboundRemoteFileSystemSynchronizingMessageSource()
Method Detail |
---|
public void setAutoCreateDirectories(boolean autoCreateDirectories)
public void setSynchronizer(S synchronizer)
public void setLocalDirectory(Resource localDirectory)
public void setRemotePredicate(FileListFilter<F> remotePredicate)
protected void onInit()
IntegrationObjectSupport
onInit
in class MessageProducerSupport
public Message<java.io.File> receive()
MessageSource
null
if no message is available.
receive
in interface MessageSource<java.io.File>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |