public abstract class AbstractConnectionService extends CloseableUtils.AbstractInnerCloseable implements ConnectionService
CloseableUtils.AbstractCloseable.State| Modifier and Type | Field and Description |
|---|---|
protected AgentForwardSupport |
agentForward |
protected boolean |
allowMoreSessions |
protected Map<Integer,Channel> |
channels
Map of channels keyed by the identifier
|
protected AtomicInteger |
nextChannelId
Next channel identifier
|
protected Session |
session |
protected TcpipForwarder |
tcpipForwarder
The tcpip forwarder
|
protected X11ForwardSupport |
x11Forward |
closeFuture, lock, log, state| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConnectionService(Session session) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelClose(Buffer buffer)
Close a channel due to a close packet received
|
void |
channelData(Buffer buffer)
Process incoming data on a channel
|
void |
channelEof(Buffer buffer)
Process end of file on a channel
|
void |
channelExtendedData(Buffer buffer)
Process incoming extended data on a channel
|
void |
channelFailure(Buffer buffer)
Process a failure on a channel
|
protected void |
channelOpen(Buffer buffer) |
void |
channelOpenConfirmation(Buffer buffer) |
void |
channelOpenFailure(Buffer buffer) |
void |
channelRequest(Buffer buffer)
Service a request on a channel
|
void |
channelWindowAdjust(Buffer buffer)
Process a window adjust packet on a channel
|
protected Channel |
getChannel(Buffer buffer)
Retrieve the channel designated by the given packet
|
Collection<Channel> |
getChannels() |
protected Closeable |
getInnerCloseable() |
protected int |
getNextChannelId() |
AbstractSession |
getSession() |
TcpipForwarder |
getTcpipForwarder()
Retrieve the tcpip forwarder
|
protected void |
globalRequest(Buffer buffer)
Process global requests
|
void |
process(byte cmd,
Buffer buffer)
Service the request.
|
int |
registerChannel(Channel channel)
Register a newly created channel with a new unique identifier
|
protected void |
requestFailure(Buffer buffer) |
protected void |
requestSuccess(Buffer buffer) |
void |
setAllowMoreSessions(boolean allow) |
void |
start() |
String |
toString() |
void |
unregisterChannel(Channel channel)
Remove this channel from the list of managed channels
|
doCloseGracefully, doCloseImmediatelybuilder, close, isClosed, isClosing, preCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateX11Display, initAgentForwardprotected final AtomicInteger nextChannelId
protected final Session session
protected final TcpipForwarder tcpipForwarder
protected final AgentForwardSupport agentForward
protected final X11ForwardSupport x11Forward
protected boolean allowMoreSessions
protected AbstractConnectionService(Session session)
public Collection<Channel> getChannels()
public AbstractSession getSession()
getSession in interface Servicepublic TcpipForwarder getTcpipForwarder()
ConnectionServicegetTcpipForwarder in interface ConnectionServiceprotected Closeable getInnerCloseable()
getInnerCloseable in class CloseableUtils.AbstractInnerCloseableprotected int getNextChannelId()
public int registerChannel(Channel channel) throws IOException
registerChannel in interface ConnectionServicechannel - the channel to registerIOExceptionpublic void unregisterChannel(Channel channel)
unregisterChannel in interface ConnectionServicechannel - the channelpublic void process(byte cmd,
Buffer buffer)
throws Exception
Servicepublic void setAllowMoreSessions(boolean allow)
setAllowMoreSessions in interface ConnectionServicepublic void channelOpenConfirmation(Buffer buffer) throws IOException
IOExceptionpublic void channelOpenFailure(Buffer buffer) throws IOException
IOExceptionpublic void channelData(Buffer buffer) throws IOException
buffer - the buffer containing the dataIOException - if an error occurspublic void channelExtendedData(Buffer buffer) throws IOException
buffer - the buffer containing the dataIOException - if an error occurspublic void channelWindowAdjust(Buffer buffer) throws IOException
buffer - the buffer containing the window adjustement parametersIOException - if an error occurspublic void channelEof(Buffer buffer) throws IOException
buffer - the buffer containing the packetIOException - if an error occurspublic void channelClose(Buffer buffer) throws IOException
buffer - the buffer containing the packetIOException - if an error occurspublic void channelRequest(Buffer buffer) throws IOException
buffer - the buffer containing the requestIOException - if an error occurspublic void channelFailure(Buffer buffer) throws IOException
buffer - the buffer containing the packetIOException - if an error occursprotected Channel getChannel(Buffer buffer) throws IOException
buffer - the incoming packetIOException - if the channel does not existsprotected void globalRequest(Buffer buffer) throws Exception
buffer - the requestExceptionCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.