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, doCloseImmediately
builder, close, isClosed, isClosing, preClose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createX11Display, initAgentForward
protected 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 Service
public TcpipForwarder getTcpipForwarder()
ConnectionService
getTcpipForwarder
in interface ConnectionService
protected Closeable getInnerCloseable()
getInnerCloseable
in class CloseableUtils.AbstractInnerCloseable
protected int getNextChannelId()
public int registerChannel(Channel channel) throws IOException
registerChannel
in interface ConnectionService
channel
- the channel to registerIOException
public void unregisterChannel(Channel channel)
unregisterChannel
in interface ConnectionService
channel
- the channelpublic void process(byte cmd, Buffer buffer) throws Exception
Service
public void setAllowMoreSessions(boolean allow)
setAllowMoreSessions
in interface ConnectionService
public void channelOpenConfirmation(Buffer buffer) throws IOException
IOException
public void channelOpenFailure(Buffer buffer) throws IOException
IOException
public 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 requestException
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.