de.mud.jta.plugin
Class SSH

java.lang.Object
  extended by de.mud.jta.Plugin
      extended by de.mud.jta.plugin.SSH
All Implemented Interfaces:
FilterPlugin, VisualPlugin

public class SSH
extends Plugin
implements FilterPlugin, VisualPlugin

Secure Shell plugin for the JTA. This is a plugin to be used instead of Telnet for secure remote terminal sessions over insecure networks. Take a look at the package de.mud.ssh for further information about ssh or look at the official ssh homepage: http://www.ssh.fi/.

Maintainer: Matthias L. Jugel

Version:
$Id: SSH.java 513 2005-12-19 07:59:45Z leo $
Author:
Matthias L. Jugel, Marcus Mei???ner

Field Summary
protected  SshIO handler
           
protected  java.lang.String pass
           
protected  FilterPlugin source
           
protected  java.lang.String user
           
 
Fields inherited from class de.mud.jta.Plugin
bus, id
 
Constructor Summary
SSH(PluginBus bus, java.lang.String id)
          Create a new ssh plugin.
 
Method Summary
 FilterPlugin getFilterSource()
           
 javax.swing.JMenu getPluginMenu()
          Get the menu entry for this component.
 javax.swing.JComponent getPluginVisual()
          Get the visible components from the plugin.
 int read(byte[] b)
          Read data from the backend and decrypt it.
 void setFilterSource(FilterPlugin source)
          Set the source plugin where we get our data from and where the data sink (write) is.
 void write(byte[] b)
          Write data to the back end.
 
Methods inherited from class de.mud.jta.Plugin
error, getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected FilterPlugin source

handler

protected SshIO handler

user

protected java.lang.String user

pass

protected java.lang.String pass
Constructor Detail

SSH

public SSH(PluginBus bus,
           java.lang.String id)
Create a new ssh plugin.

Method Detail

setFilterSource

public void setFilterSource(FilterPlugin source)
Description copied from interface: FilterPlugin
Set the source plugin where we get our data from and where the data sink (write) is. The actual data handling should be done in the read() and write() methods.

Specified by:
setFilterSource in interface FilterPlugin
Parameters:
source - the data source

getFilterSource

public FilterPlugin getFilterSource()
Specified by:
getFilterSource in interface FilterPlugin

read

public int read(byte[] b)
         throws java.io.IOException
Read data from the backend and decrypt it. This is a buffering read as the encrypted information is usually smaller than its decrypted pendant. So it will not read from the backend as long as there is data in the buffer.

Specified by:
read in interface FilterPlugin
Parameters:
b - the buffer where to read the decrypted data in
Returns:
the amount of bytes actually read.
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Write data to the back end. This hands the data over to the ssh protocol handler who encrypts the information and writes it to the actual back end pipe.

Specified by:
write in interface FilterPlugin
Parameters:
b - the unencrypted data to be encrypted and sent
Throws:
java.io.IOException

getPluginVisual

public javax.swing.JComponent getPluginVisual()
Description copied from interface: VisualPlugin
Get the visible components from the plugin.

Specified by:
getPluginVisual in interface VisualPlugin
Returns:
a component that represents the plugin

getPluginMenu

public javax.swing.JMenu getPluginMenu()
Description copied from interface: VisualPlugin
Get the menu entry for this component.

Specified by:
getPluginMenu in interface VisualPlugin
Returns:
a menu that can be used to change the plugin state