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

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.SftpConsumer
All Implemented Interfaces:
Runnable, Consumer<RemoteFileExchange>, Service

public class SftpConsumer
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
SftpConsumer(SftpEndpoint endpoint, Processor processor, com.jcraft.jsch.Session session)
           
SftpConsumer(SftpEndpoint endpoint, Processor processor, com.jcraft.jsch.Session session, ScheduledExecutorService executor)
           
 
Method Summary
protected  void acquireExclusiveReadLock(com.jcraft.jsch.ChannelSftp.LsEntry sftpFile)
           
protected  void connectIfNecessary()
           
protected  void disconnect()
           
protected  void doStart()
           
protected  void doStop()
           
protected  String getFileName(Object file)
          Gets the filename.
protected  String getFullFileName(com.jcraft.jsch.ChannelSftp.LsEntry sftpFile)
           
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

SftpConsumer

public SftpConsumer(SftpEndpoint endpoint,
                    Processor processor,
                    com.jcraft.jsch.Session session)

SftpConsumer

public SftpConsumer(SftpEndpoint endpoint,
                    Processor processor,
                    com.jcraft.jsch.Session session,
                    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 com.jcraft.jsch.JSchException
Throws:
com.jcraft.jsch.JSchException

disconnect

protected void disconnect()
                   throws com.jcraft.jsch.JSchException
Throws:
com.jcraft.jsch.JSchException

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(com.jcraft.jsch.ChannelSftp.LsEntry sftpFile)
                          throws IOException,
                                 com.jcraft.jsch.SftpException
Throws:
IOException
com.jcraft.jsch.SftpException

acquireExclusiveReadLock

protected void acquireExclusiveReadLock(com.jcraft.jsch.ChannelSftp.LsEntry sftpFile)
                                 throws com.jcraft.jsch.SftpException
Throws:
com.jcraft.jsch.SftpException

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