1 23 24 package org.objectweb.cjdbc.console.text.commands.dbadmin; 25 26 import java.util.StringTokenizer ; 27 28 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 29 import org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin; 30 31 37 public class TransferDump extends AbstractAdminCommand 38 { 39 44 public TransferDump(VirtualDatabaseAdmin module) 45 { 46 super(module); 47 } 48 49 52 public void parse(String commandText) throws Exception 53 { 54 StringTokenizer st = new StringTokenizer (commandText); 55 String dumpName = null; 56 String controllerName = null; 57 boolean noCopy = false; 58 try 59 { 60 dumpName = st.nextToken(); 61 controllerName = st.nextToken(); 62 if (st.hasMoreTokens()) 63 { 64 noCopy = st.nextToken().equalsIgnoreCase("nocopy"); 65 } 66 } 67 catch (Exception e) 68 { 69 console.printError(getUsage()); 70 return; 71 } 72 73 console.print(ConsoleTranslate.get("admin.command.transfer.dump.echo", 74 new String []{dumpName, controllerName})); 75 jmxClient.getVirtualDatabaseProxy(dbName, user, password).transferDump( 76 dumpName, controllerName, noCopy); 77 console.print(ConsoleTranslate.get("admin.command.transfer.dump.done")); 78 } 79 80 83 public String getCommandParameters() 84 { 85 return ConsoleTranslate.get("admin.command.transfer.dump.params"); 86 } 87 88 91 public String getCommandName() 92 { 93 return "transfer dump"; 94 } 95 96 99 public String getCommandDescription() 100 { 101 return ConsoleTranslate.get("admin.command.transfer.dump.description"); 102 } 103 104 } 105 | Popular Tags |