1 24 25 package org.objectweb.cjdbc.console.text.commands.dbadmin; 26 27 import java.util.ArrayList ; 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 ListBackends extends AbstractAdminCommand 39 { 40 41 46 public ListBackends(VirtualDatabaseAdmin module) 47 { 48 super(module); 49 } 50 51 54 public void parse(String commandText) throws Exception 55 { 56 VirtualDatabaseMBean db = jmxClient.getVirtualDatabaseProxy(dbName, user, 57 password); 58 ArrayList backendNames = db.getAllBackendNames(); 59 for (int i = 0; i < backendNames.size(); i++) 60 { 61 String backendName = (String ) backendNames.get(i); 62 console.println(backendName); 63 } 64 } 65 66 69 public String getCommandName() 70 { 71 72 return "show backends"; 73 } 74 75 78 public String getCommandDescription() 79 { 80 return ConsoleTranslate.get("admin.command.list.backends.description"); 81 } 82 83 } 84 | Popular Tags |