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 39 public class TransferBackend extends AbstractAdminCommand 40 { 41 42 47 public TransferBackend(VirtualDatabaseAdmin module) 48 { 49 super(module); 50 } 51 52 55 public void parse(String commandText) throws Exception 56 { 57 String controller = null; 58 String backendName = null; 59 StringTokenizer st = new StringTokenizer (commandText.trim()); 60 61 try 62 { 63 backendName = st.nextToken(); 64 controller = st.nextToken(); 65 66 console.println(ConsoleTranslate.get("admin.command.transfer.echo", 67 new String []{backendName, controller})); 68 VirtualDatabaseMBean vjdc = jmxClient.getVirtualDatabaseProxy(dbName, 69 user, password); 70 vjdc.transferBackend(backendName, controller); 71 } 72 catch (Exception e) 73 { 74 console.println(ConsoleTranslate.get("admin.command.transfer.error", e)); 75 } 76 } 77 78 81 public String getCommandName() 82 { 83 return "transfer backend"; 84 } 85 86 89 public String getCommandDescription() 90 { 91 return ConsoleTranslate.get("admin.command.transfer.description"); 92 } 93 94 97 public String getCommandParameters() 98 { 99 return "<backendName> <controllerJMXaddress>"; 100 } 101 } 102 | Popular Tags |