org.apache.camel.component.file.remote
Class SftpConsumer
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<RemoteFileExchange>
org.apache.camel.component.file.remote.SftpConsumer
- All Implemented Interfaces:
- Runnable, Consumer<RemoteFileExchange>, Service
public class SftpConsumer
- extends RemoteFileConsumer<RemoteFileExchange>
Fields inherited from class org.apache.camel.component.file.remote.RemoteFileConsumer |
deleteFile, excludedNamePostfix, excludedNamePrefix, exclusiveReadLock, lastPollTime, log, moveNamePostfix, moveNamePrefix, recursive, regexPattern, setNames |
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.ServiceSupport |
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop |
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)
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