com.maverick.sshd.vtun
Class VTunForwardingChannel

java.lang.Object
  extended by com.maverick.sshd.Channel
      extended by com.maverick.sshd.tunnel.ForwardingChannel
          extended by com.maverick.sshd.vtun.VTunForwardingChannel
All Implemented Interfaces:
com.maverick.ssh.components.SshComponent
Direct Known Subclasses:
VTunBoundForwardingChannel, VTunRemoteForwardingChannel

public abstract class VTunForwardingChannel
extends ForwardingChannel


Nested Class Summary
 
Nested classes/interfaces inherited from class com.maverick.sshd.Channel
Channel.QueuedData
 
Field Summary
 
Fields inherited from class com.maverick.sshd.tunnel.ForwardingChannel
hostToConnect, originatingHost, originatingPort, portToConnect
 
Fields inherited from class com.maverick.sshd.Channel
connection, localwindow, localWindowLock, state
 
Constructor Summary
VTunForwardingChannel(String channelType, int maximumPacketSize, int initialWindowSize)
           
 
Method Summary
 void bind(VTunForwardingChannel outputChannel)
           
protected  byte[] createChannel()
          Called when the channel is being created.
protected  void evaluateWindowSpace(long remaining)
          Called to evaluate the window space available.
protected abstract  void onChannelBind()
           
protected  void onChannelClosed()
          Called when the channel has been closed.
protected  void onChannelClosing()
          Called before the channel is closed
protected  void onChannelData(byte[] data)
          Called by the channel when data arrives from the remote side.
protected  void onChannelFree()
          This method is called when the channel has been closed and all its resources are no longer required.
protected  void onChannelOpen()
          Called when the channel has been opened - this method is only called when the remote side requests a channel open.
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 onChannelOpenFailure()
          Called when the remote side fails to open a channel in response to our request.
protected  void onChannelRequest(String type, boolean wantreply, byte[] requestdata)
          Called when a channel request is received.
protected  void onExtendedData(byte[] data, int type)
          Called by the channel when extended data arrives
protected  void onLocalEOF()
          Called when the local side is EOF.
protected  void onRemoteEOF()
          Called when the remote side reports its OutputStream as EOF.
protected  byte[] openChannel(byte[] requestdata)
          Called when the channel is being opened.
 
Methods inherited from class com.maverick.sshd.tunnel.ForwardingChannel
getHost, getInformation, getOriginatingHost, getOriginatingPort, getPort
 
Methods inherited from class com.maverick.sshd.Channel
addEventListener, addInputListener, addOutputListener, canClose, close, getConnection, getContext, getLocalId, getLocalPacket, getLocalWindow, getName, getQueueSize, getRemoteId, getRemotePacket, getRemoteWindow, getSessionIdentifier, hasQueuedData, idle, isClosed, isClosing, isEOF, isLocalEOF, isOpen, isRemoteEOF, onRemoteClose, onWindowAdjust, queueSize, registerExtendedData, removeEventListener, sendChannelData, sendChannelData, sendChannelRequest, sendEOF, sendExtendedData, sendRequestResponse, sendWindowAdjust
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VTunForwardingChannel

public VTunForwardingChannel(String channelType,
                             int maximumPacketSize,
                             int initialWindowSize)
Method Detail

bind

public void bind(VTunForwardingChannel outputChannel)

onChannelBind

protected abstract void onChannelBind()

onChannelOpenFailure

protected void onChannelOpenFailure()
Description copied from class: Channel
Called when the remote side fails to open a channel in response to our request. It only makes sense for some channel types to override this method. A local forwarding channel will never receive this message for example.

Overrides:
onChannelOpenFailure in class Channel

onChannelClosed

protected void onChannelClosed()
Called when the channel has been closed.

Specified by:
onChannelClosed in class Channel

onChannelData

protected void onChannelData(byte[] data)
Called by the channel when data arrives from the remote side. This implementation simply checks that the bound channel is still open and sends its data through the channel.

Specified by:
onChannelData in class Channel
Parameters:
data - byte[]

onLocalEOF

protected void onLocalEOF()
Called when the local side is EOF. This will force the bound channel to be closed.

Specified by:
onLocalEOF in class Channel

onRemoteEOF

protected void onRemoteEOF()
Called when the remote side reports its OutputStream as EOF. This will set the bound channel to EOF but will not close the channel.

Specified by:
onRemoteEOF in class Channel

onExtendedData

protected void onExtendedData(byte[] data,
                              int type)
Description copied from class: Channel
Called by the channel when extended data arrives

Specified by:
onExtendedData in class Channel

onChannelFree

protected void onChannelFree()
Description copied from class: Channel
This method is called when the channel has been closed and all its resources are no longer required.

Specified by:
onChannelFree in class Channel

createChannel

protected byte[] createChannel()
                        throws IOException
Description copied from class: Channel
Called when the channel is being created. You can return data to be sent in the channel open request, or null for none.

Specified by:
createChannel in class Channel
Returns:
byte[]
Throws:
IOException

openChannel

protected byte[] openChannel(byte[] requestdata)
                      throws WriteOperationRequest,
                             com.maverick.ssh.ChannelOpenException
Description copied from class: Channel
Called when the channel is being opened. You can retrun data to be sent in the channel open confirmation message, or null for none.

Specified by:
openChannel in class Channel
Returns:
byte[]
Throws:
WriteOperationRequest
com.maverick.ssh.ChannelOpenException

onChannelOpenConfirmation

protected void onChannelOpenConfirmation()
Description copied from class: Channel
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

Specified by:
onChannelOpenConfirmation in class Channel

onChannelOpen

protected void onChannelOpen()
Description copied from class: Channel
Called when the channel has been opened - this method is only called when the remote side requests a channel open.

Specified by:
onChannelOpen in class Channel

onChannelClosing

protected void onChannelClosing()
Description copied from class: Channel
Called before the channel is closed

Specified by:
onChannelClosing in class Channel

onChannelRequest

protected void onChannelRequest(String type,
                                boolean wantreply,
                                byte[] requestdata)
Description copied from class: Channel
Called when a channel request is received.

Specified by:
onChannelRequest in class Channel

evaluateWindowSpace

protected void evaluateWindowSpace(long remaining)
Description copied from class: Channel
Called to evaluate the window space available. Send a window adjust message if there if the minimum amount of space is not available.

Specified by:
evaluateWindowSpace in class Channel


Copyright © 2012. All Rights Reserved.