Class modules.Script
All Packages Class Hierarchy This Package Previous Next Index
Class modules.Script
java.lang.Object
|
+----java.util.Dictionary
|
+----java.util.Hashtable
|
+----modules.Script
- public class Script
- extends Hashtable
- implements Module
A very simple scripting module. It takes pairs of pattern and text and
sends the corresponding text when the pattern matches. Each pattern is
only matched once per connected session.
- Scripts:
<PARAM NAME=script VALUE="pattern|text|...">
- A script contains of pairs of pattern and text strings.
If the pattern is matched against the output from the remote host,
the corresponding text will be sent. Each pattern will match only
once per session. A session is defined by connect and disconnect.
Thus it is possible to program an autologin as follows:
"login:|leo|Password:|mypassword|leo@www|ls"
Newlines will be added automatically to the string sent! At the
moment the order of the pattern and text pairs is not relevant.
- Version:
- $Id: Script.java,v 1.4 1997/03/24 14:55:19 leo Exp $
- Author:
- Matthias L. Jugel, Marcus Meißner
- See Also:
- Module
-
Script()
-
-
connect(String, int)
- Configure the script module by reading the script PARAMeter.
-
disconnect()
- Get notified of disconnection.
-
receive(String)
- This method is called when data is received.
-
setLoader(Object)
- Set the applet as module loader
Script
public Script()
setLoader
public void setLoader(Object o)
- Set the applet as module loader
- Parameters:
- o - the object that is the applet (must be an Applet)
- See Also:
- Module, Applet
connect
public void connect(String host,
int port)
- Configure the script module by reading the script PARAMeter.
- Parameters:
- host - remote hostaddress - not used
- port - remote port - not used
disconnect
public void disconnect()
- Get notified of disconnection. Do nothing.
receive
public String receive(String s)
- This method is called when data is received. It tries to match the
input to the list of patterns and sends corresponding text on success.
- Parameters:
- s - The string to test.
- See Also:
- InputPeer
All Packages Class Hierarchy This Package Previous Next Index