Plugins
Plugins are the various standalone modules that work together on the KTA bus to create an application. Different plugins can be combined to put together a custom interface or automated actions. The plugins in use are specified by the plugins and pluginPath variables in the config file. For more information regarding these settings, and the specific settings for each plugin, please read the configuration page.
To develop a plugin, a class must be a child of the Plugin class. Plugins may be FilterPlugins (which filter network traffic) or VisualPlugins (which display a Component on the main application JFrame) or both. Usually plugins will also register to listen to various events occurring on the bus so that they can react appropriately.
A basic outline of what each plugin does follows.
ButtonBar | Capture | LocalProcess | MudConnector | Script | SecondaryWindowLogin | SecondaryWindowSSH | Shell | Sink | Socket | SSH | Status | Telnet | Terminal | Timeout | URLFilter
ButtonBar
The ButtonBar is a plugin used to create a graphical tool bar. The tool bar is constructed based on a config file. It may contain buttons, labels, input fields or drop-down menus. Each component (barring labels) can send data to the plugin bus. A component may also perform one of a number of built-in actions such as connecting to a new server, disconnecting, sending a telnet break or exiting the program.
Further information regarding the ButtonBar config file format is available from de/mud/jta/plugin/ButtonBar.java in the source code.
Capture
The Capture plugin can capture data coming through the plugin bus into a text area. This data can then be transferred to a server. The data is posted to a custom URL using an HTTP POST command, so a server component is also required for this plugin to be useful. A simple example servlet implementing the server side is available from tools/UploadServlet.java in the source code.
LocalProcess
LocalProcess should be the first plugin in the bus, because it doesn't pass any data through itself - it reads from and writes to local file handles.
LocalProcess is designed to run application software directly. This is useful in test or demonstration situations where setting up a socket connection to a server and dealing with protocols like telnet or SSH is overkill. The plugin simply wraps itself around an executable on the local machine and communicates with the plugin bus.
LocalProcess differs from Shell in that it does not use JNI and does not allocate a new pseudo-terminal, which is somewhat of a UNIXism.
MudConnector
MudConnector is a graphical plugin that displays a list of MUDs to connect to. It ties primarily into the http://www.mudconnector.com/ website, though users could make their own MUD lists.
Script
The Script plugin is used to script a series of expect/response pairs. It waits for each expect string in order and responds with the specified response string.
SecondaryWindowLogin
The SecondaryWindowLogin plugin is a graphical plugin that sits in the main KTA JFrame and handles a typical telnet or other application logon procedure. It is called a SecondaryWindowLogin because it listens for SecondaryWindowEvents and will show and hide the main KTA JFrame as necessary. It also works without a secondary window, however.
SecondaryWindowSSH
The SecondaryWindowSSH plugin is a graphical plugin that sits in the main KTA JFrame and handles both the SSH protocol and the SSH logon procedure. It is called a SecondaryWindowSSH because it listens for SecondaryWindowEvents and will show and hide the main KTA JFrame as necessary. It also works without a secondary window, however.
Shell
Shell should be the first plugin in the bus, because it doesn't pass any data through itself - it reads from and writes to a JNI library.
Shell is designed to emulate a local login by assigning a pseudo-terminal and running a local process. This avoids setting up a socket connection to a server and dealing with protocols like telnet or SSH. The plugin calls a JNI library and passes the name of an executable on the local machine - the JNI library will then request a pseudo-terminal and attach the executable input and output to the plugin bus.
Shell differs from LocalProcess in that it requires JNI and allocates a new pseudo-terminal. The JNI code is available from the jni/ subdirectory of the source code.
Sink
Sink should be the last plugin in the bus, because it doesn't write any data and all data it reads is slurped. It is used to continue pulling data through the bus while other plugins are waiting for data that can be parsed by them. Used with a Script plugin, for example, it will allow all non-matching data to be ignored.
Socket
Socket should be the first plugin in the bus, because it doesn't pass any data through itself - it reads from and writes to a TCP socket.
Because of web browser security settings, applets are often unable to connect to servers other than the originating server. To get around this problem, the KTA can use socket relaying. The Socket plugin can be set up to connect to the originating server on a specified port number, then a daemon listening on that port will relay data on to the real server. This daemon is available as tools/mrelayd.c in the source code.
SSH
The SSH plugin handles the SSH (secsh) protocol. It should be placed directly after the Socket plugin in the bus so it can decrypt network data before passing it on to the rest of the plugins.
Status
Status is a graphical plugin that provides a status bar. By default it will display the connection status, but it can also be customized to cycle through the contents of a file line-at-a-time. Status does not filter any data so can appear anywhere on the plugin bus.
Telnet
The Telnet plugin handles the telnet protocol. It should be placed directly after the Socket plugin in the bus so it can convert newlines and appropriately filter the data before passing it on to the rest of the plugins.
Terminal
Terminal is a vt320 terminal emulator that can be used to display and interact with data coming through the plugin bus. Terminal should be the last plugin in the bus, because all data it reads is slurped.
Timeout
The Timeout plugin simply waits for a specified inactivity period and then sends a burst of data to attempt to force a hangup/exit. If that fails, the connection is forcibly broken.
URLFilter
URLFilter is a graphical plugin that captures URLs as they are passed through the plugin bus and displays them in a list. When URLs are selected in the list, they will be shown in the current AppletContext. As such, this is not particularly useful outside of an applet situation.