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
|
static int |
DEFAULT_MAX_CHANNELS |
static String |
MAX_CONCURRENT_CHANNELS_PROP
Property that can be used to configure max.
|
protected AtomicInteger |
nextChannelId
Next channel identifier
|
static Int2IntFunction |
RESPONSE_BUFFER_GROWTH_FACTOR
Default growth factor function used to resize response buffers
|
protected AbstractSession |
session |
protected TcpipForwarder |
tcpipForwarder
The tcpip forwarder
|
protected X11ForwardSupport |
x11Forward |
closeFuture, lock, statelog| 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(int 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) |
protected void |
sendResponse(Buffer buffer,
String req,
RequestHandler.Result result,
boolean wantReply) |
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, preCloseclose, isOpenclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateX11Display, initAgentForwardpublic static final String MAX_CONCURRENT_CHANNELS_PROP
registerChannel(Channel),
Constant Field Valuespublic static final int DEFAULT_MAX_CHANNELS
public static final Int2IntFunction RESPONSE_BUFFER_GROWTH_FACTOR
protected final AtomicInteger nextChannelId
protected final AbstractSession 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 ConnectionServiceTcpipForwarderprotected Closeable getInnerCloseable()
getInnerCloseable in class CloseableUtils.AbstractInnerCloseableprotected int getNextChannelId()
public int registerChannel(Channel channel) throws IOException
ConnectionServiceregisterChannel in interface ConnectionServicechannel - The Channel to registerIOException - If failed to initialize and register the channelpublic void unregisterChannel(Channel channel)
unregisterChannel in interface ConnectionServicechannel - the channelpublic void process(int 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 sendResponse(Buffer buffer, String req, RequestHandler.Result result, boolean wantReply) throws IOException
IOExceptionCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.