Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mindbright.ssh2
Interface SSH2TransportEventHandler

All Known Implementing Classes:
  SSH2TransportEventAdapter

public interface SSH2TransportEventHandler

This interface is an event callback interface used to monitor the transport layer of an ssh2 connection. It is used with the class `SSH2Transport` to get info on the progress and status of the ssh2 connection. It is also used to authenticate the host running the ssh2 server (e.g. through comparing its public key to a known key or verifying its certificate).

See Also:
  `SSH2Transport`, `SSH2TransportEventAdapter`

Method Summary
`void` | `fatalDisconnect(SSH2Transport tp, int reason, java.lang.String description, java.lang.String languageTag)` Called when transport layer is disconnected for the given fatal reason by our side of the connection.
`void` | `gotConnectInfoText(SSH2Transport tp, java.lang.String text)` Called when an info text is received in the version negotiation stage (as defined in the transport protocol spec.).
`void` | `gotPeerVersion(SSH2Transport tp, java.lang.String versionString, int major, int minor, java.lang.String packageVersion)` Called in the version negotiation stage when the peer version is received (as defined in the transport protocol spec.).
`void` | `kexAgreed(SSH2Transport tp, SSH2Preferences ourPrefs, SSH2Preferences peerPrefs)` Called when key exchange have agreed on algorithms.
`boolean` | `kexAuthenticateHost(SSH2Transport tp, SSH2Signature serverHostKey)` Called to authenticate server's host key.
`void` | `kexComplete(SSH2Transport tp)` Called when key exchange has been successfully completed.
`void` | `kexStart(SSH2Transport tp)` Called when key exchange starts.
`void` | `msgDebug(SSH2Transport tp, boolean alwaysDisplay, java.lang.String message, java.lang.String languageTag)` Called when a DEBUG message is received.
`void` | `msgIgnore(SSH2Transport tp, byte[] data)` Called when an IGNORE message is received.
`void` | `msgUnimplemented(SSH2Transport tp, int rejectedSeqNum)` Called when an UNIMPLEMENTED message is received.
`void` | `normalDisconnect(SSH2Transport tp, java.lang.String description, java.lang.String languageTag)` Called when transport layer is disconnected gracefully by our side of connection.
`void` | `peerDisconnect(SSH2Transport tp, int reason, java.lang.String description, java.lang.String languageTag)` Called when peer disconnects the transport layer for some given reason.
`void` | `peerSentUnknownMessage(SSH2Transport tp, int pktType)` Called when an unimplemented message is received, and an UNIMPLEMENTED message is sent to peer.

Method Detail

### gotConnectInfoText

    public void gotConnectInfoText(SSH2Transport tp,
                                   java.lang.String text)

  Called when an info text is received in the version negotiation stage (as defined in the transport protocol spec.).

  Parameters:
    `tp` - the transport layer
    `text` - the info text received

### gotPeerVersion

    public void gotPeerVersion(SSH2Transport tp,
                               java.lang.String versionString,
                               int major,
                               int minor,
                               java.lang.String packageVersion)

  Called in the version negotiation stage when the peer version is received (as defined in the transport protocol spec.).

  Parameters:
    `tp` - the transport layer
    `versionString` - the version string of peer
    `major` - the major protocol version of peer
    `minor` - the minor protocol version of peer
    `packageVersion` - the package version of peer

### kexStart

    public void kexStart(SSH2Transport tp)

  Called when key exchange starts. That is when a KEXINIT message is sent to the peer.

  Parameters:
    `tp` - the transport layer

### kexAgreed

    public void kexAgreed(SSH2Transport tp,
                          SSH2Preferences ourPrefs,
                          SSH2Preferences peerPrefs)

  Called when key exchange have agreed on algorithms. That is when a KEXINIT message has been received and processed).

  Parameters:
    `tp` - the transport layer
    `ourPrefs` - our preferences
    `peerPrefs` - peer's preferences

### kexAuthenticateHost

    public boolean kexAuthenticateHost(SSH2Transport tp,
                                       SSH2Signature serverHostKey)

  Called to authenticate server's host key.

  Parameters:
    `tp` - the transport layer
    `serverHostKey` - server's host key
  Returns:
    a boolean indicating if the server could be authenticated or not.

### kexComplete

    public void kexComplete(SSH2Transport tp)

  Called when key exchange has been successfully completed. That is when new keys and algorithms are now active.

  Parameters:
    `tp` - the transport layer

### msgDebug

    public void msgDebug(SSH2Transport tp,
                         boolean alwaysDisplay,
                         java.lang.String message,
                         java.lang.String languageTag)

  Called when a DEBUG message is received.

  Parameters:
    `tp` - the transport layer
    `alwaysDisplay` - boolean flag indicating whether this message should always be displayed or not.
    `message` - debug message contained in the packet
    `languageTag` - language tag

### msgIgnore

    public void msgIgnore(SSH2Transport tp,
                          byte[] data)

  Called when an IGNORE message is received.

  Parameters:
    `tp` - the transport layer
    `data` - byte array of data contained in packet

### msgUnimplemented

    public void msgUnimplemented(SSH2Transport tp,
                                 int rejectedSeqNum)

  Called when an UNIMPLEMENTED message is received.

  Parameters:
    `tp` - the transport layer
    `rejectedSeqNum` - sequence number of packet which peer didn't understnad

### peerSentUnknownMessage

    public void peerSentUnknownMessage(SSH2Transport tp,
                                       int pktType)

  Called when an unimplemented message is received, and an UNIMPLEMENTED message is sent to peer.

  Parameters:
    `tp` - the transport layer
    `pktType` - type of message which we didn't understand

### normalDisconnect

    public void normalDisconnect(SSH2Transport tp,
                                 java.lang.String description,
                                 java.lang.String languageTag)

  Called when transport layer is disconnected gracefully by our side of connection.

  Parameters:
    `tp` - the transport layer
    `description` - textual description for reason of disconnect
    `languageTag` - language tag

### fatalDisconnect

    public void fatalDisconnect(SSH2Transport tp,
                                int reason,
                                java.lang.String description,
                                java.lang.String languageTag)

  Called when transport layer is disconnected for the given fatal reason by our side of the connection. See the class `SSH2` for reason codes.

  Parameters:
    `tp` - the transport layer
    `reason` - the reason code
    `description` - textual description for reason of disconnect
    `languageTag` - language tag
  See Also:
    `SSH2`

### peerDisconnect

    public void peerDisconnect(SSH2Transport tp,
                               int reason,
                               java.lang.String description,
                               java.lang.String languageTag)

  Called when peer disconnects the transport layer for some given reason. See the class `SSH2` for reason codes.

  Parameters:
    `tp` - the transport layer
    `reason` - the reason code
    `description` - textual description for reason of disconnect
    `languageTag` - language tag
  See Also:
    `SSH2`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD