com.jscape.inet.ssh

## Class SshAdapter

- java.lang.Object
- - com.jscape.inet.ssh.SshAdapter

- All Implemented Interfaces:
    SshListener

      public class SshAdapter
      extends java.lang.Object
      implements SshListener

  Implements methods for capturing events sourced from Ssh class. Typicaly your application will implement this interface to capture the following events :

  `SshConnectedEvent`
  `SshDisconnectedEvent`
  `SshDataReceivedEvent`

  In addition to extending this class your application should register itself as an EventListener which may look somewhat like this:

       public class Application ... extends SshAdapter
       {
        ...
        public ... initMethod(...)
        {
          Ssh ssh = new Ssh(hostname,username,password);
          ssh.addSshListener(this);
        }
        ...
       }

  Author:
    vglass

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SshAdapter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `connected(SshConnectedEvent event)` Invoked when SSH connection is established.
    `void` | `dataReceived(SshDataReceivedEvent event)` Invoked when data is received from Telnet server.
    `void` | `disconnected(SshDisconnectedEvent event)` Invoked when SSH connection is released.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SshAdapter

          public SshAdapter()

  - ### Method Detail

    - #### connected

          public void connected(SshConnectedEvent event)

      Invoked when SSH connection is established.
      Specified by:
        `connected` in interface `SshListener`
      Parameters:
        `event` - a SshConnectedEvent
      See Also:
        `SshConnectedEvent`, `Ssh.connect()`

    - #### disconnected

          public void disconnected(SshDisconnectedEvent event)

      Invoked when SSH connection is released. DisconnectReasons can occur in many circumstances including IOException during socket read/write or manually invoking the `Ssh#disconnect` method.
      Specified by:
        `disconnected` in interface `SshListener`
      Parameters:
        `event` - a SshDisconnectedEvent
      See Also:
        `SshDisconnectedEvent`, `Ssh.disconnect()`

    - #### dataReceived

          public void dataReceived(SshDataReceivedEvent event)

      Invoked when data is received from Telnet server.
      Specified by:
        `dataReceived` in interface `SshListener`
      Parameters:
        `event` - a `SshDataReceivedEvent`
      See Also:
        `SshDataReceivedEvent`

Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved