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

org.objectweb.cjdbc.console.text.commands.dbadmin.GetBackendSchema Class Reference

Inheritance diagram for org.objectweb.cjdbc.console.text.commands.dbadmin.GetBackendSchema:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GetBackendSchema (VirtualDatabaseAdmin module)
void parse (String commandText) throws Exception
String getCommandName ()
String getCommandDescription ()
String getCommandParameters ()

Detailed Description

Command to get the schema of a database backend

Author:
Nicolas Modrzyk
Version:
1.0

Definition at line 43 of file GetBackendSchema.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.text.commands.dbadmin.GetBackendSchema.GetBackendSchema VirtualDatabaseAdmin  module  ) 
 

Creates a new GetBackendSchema object

Parameters:
module owning module

Definition at line 51 of file GetBackendSchema.java.

00052   {
00053     super(module);
00054   }


Member Function Documentation

String org.objectweb.cjdbc.console.text.commands.dbadmin.GetBackendSchema.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 GetBackendSchema.java.

00110   {
00111     return ConsoleTranslate.get("admin.command.get.backend.schema");
00112   }

String org.objectweb.cjdbc.console.text.commands.dbadmin.GetBackendSchema.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 GetBackendSchema.java.

00102   {
00103     return "getBackendSchema";
00104   }

String org.objectweb.cjdbc.console.text.commands.dbadmin.GetBackendSchema.getCommandParameters  ) 
 

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

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

Definition at line 117 of file GetBackendSchema.java.

00118   {
00119     return "<backendName>";
00120   }

void org.objectweb.cjdbc.console.text.commands.dbadmin.GetBackendSchema.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 59 of file GetBackendSchema.java.

References org.objectweb.cjdbc.console.text.Console.println().

00060   {
00061 
00062     StringTokenizer st = new StringTokenizer(commandText);
00063     int tokens = st.countTokens(); 
00064     if (tokens < 1)
00065       throw new ConsoleException(ConsoleTranslate
00066           .get("console.error.invalid.comment.argument"));
00067 
00068     String backendName = st.nextToken();
00069     String fileName = null;
00070     if (tokens >= 2)
00071     {
00072       fileName = st.nextToken().trim();
00073     }
00074     console.println(ConsoleTranslate.get(
00075         "admin.command.get.backend.schema.echo", new String[]{backendName,
00076             String.valueOf(fileName != null)}));
00077 
00078     VirtualDatabaseMBean vdjc = jmxClient.getVirtualDatabaseProxy(dbName, user,
00079         password);
00080 
00081     if (fileName == null)
00082     {
00083       //Write to standard output
00084       console.println(vdjc.getBackendSchema(backendName));
00085     }
00086     else
00087     {
00088       // Write to file
00089       File f = new File(fileName);
00090       BufferedWriter writer = new BufferedWriter(new FileWriter(f));
00091       writer.write(vdjc.getBackendSchema(backendName));
00092       writer.flush();
00093       writer.close();
00094     }
00095 
00096   }


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