com.mindbright.ssh2
Class SSH2ConnectionEventAdapter

java.lang.Object
  extended bycom.mindbright.ssh2.SSH2ConnectionEventAdapter
All Implemented Interfaces:
SSH2ConnectionEventHandler

public class SSH2ConnectionEventAdapter
extends java.lang.Object
implements SSH2ConnectionEventHandler

This class is an adapter for the interface SSH2ConnectionEventHandler.

See Also:
SSH2ConnectionEventHandler

Constructor Summary
SSH2ConnectionEventAdapter()
           
 
Method Summary
 void channelAdded(SSH2Connection connection, SSH2Channel channel)
          Called when a new channel is added.
 void channelClosed(SSH2Connection connection, SSH2Channel channel)
          Called when a channel is closed.
 void channelConnect(java.lang.Object originator, SSH2Channel channel, java.net.Socket fwdSocket)
          Called when a channel is connected to a Socket.
 void channelDeleted(SSH2Connection connection, SSH2Channel channel)
          Called when a channel is deleted.
 boolean listenerAccept(SSH2Listener listener, java.net.Socket fwdSocket)
          Called when a listener accepts a new connection.
 void localChannelOpenFailure(SSH2Connection connection, SSH2Channel channel, int reasonCode, java.lang.String reasonText, java.lang.String languageTag)
          Called on either side when a locally originating channel gets a channel open failure indication from peer.
 void localDirectConnect(SSH2Connection connection, SSH2Listener listener, SSH2Channel channel)
          Called on the client side when a local forward channel is confirmed to be open.
 void localForwardedConnect(SSH2Connection connection, SSH2Listener listener, SSH2Channel channel)
          Called on the server side when a remote forward channel is confirmed to be open.
 void localSessionConnect(SSH2Connection connection, SSH2Channel channel)
          Called on the client side when a session channel is confirmed to be open.
 void localX11Connect(SSH2Connection connection, SSH2Listener listener, SSH2Channel channel)
          Called on the server side when an X11 channel is confirmed to be open.
 void remoteChannelOpenFailure(SSH2Connection connection, java.lang.String channelType, java.lang.String targetAddr, int targetPort, java.lang.String originAddr, int originPort, SSH2Exception cause)
          Called on either side when there is a problem opening a remotely originating channel resulting in a channel open failure indication beeing sent back to peer.
 void remoteDirectConnect(SSH2Connection connection, SSH2Channel channel)
          Called on the client side when a remote direct channel has been confirmed to be open.
 void remoteForwardedConnect(SSH2Connection connection, java.lang.String remoteAddr, int remotePort, SSH2Channel channel)
          Called on the client side when a remote forward channel has been confirmed to be open.
 void remoteSessionConnect(SSH2Connection connection, java.lang.String remoteAddr, int remotePort, SSH2Channel channel)
          Called on the client side when a remote session channel has been confirmed to be open.
 void remoteX11Connect(SSH2Connection connection, SSH2Channel channel)
          Called on the client side when a remote X11 channel has been confirmed to be open.
 void setSocketOptions(int channelType, java.net.Socket s)
          Called to set socket options on newly connected port forward channels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSH2ConnectionEventAdapter

public SSH2ConnectionEventAdapter()
Method Detail

channelAdded

