org.objectweb.cjdbc.console.text.commands
Class ConsoleCommand

java.lang.Object
  extended byorg.objectweb.cjdbc.console.text.commands.ConsoleCommand
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
AbstractAdminCommand, AbstractMonitorCommand, AddDriver, Admin, Begin, Bind, CallStoredProcedure, Commit, Connect, DropDB, GetInfo, GetXml, Help, History, ListDatabases, Load, Load, Monitor, Native, Quit, RefreshLogs, Report, Rollback, SaveConfiguration, SetFetchSize, SetIsolation, SetMaxRows, SetSavePoint, SetTimeout, ShowLoggingConfig, ShowTables, Shutdown

public abstract class ConsoleCommand
extends java.lang.Object
implements java.lang.Comparable

This class defines a ConsoleCommand

Version:
1.0
Author:
Nicolas Modrzyk , Mathieu Peltier

Field Summary
protected  Console console
           
protected  RmiJmxClient jmxClient
           
protected  AbstractConsoleModule module
           
 
Constructor Summary
ConsoleCommand(AbstractConsoleModule module)
          Creates a new ConsoleCommand.java object
 
Method Summary
 int compareTo(java.lang.Object o)
           
 void execute(java.lang.String commandText)
          Check if the JMX connection is still valid.
abstract  java.lang.String getCommandDescription()
          Get the description of the command
abstract  java.lang.String getCommandName()
          Get the name of the command
 java.lang.String getCommandParameters()
          Return a String description of the parameters of this command.
 java.lang.String getUsage()
          Get the usage of the command.
abstract  void parse(java.lang.String commandText)
          Parse the text of the command
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

console

protected Console console

jmxClient

protected RmiJmxClient jmxClient

module

protected AbstractConsoleModule module
Constructor Detail

ConsoleCommand

public ConsoleCommand(AbstractConsoleModule module)
Creates a new ConsoleCommand.java object

Parameters:
module - module that owns this commands
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

parse

public abstract void parse(java.lang.String commandText)
                    throws java.lang.Exception
Parse the text of the command

Parameters:
commandText - the command text
Throws:
java.lang.Exception - if connection with the mbean server is lost or command does not have the proper format

execute

public void execute(java.lang.String commandText)
             throws java.lang.Exception
Check if the JMX connection is still valid. Otherwise reconnect.

Parameters:
commandText - the parameters to execute the command with
Throws:
java.lang.Exception - if fails

getCommandName

public abstract java.lang.String getCommandName()
Get the name of the command

Returns:
String of the command name

getCommandParameters

public java.lang.String getCommandParameters()
Return a String description of the parameters of this command.

Returns:
String like <driverPathName>

getCommandDescription

public abstract java.lang.String getCommandDescription()
Get the description of the command

Returns:
String of the command description

getUsage

public java.lang.String getUsage()
Get the usage of the command.

Returns:
String of the command usage ()


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.