org.apache.camel.component.file.remote
Class RemoteFileConsumer<T extends RemoteFileExchange>
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultConsumer<E>
org.apache.camel.impl.ScheduledPollConsumer<T>
org.apache.camel.component.file.remote.RemoteFileConsumer<T>
- All Implemented Interfaces:
- Runnable, Consumer<T>, Service
- Direct Known Subclasses:
- FtpConsumer, SftpConsumer
public abstract class RemoteFileConsumer<T extends RemoteFileExchange>
- extends ScheduledPollConsumer<T>
Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer |
doStart, doStop, getDelay, getInitialDelay, getTimeUnit, isUseFixedDelay, poll, run, setDelay, setInitialDelay, setTimeUnit, setUseFixedDelay |
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop |
log
protected final transient org.apache.commons.logging.Log log
endpoint
protected RemoteFileEndpoint<T extends RemoteFileExchange> endpoint
lastPollTime
protected long lastPollTime
recursive
protected boolean recursive
regexPattern
protected String regexPattern
setNames
protected boolean setNames
exclusiveReadLock
protected boolean exclusiveReadLock
deleteFile
protected boolean deleteFile
moveNamePrefix
protected String moveNamePrefix
moveNamePostfix
protected String moveNamePostfix
excludedNamePrefix
protected String excludedNamePrefix
excludedNamePostfix
protected String excludedNamePostfix
RemoteFileConsumer
public RemoteFileConsumer(RemoteFileEndpoint<T> endpoint,
Processor processor)
RemoteFileConsumer
public RemoteFileConsumer(RemoteFileEndpoint<T> endpoint,
Processor processor,
ScheduledExecutorService executor)
getFileName
protected abstract String getFileName(Object file)
- Gets the filename.
- Parameters:
file
- the file object for the given consumer implementation.
- Returns:
- the filename as String.
isMatched
protected boolean isMatched(Object file)
- Is the given file matched to be consumed.
isMoveFile
protected boolean isMoveFile()
- Should the file be moved after consuming?
getMoveFileName
protected String getMoveFileName(String name,
Exchange exchange)
- Gets the to filename for moving.
- Parameters:
name
- the original filenameexchange
- the current exchange
- Returns:
- the move filename
remoteServer
protected String remoteServer()
isRecursive
public boolean isRecursive()
setRecursive
public void setRecursive(boolean recursive)
getLastPollTime
public long getLastPollTime()
setLastPollTime
public void setLastPollTime(long lastPollTime)
getRegexPattern
public String getRegexPattern()
setRegexPattern
public void setRegexPattern(String regexPattern)
isSetNames
public boolean isSetNames()
setSetNames
public void setSetNames(boolean setNames)
isExclusiveReadLock
public boolean isExclusiveReadLock()
setExclusiveReadLock
public void setExclusiveReadLock(boolean exclusiveReadLock)
isDeleteFile
public boolean isDeleteFile()
setDeleteFile
public void setDeleteFile(boolean deleteFile)
getMoveNamePrefix
public String getMoveNamePrefix()
setMoveNamePrefix
public void setMoveNamePrefix(String moveNamePrefix)
getMoveNamePostfix
public String getMoveNamePostfix()
setMoveNamePostfix
public void setMoveNamePostfix(String moveNamePostfix)
getExcludedNamePrefix
public String getExcludedNamePrefix()
setExcludedNamePrefix
public void setExcludedNamePrefix(String excludedNamePrefix)
getExcludedNamePostfix
public String getExcludedNamePostfix()
setExcludedNamePostfix
public void setExcludedNamePostfix(String excludedNamePostfix)
isTimestamp
public boolean isTimestamp()
- Deprecated. the timestamp feature will be removed in Camel 2.0
setTimestamp
public void setTimestamp(boolean timestamp)
- Deprecated. the timestamp feature will be removed in Camel 2.0
- Sets wether polling should use last poll timestamp for filtering only new files.
Apache CAMEL