public void channelAdded(SSH2Connection connection,
                         SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called when a new channel is added. That is when a new channel has been opened through a port forward.

Specified by:
channelAdded in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
channel - the channel which was added

channelDeleted

public void channelDeleted(SSH2Connection connection,
                           SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called when a channel is deleted. That is when a channel has been finally removed.

Specified by:
channelDeleted in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
channel - the channel which was deleted

channelConnect

public void channelConnect(java.lang.Object originator,
                           SSH2Channel channel,
                           java.net.Socket fwdSocket)
Description copied from interface: SSH2ConnectionEventHandler
Called when a channel is connected to a Socket.

Specified by:
channelConnect in interface SSH2ConnectionEventHandler
Parameters:
originator - the responsible listener/connector
channel - the created channel
fwdSocket - the socket which is connected to

channelClosed

public void channelClosed(SSH2Connection connection,
                          SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called when a channel is closed. That is when the channel has been closed and will be flushed and then removed.

Specified by:
channelClosed in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
channel - the channel which was deleted

listenerAccept

public boolean listenerAccept(SSH2Listener listener,
                              java.net.Socket fwdSocket)
Description copied from interface: SSH2ConnectionEventHandler
Called when a listener accepts a new connection. That is when a local forward is opened. This callback indicates if a connection should be handled or not by returning true or false.

Specified by:
listenerAccept in interface SSH2ConnectionEventHandler
Parameters:
listener - the responsible listener
fwdSocket - the socket which resulted
Returns:
boolean indicating wether to process connection or not.

localForwardedConnect

public void localForwardedConnect(SSH2Connection connection,
                                  SSH2Listener listener,
                                  SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called on the server side when a remote forward channel is confirmed to be open.

Specified by:
localForwardedConnect in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
listener - the responsible listener
channel - the channel which was opened

localDirectConnect

public void localDirectConnect(SSH2Connection connection,
                               SSH2Listener listener,
                               SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called on the client side when a local forward channel is confirmed to be open.

Specified by:
localDirectConnect in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
listener - the responsible listener
channel - the channel which was opened

localSessionConnect

public void localSessionConnect(SSH2Connection connection,
                                SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called on the client side when a session channel is confirmed to be open.

Specified by:
localSessionConnect in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
channel - the channel which was opened

localX11Connect

public void localX11Connect(SSH2Connection connection,
                            SSH2Listener listener,
                            SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called on the server side when an X11 channel is confirmed to be open.

Specified by:
localX11Connect in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
listener - the responsible listener
channel - the channel which was opened

localChannelOpenFailure

public void localChannelOpenFailure(SSH2Connection connection,
                                    SSH2Channel channel,
                                    int reasonCode,
                                    java.lang.String reasonText,
                                    java.lang.String languageTag)
Description copied from interface: SSH2ConnectionEventHandler
Called on either side when a locally originating channel gets a channel open failure indication from peer. See the class SSH2 for reason codes.

Specified by:
localChannelOpenFailure in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
channel - the channel which was opened
reasonCode - the reason code
reasonText -
languageTag -
See Also:
SSH2

remoteForwardedConnect

public void remoteForwardedConnect(SSH2Connection connection,
                                   java.lang.String remoteAddr,
                                   int remotePort,
                                   SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called on the client side when a remote forward channel has been confirmed to be open.

Specified by:
remoteForwardedConnect in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
remoteAddr -
remotePort -
channel - the channel which was opened

remoteDirectConnect

public void remoteDirectConnect(SSH2Connection connection,
                                SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called on the client side when a remote direct channel has been confirmed to be open.

Specified by:
remoteDirectConnect in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
channel - the channel which was opened

remoteSessionConnect

public void remoteSessionConnect(SSH2Connection connection,
                                 java.lang.String remoteAddr,
                                 int remotePort,
                                 SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called on the client side when a remote session channel has been confirmed to be open.

Specified by:
remoteSessionConnect in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
remoteAddr -
remotePort -
channel - the channel which was opened

remoteX11Connect

public void remoteX11Connect(SSH2Connection connection,
                             SSH2Channel channel)
Description copied from interface: SSH2ConnectionEventHandler
Called on the client side when a remote X11 channel has been confirmed to be open.

Specified by:
remoteX11Connect in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
channel - the channel which was opened

remoteChannelOpenFailure

public void remoteChannelOpenFailure(SSH2Connection connection,
                                     java.lang.String channelType,
                                     java.lang.String targetAddr,
                                     int targetPort,
                                     java.lang.String originAddr,
                                     int originPort,
                                     SSH2Exception cause)
Description copied from interface: SSH2ConnectionEventHandler
Called on either side when there is a problem opening a remotely originating channel resulting in a channel open failure indication beeing sent back to peer. The exception which was the cause of the problem is provided aswell as the type of channel and relevant addresses and ports.

Specified by:
remoteChannelOpenFailure in interface SSH2ConnectionEventHandler
Parameters:
connection - the connection layer responsible
channelType - the type of channel
targetAddr - the address which should have been connected to
targetPort - the port which should have been connected to
originAddr - the address where the channel originated (depends on type)
originPort - the port where the channel originated (depends on type)
cause - the exception which was the cause of the problem

setSocketOptions

public void setSocketOptions(int channelType,
                             java.net.Socket s)
Description copied from interface: SSH2ConnectionEventHandler
Called to set socket options on newly connected port forward channels

Specified by:
setSocketOptions in interface SSH2ConnectionEventHandler
Parameters:
channelType - the type of the channel
s - socket to manipulate