1 24 25 package org.objectweb.cjdbc.console.text.commands.dbadmin; 26 27 import java.util.StringTokenizer ; 28 29 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 30 import org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean; 31 import org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin; 32 33 38 public class UpdateDumpPath extends AbstractAdminCommand 39 { 40 41 46 public UpdateDumpPath(VirtualDatabaseAdmin module) 47 { 48 super(module); 49 } 50 51 54 public void parse(String commandText) throws Exception 55 { 56 String dumpName = null; 57 String newPath = null; 58 StringTokenizer st = new StringTokenizer (commandText.trim()); 59 60 if (st.countTokens() != 2) 61 { 62 console.printError(getUsage()); 63 return; 64 } 65 try 66 { 67 dumpName = st.nextToken(); 68 newPath = st.nextToken(); 69 if (dumpName == null || newPath == null) 70 { 71 console.printError(getUsage()); 72 return; 73 } 74 75 console.println(ConsoleTranslate.get("admin.command.update.dump.path.echo", 76 new String []{dumpName, newPath})); 77 VirtualDatabaseMBean vdjc = jmxClient.getVirtualDatabaseProxy(dbName, user, 78 password); 79 vdjc.updateDumpPath(dumpName, newPath); 80 console.println(ConsoleTranslate.get("admin.command.update.dump.path.done", 81 new String []{dumpName, newPath})); 82 } 83 catch (Exception e) 84 { 85 console.printError("problem while updating path", e); } 87 } 88 89 92 public String getCommandName() 93 { 94 return "force path"; 95 } 96 97 100 public String getCommandDescription() 101 { 102 return ConsoleTranslate.get("admin.command.update.dump.path.description"); 103 } 104 105 108 public String getCommandParameters() 109 { 110 return ConsoleTranslate.get("admin.command.update.dump.path.parameters"); 111 } 112 } 113 | Popular Tags |