public abstract class AbstractConnectionService extends CloseableUtils.AbstractInnerCloseable implements ConnectionService
| Modifier and Type | Field and Description |
|---|---|
protected AgentForwardSupport |
agentForward |
protected boolean |
allowMoreSessions |
protected java.util.Map<java.lang.Integer,Channel> |
channels
Map of channels keyed by the identifier
|
protected java.util.concurrent.atomic.AtomicInteger |
nextChannelId
Next channel identifier
|
protected Session |
session |
protected TcpipForwarder |
tcpipForwarder
The tcpip forwarder
|
protected X11ForwardSupport |
x11Forward |
CLOSED, closeFuture, GRACEFUL, IMMEDIATE, lock, log, OPENED, 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
|
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() |
java.lang.String |
toString() |
void |
unregisterChannel(Channel channel)
Remove this channel from the list of managed channels
|
doCloseGracefully, doCloseImmediatelyclose, postCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateX11Display, initAgentForwardprotected final java.util.Map<java.lang.Integer,Channel> channels
protected final java.util.concurrent.atomic.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 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 java.io.IOException
registerChannel in interface ConnectionServicechannel - the channel to registerjava.io.IOExceptionpublic void unregisterChannel(Channel channel)
unregisterChannel in interface ConnectionServicechannel - the channelpublic void process(byte cmd,
Buffer buffer)
throws java.lang.Exception
Servicepublic void setAllowMoreSessions(boolean allow)
setAllowMoreSessions in interface ConnectionServicepublic void channelOpenConfirmation(Buffer buffer) throws java.io.IOException
java.io.IOExceptionpublic void channelOpenFailure(Buffer buffer) throws java.io.IOException
java.io.IOExceptionpublic void channelData(Buffer buffer) throws java.io.IOException
buffer - the buffer containing the datajava.io.IOException - if an error occurspublic void channelExtendedData(Buffer buffer) throws java.io.IOException
buffer - the buffer containing the datajava.io.IOException - if an error occurspublic void channelWindowAdjust(Buffer buffer) throws java.io.IOException
buffer - the buffer containing the window adjustement parametersjava.io.IOException - if an error occurspublic void channelEof(Buffer buffer) throws java.io.IOException
buffer - the buffer containing the packetjava.io.IOException - if an error occurspublic void channelClose(Buffer buffer) throws java.io.IOException
buffer - the buffer containing the packetjava.io.IOException - if an error occurspublic void channelRequest(Buffer buffer) throws java.io.IOException
buffer - the buffer containing the requestjava.io.IOException - if an error occurspublic void channelFailure(Buffer buffer) throws java.io.IOException
buffer - the buffer containing the packetjava.io.IOException - if an error occursprotected Channel getChannel(Buffer buffer) throws java.io.IOException
buffer - the incoming packetjava.io.IOException - if the channel does not existsprotected void channelOpen(Buffer buffer) throws java.lang.Exception
java.lang.Exceptionprotected void globalRequest(Buffer buffer) throws java.lang.Exception
buffer - the requestjava.lang.Exceptionprotected void requestSuccess(Buffer buffer) throws java.lang.Exception
java.lang.Exceptionprotected void requestFailure(Buffer buffer) throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.