org.apache.camel.component.file.remote
Class FtpConsumer

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<RemoteFileExchange>
                  extended by org.apache.camel.component.file.remote.FtpConsumer
All Implemented Interfaces:
Runnable, Consumer<RemoteFileExchange>, Service

public class FtpConsumer
extends RemoteFileConsumer<RemoteFileExchange>


Field Summary
 
Fields inherited from class org.apache.camel.component.file.remote.RemoteFileConsumer
deleteFile, excludedNamePostfix, excludedNamePrefix, exclusiveReadLock, lastPollTime, log, moveNamePostfix, moveNamePrefix, recursive, regexPattern, setNames
 
Constructor Summary
FtpConsumer(FtpEndpoint endpoint, Processor processor, org.apache.commons.net.ftp.FTPClient client)
           
FtpConsumer(FtpEndpoint endpoint, Processor processor, org.apache.commons.net.ftp.FTPClient client, ScheduledExecutorService executor)
           
 
Method Summary
protected  void acquireExclusiveReadLock(org.apache.commons.net.ftp.FTPClient client, org.apache.commons.net.ftp.FTPFile ftpFile)
           
protected  void connectIfNecessary()
           
protected  void disconnect()
           
protected  void doStart()
           
protected  void doStop()
           
protected  String getFileName(Object file)
          Gets the filename.
protected  String getFullFileName(org.apache.commons.net.ftp.FTPFile ftpFile)
           
protected  void poll()
           
protected  void pollDirectory(String dir)
           
 
Methods inherited from class org.apache.camel.component.file.remote.RemoteFileConsumer
getExcludedNamePostfix, getExcludedNamePrefix, getLastPollTime, getMoveFileName, getMoveNamePostfix, getMoveNamePrefix, getRegexPattern, isDeleteFile, isExclusiveReadLock, isMatched, isMoveFile, isRecursive, isSetNames, isTimestamp, remoteServer, setDeleteFile, setExcludedNamePostfix, setExcludedNamePrefix, setExclusiveReadLock, setLastPollTime, setMoveNamePostfix, setMoveNamePrefix, setRecursive, setRegexPattern, setSetNames, setTimestamp
 
Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer
getDelay, getInitialDelay, getTimeUnit, isUseFixedDelay, 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
 

Constructor Detail

FtpConsumer

public FtpConsumer(FtpEndpoint endpoint,
                   Processor processor,
                   org.apache.commons.net.ftp.FTPClient client)

FtpConsumer

public FtpConsumer(FtpEndpoint endpoint,
                   Processor processor,
                   org.apache.commons.net.ftp.FTPClient client,
                   ScheduledExecutorService executor)
Method Detail

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class ScheduledPollConsumer<RemoteFileExchange>
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class ScheduledPollConsumer<RemoteFileExchange>
Throws:
Exception

connectIfNecessary

protected void connectIfNecessary()
                           throws IOException
Throws:
IOException

disconnect

protected void disconnect()
                   throws IOException
Throws:
IOException

poll

protected void poll()
             throws Exception
Specified by:
poll in class ScheduledPollConsumer<RemoteFileExchange>
Throws:
Exception

pollDirectory

protected void pollDirectory(String dir)
                      throws Exception
Throws:
Exception

getFullFileName

protected String getFullFileName(org.apache.commons.net.ftp.FTPFile ftpFile)
                          throws IOException
Throws:
IOException

acquireExclusiveReadLock

protected void acquireExclusiveReadLock(org.apache.commons.net.ftp.FTPClient client,
                                        org.apache.commons.net.ftp.FTPFile ftpFile)
                                 throws IOException
Throws:
IOException

getFileName

protected String getFileName(Object file)
Description copied from class: RemoteFileConsumer
Gets the filename.

Specified by:
getFileName in class RemoteFileConsumer<RemoteFileExchange>
Parameters:
file - the file object for the given consumer implementation.
Returns:
the filename as String.


Apache CAMEL