com.mindbright.ssh2
public class SSH2ConnectionEventAdapter extends java.lang.Object implements SSH2ConnectionEventHandler
SSH2ConnectionEventHandler
.SSH2ConnectionEventHandler
Constructor and Description |
---|
SSH2ConnectionEventAdapter() |
Modifier and Type | Method and Description |
---|---|
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
|
public void channelAdded(SSH2Connection connection, SSH2Channel channel)
SSH2ConnectionEventHandler
channelAdded
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was addedpublic void channelDeleted(SSH2Connection connection, SSH2Channel channel)
SSH2ConnectionEventHandler
channelDeleted
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was deletedpublic void channelConnect(java.lang.Object originator, SSH2Channel channel, java.net.Socket fwdSocket)
SSH2ConnectionEventHandler
Socket
.channelConnect
in interface SSH2ConnectionEventHandler
originator
- the responsible listener/connectorchannel
- the created channelfwdSocket
- the socket which is connected topublic void channelClosed(SSH2Connection connection, SSH2Channel channel)
SSH2ConnectionEventHandler
channelClosed
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was deletedpublic boolean listenerAccept(SSH2Listener listener, java.net.Socket fwdSocket)
SSH2ConnectionEventHandler
true
or
false
.listenerAccept
in interface SSH2ConnectionEventHandler
listener
- the responsible listenerfwdSocket
- the socket which resultedboolean
indicating wether to process connection or
not.public void localForwardedConnect(SSH2Connection connection, SSH2Listener listener, SSH2Channel channel)
SSH2ConnectionEventHandler
localForwardedConnect
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblelistener
- the responsible listenerchannel
- the channel which was openedpublic void localDirectConnect(SSH2Connection connection, SSH2Listener listener, SSH2Channel channel)
SSH2ConnectionEventHandler
localDirectConnect
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblelistener
- the responsible listenerchannel
- the channel which was openedpublic void localSessionConnect(SSH2Connection connection, SSH2Channel channel)
SSH2ConnectionEventHandler
localSessionConnect
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was openedpublic void localX11Connect(SSH2Connection connection, SSH2Listener listener, SSH2Channel channel)
SSH2ConnectionEventHandler
localX11Connect
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblelistener
- the responsible listenerchannel
- the channel which was openedpublic void localChannelOpenFailure(SSH2Connection connection, SSH2Channel channel, int reasonCode, java.lang.String reasonText, java.lang.String languageTag)
SSH2ConnectionEventHandler
SSH2
for
reason codes.localChannelOpenFailure
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was openedreasonCode
- the reason codeSSH2
public void remoteForwardedConnect(SSH2Connection connection, java.lang.String remoteAddr, int remotePort, SSH2Channel channel)
SSH2ConnectionEventHandler
remoteForwardedConnect
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was openedpublic void remoteDirectConnect(SSH2Connection connection, SSH2Channel channel)
SSH2ConnectionEventHandler
remoteDirectConnect
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was openedpublic void remoteSessionConnect(SSH2Connection connection, java.lang.String remoteAddr, int remotePort, SSH2Channel channel)
SSH2ConnectionEventHandler
remoteSessionConnect
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was openedpublic void remoteX11Connect(SSH2Connection connection, SSH2Channel channel)
SSH2ConnectionEventHandler
remoteX11Connect
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannel
- the channel which was openedpublic void remoteChannelOpenFailure(SSH2Connection connection, java.lang.String channelType, java.lang.String targetAddr, int targetPort, java.lang.String originAddr, int originPort, SSH2Exception cause)
SSH2ConnectionEventHandler
remoteChannelOpenFailure
in interface SSH2ConnectionEventHandler
connection
- the connection layer responsiblechannelType
- the type of channeltargetAddr
- the address which should have been connected totargetPort
- the port which should have been connected tooriginAddr
- 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 problempublic void setSocketOptions(int channelType, java.net.Socket s)
SSH2ConnectionEventHandler
setSocketOptions
in interface SSH2ConnectionEventHandler
channelType
- the type of the channels
- socket to manipulate