|
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.AbstractInboundRemoteFileSystemSychronizer<T>
public abstract class AbstractInboundRemoteFileSystemSychronizer<T>
Strategy class charged with knowing how to connect to a remote file system, scan it for new files and then downloading the file.
The implementation should run through any configuredEntryListFilter
s
to ensure the entry is worth downloading.
Nested Class Summary | |
---|---|
static interface |
AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy<T>
Strategy interface to expose a hook for dispatching, moving, or deleting the file once it's been delivered. |
Field Summary | |
---|---|
protected AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy<T> |
entryAcknowledgmentStrategy
Used to store the AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy implementation |
protected EntryListFilter<T> |
filter
a EntryListFilter that we're running against the |
protected Resource |
localDirectory
the directory we're writing our synchronizations to |
protected ScheduledFuture<?> |
scheduledFuture
the ScheduledFuture instance we get when we schedule our AbstractInboundRemoteFileSystemSychronizer.SynchronizeTask |
protected boolean |
shouldDeleteSourceFile
Should we |
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
AbstractInboundRemoteFileSystemSychronizer()
|
Method Summary | |
---|---|
protected void |
acknowledge(Object usefulContextOrClientData,
T t)
|
protected void |
doStart()
Subclasses must implement this method with the start behavior. |
protected void |
doStop()
Subclasses must implement this method with the stop behavior. |
protected abstract Trigger |
getTrigger()
Returns a value in millis dictating how frequently the trigger should fire |
void |
setEntryAcknowledgmentStrategy(AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy<T> entryAcknowledgmentStrategy)
|
void |
setFilter(EntryListFilter<T> filter)
|
void |
setLocalDirectory(Resource localDirectory)
|
void |
setShouldDeleteSourceFile(boolean shouldDeleteSourceFile)
|
protected abstract void |
syncRemoteToLocalFileSystem()
This is the callback where we need the implementation to do some specific work |
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, getRequiredMetadataPersister, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean shouldDeleteSourceFile
AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy
implementation that knows how to delete an entry on the remote file system.
protected volatile Resource localDirectory
protected volatile EntryListFilter<T> filter
EntryListFilter
that we're running against the
protected ScheduledFuture<?> scheduledFuture
ScheduledFuture
instance we get when we schedule our AbstractInboundRemoteFileSystemSychronizer.SynchronizeTask
protected AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy<T> entryAcknowledgmentStrategy
AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy
implementation
Constructor Detail |
---|
public AbstractInboundRemoteFileSystemSychronizer()
Method Detail |
---|
public void setEntryAcknowledgmentStrategy(AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy<T> entryAcknowledgmentStrategy)
public void setShouldDeleteSourceFile(boolean shouldDeleteSourceFile)
public void setLocalDirectory(Resource localDirectory)
public void setFilter(EntryListFilter<T> filter)
protected void acknowledge(Object usefulContextOrClientData, T t) throws Throwable
usefulContextOrClientData
- this is context information to be passed to the individual AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy
implementation.
AbstractInboundRemoteFileSystemSychronizer.EntryAcknowledgmentStrategy.acknowledge(Object, Object)
will be called
in line with the MessageSource.receive()
call so this could conceivably be a 'live' stateful
client (a connection?) that is inappropriate to cache as it has per-request state.t
- leverages strategy implementations to enable different behavior. It's a hook to the entry (T
) after it's been successfully downloaded.
Conceptually, you might delete the remote one or rename it or something
Throwable
- escape hatch exception, let the adapter deal with it.protected abstract void syncRemoteToLocalFileSystem() throws Exception
Exception
- thrown if anything goes wrongprotected void doStop()
AbstractEndpoint.lifecycleLock
.
doStop
in class AbstractEndpoint
protected abstract Trigger getTrigger()
Trigger
implementation (likely,
PeriodicTrigger
)protected void doStart()
AbstractEndpoint.lifecycleLock
.
doStart
in class AbstractEndpoint
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |