Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.console.text.commands.controller.Load Class Reference

Inheritance diagram for org.objectweb.cjdbc.console.text.commands.controller.Load:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.cjdbc.console.text.commands.controller.Load:

Collaboration graph
[legend]
List of all members.

Public Member Functions

String getCommandParameters ()
 Load (AbstractConsoleModule module)
void parse (String commandText) throws Exception
String getCommandName ()
String getCommandDescription ()

Detailed Description

This class defines a Load

Author:
Nicolas Modrzyk
Version:
1.0

Definition at line 41 of file Load.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.text.commands.controller.Load.Load AbstractConsoleModule  module  ) 
 

Creates a new Load.java object

Parameters:
module the command is attached to

Definition at line 57 of file Load.java.

00058   {
00059     super(module);
00060   }


Member Function Documentation

String org.objectweb.cjdbc.console.text.commands.controller.Load.getCommandDescription  )  [virtual]
 

See also:
org.objectweb.cjdbc.console.text.commands.ConsoleCommand.getCommandDescription()

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

Definition at line 109 of file Load.java.

00110   {
00111     return ConsoleTranslate.get("controller.command.load");
00112   }

String org.objectweb.cjdbc.console.text.commands.controller.Load.getCommandName  )  [virtual]
 

See also:
org.objectweb.cjdbc.console.text.commands.ConsoleCommand.getCommandName()

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

Definition at line 101 of file Load.java.

00102   {
00103     return "load";
00104   }

String org.objectweb.cjdbc.console.text.commands.controller.Load.getCommandParameters  ) 
 

See also:
org.objectweb.cjdbc.console.text.commands.ConsoleCommand.getCommandParameters()

Reimplemented from org.objectweb.cjdbc.console.text.commands.ConsoleCommand.

Definition at line 47 of file Load.java.

00048   {
00049     return "<pathtoXMLfile>";
00050   }

void org.objectweb.cjdbc.console.text.commands.controller.Load.parse String  commandText  )  throws Exception [virtual]
 

See also:
org.objectweb.cjdbc.console.text.commands.ConsoleCommand.parse(java.lang.String)

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

Definition at line 65 of file Load.java.

References org.objectweb.cjdbc.console.jmx.RmiJmxClient.getControllerProxy(), org.objectweb.cjdbc.console.text.Console.println(), and org.objectweb.cjdbc.console.text.Console.readLine().

00066   {
00067     String filename = null;
00068     // Get the file name if needed
00069     if (commandText == null || commandText.trim().equals(""))
00070       filename = console.readLine(ConsoleTranslate
00071           .get("controller.command.load.input"));
00072     else
00073       filename = commandText.trim();
00074     if (filename == null)
00075       throw new ConsoleException(ConsoleTranslate
00076           .get("controller.command.load.file.null"));
00077     FileReader fileReader;
00078     fileReader = new FileReader(filename);
00079 
00080     // Read the file
00081     BufferedReader in = new BufferedReader(fileReader);
00082     StringBuffer xml = new StringBuffer();
00083     String line;
00084     do
00085     {
00086       line = in.readLine();
00087       if (line != null)
00088         xml.append(line);
00089     }
00090     while (line != null);
00091 
00092     // Send it to the controller
00093     jmxClient.getControllerProxy().addVirtualDatabases(xml.toString());
00094     console.println(ConsoleTranslate.get("controller.command.load.success",
00095         filename));
00096   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:02:48 2005 for C-JDBC by  doxygen 1.3.9.1