SSH Factory

com.jscape.inet.ssh
Class SshAdapter

java.lang.Object
  extended by com.jscape.inet.ssh.SshAdapter
All Implemented Interfaces:
SshListener
Direct Known Subclasses:
SshTask

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);
  }
  ...
 }
 

Version:
1.0
Author:
vglass

Constructor Summary
SshAdapter()
           
 
Method Summary
 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

SSH Factory

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