Main Page   Class Hierarchy   Compound List   File List   Compound Members  

InternalCommands Class Reference

Inheritance diagram for InternalCommands:

Inheritance graph
[legend]
Collaboration diagram for InternalCommands:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class InternalCommands is internal class implementing command handler for some basic and necessary actions which requires access to internal connection data such as 'quit' command, 'who', 'close'.

for details look in help() method content.

Definition at line 280 of file ConnectionServer.java.

Public Methods

String handleCommand (String comm)
 handleCommand handle and process given command as a String here.

String help ()
 help method should return string containing help for all commands provided by this command handler.

String help (String command)
 help method should return string describing in detail command given as a parameter or empty string if there is no such command in this command handler.

CommandHandlerIfc getInstance ()
 getInstance method should return instance of defined implementation for this instance.


Protected Methods

String buildFileString (File ff)
String setForTrueOrFalse (boolean cond, String for_true, String for_false)

Protected Attributes

String last_command = null


Member Function Documentation

CommandHandlerIfc getInstance   [inline]
 

getInstance method should return instance of defined implementation for this instance.

Common implementation should lookds like following:

 public class MyCommandHandler implements remotecons.ifc.CommandHandlerIfc
 {
 
   (... other methods definition  ...)

   public remotecons.ifc.CommandHandlerIfc getInstance()
   { return new MyCommandHandler();  }
 }
 
It is necessary for cases when you create commands handlers which are inner classes. Maybe it is not good practice but very useful for developing and debuging applications which works long time.

Returns:
a CommandHandlerIfc value of instance your command handler implementation.

Implements CommandHandlerIfc.

Definition at line 461 of file ConnectionServer.java.

String handleCommand String    comm [inline]
 

handleCommand handle and process given command as a String here.

If you will return null or empty string it will be treated as 'Command was not understand.'

To get next command prompt on user side you must return string ended with "
" characters. If you don't it will be treated as command in progress and require additional info from user so command prompt will not be printed out but only your returned string. Next imput from user will be passed to all command handlers.

Parameters:
command a String value typed by the user.
Returns:
a String value of output produced by command handler.

Implements CommandHandlerIfc.

Definition at line 284 of file ConnectionServer.java.

String help String    command [inline]
 

help method should return string describing in detail command given as a parameter or empty string if there is no such command in this command handler.

Parameters:
command a String value
Returns:
a String value

Implements CommandHandlerIfc.

Definition at line 457 of file ConnectionServer.java.

String help   [inline]
 

help method should return string containing help for all commands provided by this command handler.

Returns:
a String value with help for all commands.

Implements CommandHandlerIfc.

Definition at line 444 of file ConnectionServer.java.


The documentation for this class was generated from the following file:
Generated on Thu Dec 19 21:00:47 2002 for WTTools - Remote Console by doxygen1.3-rc2