com.maverick.sshd
Class LocalForwardingChannel

java.lang.Object
  extended by com.maverick.sshd.Channel
      extended by com.maverick.sshd.ForwardingChannel
          extended by com.maverick.sshd.SocketForwardingChannel
              extended by com.maverick.sshd.LocalForwardingChannel
All Implemented Interfaces:
ClientConnector, SelectorRegistrationListener, SocketHandler

public class LocalForwardingChannel
extends SocketForwardingChannel
implements ClientConnector

Implements a Local forwarding channel for use with forwarding sockets from the client machine through the server to some endpoint reachable from the server machine.

Author:
Lee David Painter

Nested Class Summary
 
Nested classes/interfaces inherited from class com.maverick.sshd.Channel
Channel.QueuedData
 
Field Summary
 
Fields inherited from class com.maverick.sshd.ForwardingChannel
hostToConnect, originatingHost, originatingPort, portToConnect
 
Fields inherited from class com.maverick.sshd.Channel
connection, localwindow, localWindowLock
 
Constructor Summary
LocalForwardingChannel()
          Constructs a forwarding channel of the type "direct-tcpip"
 
Method Summary
protected  byte[] createChannel()
          Create the forwarding channel.
 boolean finishConnect(java.nio.channels.SelectionKey key)
          Called when the forwarded socket has been connected.
protected  void onChannelOpenConfirmation()
          Called when the channel has been confirmed as open.
protected  void onRegistrationComplete()
          Called when the forwarded sockets selector has been registered with a com,maverick.nio.SelectorThread.
protected  byte[] openChannel(byte[] requestdata)
          Open a forwarding channel.
 
Methods inherited from class com.maverick.sshd.SocketForwardingChannel
canClose, evaluateClosure, evaluateWindowSpace, getInterestedOps, initialize, onChannelClosed, onChannelClosing, onChannelData, onChannelFree, onChannelOpen, onChannelRequest, onExtendedData, onLocalEOF, onRemoteClose, onRemoteEOF, processReadEvent, processWriteEvent, registrationCompleted, setThread, shutdownSocket
 
Methods inherited from class com.maverick.sshd.ForwardingChannel
getHost, getOriginatingHost, getOriginatingPort, getPort
 
Methods inherited from class com.maverick.sshd.Channel
addEventListener, addInputListener, addOutputListener, close, getChannelType, getConnection, getContext, getLocalId, getLocalPacket, getLocalWindow, getQueueSize, getRemoteId, getRemotePacket, getRemoteWindow, getSessionIdentifier, hasQueuedData, isClosed, isClosing, isEOF, isOpen, onChannelOpenFailure, onWindowAdjust, queueSize, registerExtendedData, resetIdleState, sendChannelData, sendChannelData, sendChannelData, sendChannelData, sendChannelDataWithBuffering, sendChannelDataWithBuffering, sendChannelRequest, sendExtendedData, sendExtendedData, sendRequestResponse, sendWindowAdjust
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.maverick.nio.SelectorRegistrationListener
registrationCompleted
 

Constructor Detail

LocalForwardingChannel

public LocalForwardingChannel()
Constructs a forwarding channel of the type "direct-tcpip"

Method Detail

createChannel

protected byte[] createChannel()
Create the forwarding channel.

Specified by:
createChannel in class SocketForwardingChannel
Returns:
byte[]

openChannel

protected byte[] openChannel(byte[] requestdata)
                      throws WriteOperationRequest,
                             ChannelOpenException
Open a forwarding channel.

Specified by:
openChannel in class SocketForwardingChannel
Parameters:
requestdata - byte[]
Returns:
byte[]
Throws:
WriteOperationRequest
ChannelOpenException

onRegistrationComplete

protected void onRegistrationComplete()
Called when the forwarded sockets selector has been registered with a com,maverick.nio.SelectorThread.

Specified by:
onRegistrationComplete in class SocketForwardingChannel

finishConnect

public boolean finishConnect(java.nio.channels.SelectionKey key)
Called when the forwarded socket has been connected.

Specified by:
finishConnect in interface ClientConnector
Parameters:
key - SelectionKey
Returns:
boolean

onChannelOpenConfirmation

protected void onChannelOpenConfirmation()
Called when the channel has been confirmed as open.

Specified by:
onChannelOpenConfirmation in class SocketForwardingChannel


Copyright © 2003-2004 3SP LTD. All Rights Reserved.