00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.cjdbc.console.text.commands.controller;
00026
00027 import java.io.BufferedWriter;
00028 import java.io.File;
00029 import java.io.FileWriter;
00030
00031 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate;
00032 import org.objectweb.cjdbc.console.text.commands.ConsoleCommand;
00033 import org.objectweb.cjdbc.console.text.module.AbstractConsoleModule;
00034
00035
00036
00037
00038
00039
00040
00041 public class Report extends ConsoleCommand
00042 {
00043
00044
00045
00046
00047
00048
00049 public Report(AbstractConsoleModule module)
00050 {
00051 super(module);
00052 }
00053
00054
00055
00056
00057 public void parse(String commandText) throws Exception
00058 {
00059 if (commandText == null || commandText.equalsIgnoreCase(""))
00060 {
00061
00062 console.println(jmxClient.getControllerProxy().generateReport());
00063 }
00064 else
00065 {
00066
00067 File f = new File(commandText.trim());
00068 BufferedWriter writer = new BufferedWriter(new FileWriter(f));
00069 writer.write(jmxClient.getControllerProxy().generateReport());
00070 writer.flush();
00071 writer.close();
00072 }
00073 }
00074
00075
00076
00077
00078 public String getCommandName()
00079 {
00080 return "generateReport";
00081 }
00082
00083
00084
00085
00086 public String getCommandDescription()
00087 {
00088 return ConsoleTranslate.get("controller.command.generateReport");
00089 }
00090
00091 }