1 24 25 package org.objectweb.cjdbc.console.text.commands.controller; 26 27 import java.io.BufferedWriter ; 28 import java.io.File ; 29 import java.io.FileWriter ; 30 31 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 32 import org.objectweb.cjdbc.console.text.commands.ConsoleCommand; 33 import org.objectweb.cjdbc.console.text.module.AbstractConsoleModule; 34 35 41 public class Report extends ConsoleCommand 42 { 43 44 49 public Report(AbstractConsoleModule module) 50 { 51 super(module); 52 } 53 54 57 public void parse(String commandText) throws Exception 58 { 59 if (commandText == null || commandText.equalsIgnoreCase("")) 60 { 61 console.println(jmxClient.getControllerProxy().generateReport()); 63 } 64 else 65 { 66 File f = new File (commandText.trim()); 68 BufferedWriter writer = new BufferedWriter (new FileWriter (f)); 69 writer.write(jmxClient.getControllerProxy().generateReport()); 70 writer.flush(); 71 writer.close(); 72 } 73 } 74 75 78 public String getCommandName() 79 { 80 return "generateReport"; 81 } 82 83 86 public String getCommandDescription() 87 { 88 return ConsoleTranslate.get("controller.command.generateReport"); 89 } 90 91 } | Popular Tags |