1 24 25 package org.objectweb.cjdbc.console.text.commands.controller; 26 27 import java.util.ArrayList ; 28 29 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 30 import org.objectweb.cjdbc.console.text.ConsoleException; 31 import org.objectweb.cjdbc.console.text.commands.ConsoleCommand; 32 import org.objectweb.cjdbc.console.text.module.AbstractConsoleModule; 33 34 40 public class ListDatabases extends ConsoleCommand 41 { 42 43 48 public ListDatabases(AbstractConsoleModule module) 49 { 50 super(module); 51 } 52 53 56 public void parse(String commandText) throws Exception 57 { 58 try 59 { 60 ArrayList list = jmxClient.getControllerProxy().getVirtualDatabaseNames(); 61 for (int i = 0; i < list.size(); i++) 62 console.println((String ) list.get(i)); 63 } 64 catch (Exception e) 65 { 66 throw new ConsoleException(ConsoleTranslate.get( 67 "controller.command.listDatabases.failed", e)); 68 } 69 } 70 71 74 public String getCommandName() 75 { 76 return "show virtualdatabases"; 77 } 78 79 82 public String getCommandDescription() 83 { 84 return ConsoleTranslate.get("controller.command.listDatabases"); 85 } 86 87 } | Popular Tags |