org.apache.camel.component.file.remote
Class RemoteFileConsumer<T extends RemoteFileExchange>

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultConsumer<E>
          extended by org.apache.camel.impl.ScheduledPollConsumer<T>
              extended by 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>


Field Summary
protected  boolean deleteFile
           
protected  RemoteFileEndpoint<T> endpoint
           
protected  String excludedNamePostfix
           
protected  String excludedNamePrefix
           
protected  boolean exclusiveReadLock
           
protected  long lastPollTime
           
protected  org.apache.commons.logging.Log log
           
protected  String moveNamePostfix
           
protected  String moveNamePrefix
           
protected  boolean recursive
           
protected  String regexPattern
           
protected  boolean setNames
           
 
Constructor Summary
RemoteFileConsumer(RemoteFileEndpoint<T> endpoint, Processor processor)
           
RemoteFileConsumer(RemoteFileEndpoint<T> endpoint, Processor processor, ScheduledExecutorService executor)
           
 
Method Summary
 String getExcludedNamePostfix()
           
 String getExcludedNamePrefix()
           
protected abstract  String getFileName(Object file)
          Gets the filename.
 long getLastPollTime()
           
protected  String getMoveFileName(String name, Exchange exchange)
          Gets the to filename for moving.
 String getMoveNamePostfix()
           
 String getMoveNamePrefix()
           
 String getRegexPattern()
           
 boolean isDeleteFile()
           
 boolean isExclusiveReadLock()
           
protected  boolean isMatched(Object file)
          Is the given file matched to be consumed.
protected  boolean isMoveFile()
          Should the file be moved after consuming?
 boolean isRecursive()
           
 boolean isSetNames()
           
 boolean isTimestamp()
          Deprecated. the timestamp feature will be removed in Camel 2.0
protected  String remoteServer()
           
 void setDeleteFile(boolean deleteFile)
           
 void setExcludedNamePostfix(String excludedNamePostfix)
           
 void setExcludedNamePrefix(String excludedNamePrefix)
           
 void setExclusiveReadLock(boolean exclusiveReadLock)
           
 void setLastPollTime(long lastPollTime)
           
 void setMoveNamePostfix(String moveNamePostfix)
           
 void setMoveNamePrefix(String moveNamePrefix)
           
 void setRecursive(boolean recursive)
           
 void setRegexPattern(String regexPattern)
           
 void setSetNames(boolean setNames)
           
 void setTimestamp(boolean timestamp)
          Deprecated. the timestamp feature will be removed in Camel 2.0
 
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.DefaultConsumer
getAsyncProcessor, getEndpoint, getExceptionHandler, getProcessor, handleException, setExceptionHandler, toString
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Field Detail

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
Constructor Detail

RemoteFileConsumer

public RemoteFileConsumer(RemoteFileEndpoint<T> endpoint,
                          Processor processor)

RemoteFileConsumer

public RemoteFileConsumer(RemoteFileEndpoint<T> endpoint,
                          Processor processor,
                          ScheduledExecutorService executor)
Method Detail

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 filename
exchange - 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