org.objectweb.cjdbc.console.text
Class Console

java.lang.Object
  extended byorg.objectweb.cjdbc.console.text.Console

public class Console
extends java.lang.Object

This is the C-JDBC controller console that allows remote administration and monitoring of any C-JDBC controller.

Version:
1.0
Author:
Emmanuel Cecchet , Mathieu Peltier , Nicolas Modrzyk

Field Summary
private  VirtualDatabaseAdmin adminModule
          Virtual database administration console.
private  VirtualDatabaseConsole consoleModule
          Virtual database console.
private  jline.ConsoleReader consoleReader
          ConsoleReader allowing to reading input.
private  ControllerConsole controllerModule
          Controller Console
private  boolean debug
          Debug Mode
private  boolean interactive
          true if the console is used in interactive mode.
private  RmiJmxClient jmxClient
           
private  MonitorConsole monitorModule
          Monitoring console
private static java.lang.Character PASSWORD_CHAR
           
private  boolean printColor
           
 
Constructor Summary
Console(RmiJmxClient jmxClient, java.io.InputStream in, boolean interactive)
          Creates a new Console instance.
 
Method Summary
 VirtualDatabaseAdmin getAdminModule()
          Returns the adminModule value.
 VirtualDatabaseConsole getConsoleModule()
          Returns the consoleModule value.
 jline.ConsoleReader getConsoleReader()
          Returns the consoleReader value.
 ControllerConsole getControllerModule()
          Returns the controllerModule value.
 RmiJmxClient getJmxClient()
          Returns the jmxClient value.
 MonitorConsole getMonitorModule()
          Returns the monitorModule value.
 void handlePrompt()
          Main menu prompt handling.
 boolean isInteractive()
          Returns the interactive value.
 void print(java.lang.String s)
           
 void printError(java.lang.String message)
           
 void printError(java.lang.String message, java.lang.Exception e)
          Display an error and stack trace if in debug mode.
 void printInfo(java.lang.String message)
           
 void println()
           
 void println(java.lang.String s)
           
 void println(java.lang.String s, int color)
          Print in color
private  void printPrompt(java.lang.String string)
          Print prompt line
 java.lang.String readLine(java.lang.String prompt)
           
 java.lang.String readPassword(java.lang.String prompt)
           
 void setDebug(boolean debug)
          Alert this console to show additionnal debugging information
private  void setSupportColors()
           
 void showInfo(java.lang.String[][] info, InfoViewer viewer)
          Show a table of info in a formatted way
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consoleReader

private jline.ConsoleReader consoleReader
ConsoleReader allowing to reading input.


PASSWORD_CHAR

private static final java.lang.Character PASSWORD_CHAR

interactive

private boolean interactive
true if the console is used in interactive mode.


jmxClient

private RmiJmxClient jmxClient

adminModule

private VirtualDatabaseAdmin adminModule
Virtual database administration console.


monitorModule

private MonitorConsole monitorModule
Monitoring console


consoleModule

private VirtualDatabaseConsole consoleModule
Virtual database console.


controllerModule

private ControllerConsole controllerModule
Controller Console


debug

private boolean debug
Debug Mode


printColor

private boolean printColor
Constructor Detail

Console

public Console(RmiJmxClient jmxClient,
               java.io.InputStream in,
               boolean interactive)
Creates a new Console instance.

Parameters:
jmxClient - to connect to the jmxServer
in - the inputstream to get the command from
interactive - if set to true will display prompt
Method Detail

setDebug

public void setDebug(boolean debug)
Alert this console to show additionnal debugging information

Parameters:
debug - true if debug information needed

setSupportColors

private void setSupportColors()

isInteractive

public boolean isInteractive()
Returns the interactive value.

Returns:
Returns the interactive.

handlePrompt

public void handlePrompt()
Main menu prompt handling.


readLine

public java.lang.String readLine(java.lang.String prompt)
                          throws ConsoleException
Throws:
ConsoleException
See Also:
readLine(java.lang.String)

printPrompt

private void printPrompt(java.lang.String string)
Print prompt line

Parameters:
string - the string to pring

readPassword

public java.lang.String readPassword(java.lang.String prompt)
                              throws ConsoleException
Throws:
ConsoleException
See Also:
readPassword(java.lang.String)

print

public void print(java.lang.String s)
See Also:
print(java.lang.String)

println

public void println(java.lang.String s)
See Also:
println(java.lang.String)

println

public void println(java.lang.String s,
                    int color)
Print in color

Parameters:
s - the message to display
color - the color to use

println

public void println()
See Also:
println()

printError

public void printError(java.lang.String message)
See Also:
printError(java.lang.String)

printInfo

public void printInfo(java.lang.String message)
See Also:
println()

printError

public void printError(java.lang.String message,
                       java.lang.Exception e)
Display an error and stack trace if in debug mode.

Parameters:
message - error message
e - exception that causes the error

showInfo

public void showInfo(java.lang.String[][] info,
                     InfoViewer viewer)
Show a table of info in a formatted way

Parameters:
info - the data to display
viewer - the viewer to use to get the name of the columns and the format of data

getJmxClient

public RmiJmxClient getJmxClient()
Returns the jmxClient value.

Returns:
Returns the jmxClient.

getAdminModule

public VirtualDatabaseAdmin getAdminModule()
Returns the adminModule value.

Returns:
Returns the adminModule.

getConsoleModule

public VirtualDatabaseConsole getConsoleModule()
Returns the consoleModule value.

Returns:
Returns the consoleModule.

getControllerModule

public ControllerConsole getControllerModule()
Returns the controllerModule value.

Returns:
Returns the controllerModule.

getMonitorModule

public MonitorConsole getMonitorModule()
Returns the monitorModule value.

Returns:
Returns the monitorModule.

getConsoleReader

public final jline.ConsoleReader getConsoleReader()
Returns the consoleReader value.

Returns:
Returns the consoleReader.


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