public abstract class AbstractRemoteFileStreamingMessageSource<F> extends AbstractFetchLimitingMessageSource<InputStream> implements ManageableLifecycle
InputStream payload
referencing a remote file.IntegrationManagement.ManagementOverridesEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRemoteFileStreamingMessageSource(RemoteFileTemplate<F> template,
Comparator<F> comparator) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract List<AbstractFileInfo<F>> |
asFileInfoList(Collection<F> files) |
protected void |
doInit()
Subclasses can override to perform initialization - called from
InitializingBean.afterPropertiesSet(). |
protected Object |
doReceive(int maxFetchSize)
Subclasses must implement this method.
|
protected void |
doSetFilter(FileListFilter<F> filterToSet) |
protected RemoteFileTemplate<F> |
getRemoteFileTemplate() |
protected abstract boolean |
isDirectory(F file) |
boolean |
isRunning() |
void |
onInit() |
protected AbstractFileInfo<F> |
poll() |
protected String |
remotePath(AbstractFileInfo<F> file) |
protected void |
rollbackFromFileToListEnd(List<F> filteredFiles,
F file) |
void |
setFileInfoJson(boolean fileInfoJson)
Set to false to add the
FileHeaders.REMOTE_FILE_INFO header to the raw FileInfo. |
void |
setFilter(FileListFilter<F> filter)
Set the filter to be applied to the remote files before transferring.
|
void |
setRemoteDirectory(String remoteDirectory)
Specify the full path to the remote directory.
|
void |
setRemoteDirectoryExpression(Expression remoteDirectoryExpression)
Specify an expression that evaluates to the full path to the remote directory.
|
void |
setRemoteFileSeparator(String remoteFileSeparator)
Set the remote file separator; default '/'
|
void |
start() |
void |
stop() |
doReceive, getMaxFetchSize, setMaxFetchSizebuildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedTypeafterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionServiceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIntegrationPatternTypegetThisAsgetComponentTypeprotected AbstractRemoteFileStreamingMessageSource(RemoteFileTemplate<F> template, @Nullable Comparator<F> comparator)
public void setRemoteDirectory(String remoteDirectory)
remoteDirectory - The remote directory.public void setRemoteDirectoryExpression(Expression remoteDirectoryExpression)
remoteDirectoryExpression - The remote directory expression.public void setRemoteFileSeparator(String remoteFileSeparator)
remoteFileSeparator - the remote file separator.public void setFilter(FileListFilter<F> filter)
filter - the file list filter.protected final void doSetFilter(FileListFilter<F> filterToSet)
public void setFileInfoJson(boolean fileInfoJson)
FileHeaders.REMOTE_FILE_INFO header to the raw FileInfo.
Default is true meaning that common file information properties are provided
in that header as JSON.fileInfoJson - false to set the raw object.protected RemoteFileTemplate<F> getRemoteFileTemplate()
public final void onInit()
onInit in class AbstractExpressionEvaluatorprotected void doInit()
InitializingBean.afterPropertiesSet().public void start()
start in interface Lifecyclestart in interface ManageableLifecyclepublic void stop()
stop in interface Lifecyclestop in interface ManageableLifecyclepublic boolean isRunning()
isRunning in interface LifecycleisRunning in interface ManageableLifecycleprotected Object doReceive(int maxFetchSize)
AbstractFetchLimitingMessageSourcedoReceive in class AbstractFetchLimitingMessageSource<InputStream>maxFetchSize - the maximum number of messages to fetch if a fetch is
necessary.protected AbstractFileInfo<F> poll()
protected String remotePath(AbstractFileInfo<F> file)
protected abstract List<AbstractFileInfo<F>> asFileInfoList(Collection<F> files)
protected abstract boolean isDirectory(F file)