public abstract class SocketForwardingChannel extends ForwardingChannel
An abstract forwarding channel implementation for use with forwarding both local and remote sockets.
ForwardingChannel| Modifier and Type | Class and Description |
|---|---|
protected class |
SocketForwardingChannel.QueuedData |
hostToConnect, originatingHost, originatingPort, portToConnectconnection, localwindow, localWindowLock, state| Constructor and Description |
|---|
SocketForwardingChannel(String channeltype)
Construct the forwarding channel.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canClose()
Can this channel close?
|
protected abstract byte[] |
createChannel()
Called when the channel is being created.
|
protected void |
evaluateClosure()
set the closePending flag to true
and attempt to close the channel
|
protected void |
evaluateWindowSpace(long remaining)
Called to evaluate the window space available.
|
protected void |
onChannelClosed()
Called when the channel has been closed to enable resources to be freed.
|
protected void |
onChannelClosing()
does nothing
|
protected void |
onChannelData(byte[] data)
Called by the channel when data arrives from the remote side.
|
protected void |
onChannelFree()
does nothing
|
protected void |
onChannelOpen()
does nothing
|
protected void |
onChannelOpenConfirmation()
Called when the channel has been confirmed as open by the remote side - this
method is only called when the channel has been requested by this side
of the connection
|
protected void |
onChannelRequest(String parm1,
boolean parm2,
byte[] parm3)
Called when a channel request is received.
|
protected void |
onExtendedData(byte[] data,
int type)
does nothing
|
protected void |
onLocalEOF()
The start of the tunnel has gone EOF
, if the end of the tunnel has already gone EOF
then close the tunnel.
|
protected void |
onRemoteClose()
We override this to make sure that all data from the socket has been
sent before we close our side of the channel
|
protected void |
onRemoteEOF()
The end of the tunnel has gone EOF
, if the start of the tunnel has already gone EOF
then close the tunnel.
|
protected abstract byte[] |
openChannel(byte[] parm1)
Called when the channel is being opened.
|
void |
sendChannelData(org.apache.mina.core.buffer.IoBuffer buf,
Runnable r) |
getHost, getInformation, getOriginatingHost, getOriginatingPort, getPortaddEventListener, addInputListener, addOutputListener, close, getConnection, getContext, getLocalId, getLocalPacket, getLocalWindow, getName, getQueueSize, getRemoteId, getRemotePacket, getRemoteWindow, getSessionIdentifier, hasQueuedData, idle, isClosed, isClosing, isEOF, isLocalEOF, isOpen, isRemoteEOF, onChannelOpenFailure, onWindowAdjust, queueSize, registerExtendedData, removeEventListener, sendChannelData, sendChannelRequest, sendEOF, sendExtendedData, sendRequestResponse, sendWindowAdjustpublic SocketForwardingChannel(String channeltype)
channeltype - the type of channel i.e. "forwarded-tcpip"protected void onChannelOpen()
onChannelOpen in class Channelprotected void onChannelOpenConfirmation()
ChannelonChannelOpenConfirmation in class Channelprotected abstract byte[] createChannel()
throws IOException,
com.maverick.ssh.ChannelOpenException
ChannelcreateChannel in class ChannelIOExceptioncom.maverick.ssh.ChannelOpenExceptionpublic void sendChannelData(org.apache.mina.core.buffer.IoBuffer buf,
Runnable r)
sendChannelData in class Channelprotected void onChannelData(byte[] data)
ChannelonChannelData in class Channelprotected void onExtendedData(byte[] data,
int type)
onExtendedData in class Channelprotected void onChannelRequest(String parm1, boolean parm2, byte[] parm3)
ChannelonChannelRequest in class Channelprotected void onChannelFree()
onChannelFree in class Channelprotected void onChannelClosing()
onChannelClosing in class Channelprotected boolean canClose()
Channelprotected void onRemoteClose()
onRemoteClose in class Channelprotected void evaluateClosure()
protected void onChannelClosed()
ChannelonChannelClosed in class Channelprotected void onLocalEOF()
onLocalEOF in class Channelprotected void onRemoteEOF()
onRemoteEOF in class Channelprotected void evaluateWindowSpace(long remaining)
ChannelevaluateWindowSpace in class Channelprotected abstract byte[] openChannel(byte[] parm1)
throws WriteOperationRequest,
com.maverick.ssh.ChannelOpenException
ChannelopenChannel in class ChannelWriteOperationRequestcom.maverick.ssh.ChannelOpenExceptionCopyright © 2012. All Rights Reserved.