Public Member Functions | |
GetBackendSchema (VirtualDatabaseAdmin module) | |
void | parse (String commandText) throws Exception |
String | getCommandName () |
String | getCommandDescription () |
String | getCommandParameters () |
Definition at line 43 of file GetBackendSchema.java.
|
Creates a new
Definition at line 51 of file GetBackendSchema.java. 00052 { 00053 super(module); 00054 }
|
|
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 }
|
|
Implements org.objectweb.cjdbc.console.text.commands.ConsoleCommand. Definition at line 101 of file GetBackendSchema.java. 00102 { 00103 return "getBackendSchema"; 00104 }
|
|
Reimplemented from org.objectweb.cjdbc.console.text.commands.ConsoleCommand. Definition at line 117 of file GetBackendSchema.java. 00118 { 00119 return "<backendName>"; 00120 }
|
|
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 }
|