Package org.apache.sshd.sftp.client.fs
Class SftpFileSystem.SftpClientHandle
- java.lang.Object
-
- org.apache.sshd.sftp.client.fs.SftpFileSystem.SftpClientHandle
-
- All Implemented Interfaces:
java.util.EventListener
,ChannelListener
,SshdEventListener
- Enclosing class:
- SftpFileSystem
protected static class SftpFileSystem.SftpClientHandle extends java.lang.Object implements ChannelListener
TheSftpFileSystem.SftpClientPool
storesSftpClient
s not directly but via handles in its channel pool. HAndles remove themselves from the pool
-
-
Field Summary
Fields Modifier and Type Field Description private SftpClient
client
private java.util.concurrent.Future<?>
expiration
private java.util.concurrent.BlockingQueue<? extends SftpFileSystem.SftpClientHandle>
pool
-
Fields inherited from interface org.apache.sshd.common.channel.ChannelListener
EMPTY
-
-
Constructor Summary
Constructors Constructor Description SftpClientHandle(java.util.concurrent.BlockingQueue<? extends SftpFileSystem.SftpClientHandle> pool, SftpClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelClosed(Channel channel, java.lang.Throwable reason)
Called to inform about a channel being closed.void
destroy()
SftpClient
getClient()
void
setExpiration(java.util.concurrent.Future<?> future)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.channel.ChannelListener
channelInitialized, channelOpenFailure, channelOpenSuccess, channelStateChanged
-
-
-
-
Field Detail
-
client
private final SftpClient client
-
pool
private final java.util.concurrent.BlockingQueue<? extends SftpFileSystem.SftpClientHandle> pool
-
expiration
private java.util.concurrent.Future<?> expiration
-
-
Constructor Detail
-
SftpClientHandle
public SftpClientHandle(java.util.concurrent.BlockingQueue<? extends SftpFileSystem.SftpClientHandle> pool, SftpClient client)
-
-
Method Detail
-
destroy
public void destroy()
-
getClient
public SftpClient getClient()
-
setExpiration
public void setExpiration(java.util.concurrent.Future<?> future)
-
channelClosed
public void channelClosed(Channel channel, java.lang.Throwable reason)
Description copied from interface:ChannelListener
Called to inform about a channel being closed. Note: when the call is made there are no guarantees about the channel's actual state except that it either has been already closed or may be in the process of being closed. Note: this method is guaranteed to be called regardless of whetherChannelListener.channelOpenSuccess(Channel)
orChannelListener.channelOpenFailure(Channel, Throwable)
have been called- Specified by:
channelClosed
in interfaceChannelListener
- Parameters:
channel
- The referencedChannel
reason
- The reason why the channel is being closed - ifnull
then normal closure
-
-