com.sshtools.daemon.forwarding
Class ForwardingServer

java.lang.Object
  extended by com.sshtools.daemon.forwarding.ForwardingServer
All Implemented Interfaces:
ChannelFactory, GlobalRequestHandler

public class ForwardingServer
extends java.lang.Object
implements ChannelFactory, GlobalRequestHandler

Version:
$Revision: 1.1 $
Author:
$author$

Nested Class Summary
(package private)  class ForwardingServer.ServerForwardingListener
           
 
Field Summary
private  java.util.List channelTypes
           
private  ConnectionProtocol connection
           
private  java.util.List localForwardings
           
private static org.apache.commons.logging.Log log
           
private  java.util.List remoteForwardings
           
 
Constructor Summary
ForwardingServer(ConnectionProtocol connection)
          Creates a new ForwardingServer object.
 
Method Summary
protected  void addRemoteForwardingConfiguration(java.lang.String addressToBind, int portToBind)
           
 Channel createChannel(java.lang.String channelType, byte[] requestData)
           
protected  ForwardingConfiguration getLocalForwardingByAddress(java.lang.String orginatingAddress, int originatingPort)
           
protected  ForwardingConfiguration getRemoteForwardingByAddress(java.lang.String addressToBind, int portToBind)
           
 GlobalRequestResponse processGlobalRequest(java.lang.String requestName, byte[] requestData)
           
protected  void removeRemoteForwarding(java.lang.String addressToBind, int portToBind)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

connection

private ConnectionProtocol connection

channelTypes

private java.util.List channelTypes

localForwardings

private java.util.List localForwardings

remoteForwardings

private java.util.List remoteForwardings
Constructor Detail

ForwardingServer

public ForwardingServer(ConnectionProtocol connection)
                 throws java.io.IOException
Creates a new ForwardingServer object.

Parameters:
connection -
Throws:
java.io.IOException
Method Detail

createChannel

public Channel createChannel(java.lang.String channelType,
                             byte[] requestData)
                      throws InvalidChannelException
Specified by:
createChannel in interface ChannelFactory
Throws:
InvalidChannelException

processGlobalRequest

public GlobalRequestResponse processGlobalRequest(java.lang.String requestName,
                                                  byte[] requestData)
Specified by:
processGlobalRequest in interface GlobalRequestHandler
Parameters:
requestName -
requestData -
Returns:

getLocalForwardingByAddress

protected ForwardingConfiguration getLocalForwardingByAddress(java.lang.String orginatingAddress,
                                                              int originatingPort)
                                                       throws ForwardingConfigurationException
Parameters:
orginatingAddress -
originatingPort -
Returns:
Throws:
ForwardingConfigurationException

getRemoteForwardingByAddress

protected ForwardingConfiguration getRemoteForwardingByAddress(java.lang.String addressToBind,
                                                               int portToBind)
                                                        throws ForwardingConfigurationException
Parameters:
addressToBind -
portToBind -
Returns:
Throws:
ForwardingConfigurationException

addRemoteForwardingConfiguration

protected void addRemoteForwardingConfiguration(java.lang.String addressToBind,
                                                int portToBind)
                                         throws ForwardingConfigurationException
Parameters:
addressToBind -
portToBind -
Throws:
ForwardingConfigurationException

removeRemoteForwarding

protected void removeRemoteForwarding(java.lang.String addressToBind,
                                      int portToBind)
                               throws ForwardingConfigurationException
Parameters:
addressToBind -
portToBind -
Throws:
ForwardingConfigurationException