examples
Class BasicClient

java.lang.Object
  extended byjava.awt.event.WindowAdapter
      extended byexamples.BasicClient
All Implemented Interfaces:
java.util.EventListener, java.lang.Runnable, TerminalMenuListener, java.awt.event.WindowFocusListener, java.awt.event.WindowListener, java.awt.event.WindowStateListener

public final class BasicClient
extends java.awt.event.WindowAdapter
implements TerminalMenuListener, java.lang.Runnable

Basic ssh2 client demo. Opens a terminal window and asks the usere where to connect to.

Username and password as well as server can be stored in properties.

It can also read portforwards from properties. Create properties named 'localN' or 'remoteN' where N is an integer 0-31. The contents of the properties is in the following format:

   [/plugin/][:]::
 
This client understands the ftp and sniff plugins.


Constructor Summary
BasicClient(java.util.Properties props)
          Simple constructor.
 
Method Summary
 void close(TerminalMenuHandler originMenu)
           
 void doClose()
           
 int getExitStatus()
           
static void main(java.lang.String[] argv)
           
static java.lang.Object[] parseForwardSpec(java.lang.String spec, java.lang.String listenAddr)
          Parse a portforward specification string
 void run()
          Actually runs the client.
 void update()
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicClient

public BasicClient(java.util.Properties props)
Simple constructor. All required properties have good default values so no properties have to be provided. However the properties is the only way to change the encryption algorithms etc in this client.

Method Detail

run

public void run()
Actually runs the client. This gets called from the main function.

Specified by:
run in interface java.lang.Runnable

getExitStatus

public int getExitStatus()

parseForwardSpec

public static java.lang.Object[] parseForwardSpec(java.lang.String spec,
                                                  java.lang.String listenAddr)
                                           throws java.lang.IllegalArgumentException
Parse a portforward specification string

Throws:
java.lang.IllegalArgumentException

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

close

public void close(TerminalMenuHandler originMenu)
Specified by:
close in interface TerminalMenuListener

doClose

public void doClose()

update

public void update()
Specified by:
update in interface TerminalMenuListener

main

public static void main(java.lang.String[] argv)