1 /**2 * C-JDBC: Clustered JDBC.3 * Copyright (C) 2002-2004 French National Institute For Research In Computer4 * Science And Control (INRIA).5 * Contact: c-jdbc@objectweb.org6 * 7 * This library is free software; you can redistribute it and/or modify it8 * under the terms of the GNU Lesser General Public License as published by the9 * Free Software Foundation; either version 2.1 of the License, or any later10 * version.11 * 12 * This library is distributed in the hope that it will be useful, but WITHOUT13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License15 * for more details.16 * 17 * You should have received a copy of the GNU Lesser General Public License18 * along with this library; if not, write to the Free Software Foundation,19 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.20 *21 * Initial developer(s): Nicolas Modrzyk22 * Contributor(s): ______________________.23 */24 25 package org.objectweb.cjdbc.console.text.module;26 27 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate;28 import org.objectweb.cjdbc.console.text.Console;29 import org.objectweb.cjdbc.console.text.commands.controller.AddDriver;30 import org.objectweb.cjdbc.console.text.commands.controller.Admin;31 import org.objectweb.cjdbc.console.text.commands.controller.Bind;32 import org.objectweb.cjdbc.console.text.commands.controller.Connect;33 import org.objectweb.cjdbc.console.text.commands.controller.DropDB;34 import org.objectweb.cjdbc.console.text.commands.controller.GetXml;35 import org.objectweb.cjdbc.console.text.commands.controller.ListDatabases;36 import org.objectweb.cjdbc.console.text.commands.controller.Load;37 import org.objectweb.cjdbc.console.text.commands.controller.Monitor;38 import org.objectweb.cjdbc.console.text.commands.controller.RefreshLogs;39 import org.objectweb.cjdbc.console.text.commands.controller.SaveConfiguration;40 import org.objectweb.cjdbc.console.text.commands.controller.ShowLoggingConfig;41 import org.objectweb.cjdbc.console.text.commands.controller.Shutdown;42 43 /**44 * This class defines a ControllerConsole45 * 46 * @author <a HREF="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>47 * @version 1.048 */49 public class ControllerConsole extends AbstractConsoleModule50 {51 52 /**53 * Creates a new <code>ControllerConsole.java</code> object54 * 55 * @param console the controller console is attached to56 */57 public ControllerConsole(Console console)58 {59 super(console);60 }61 62 /**63 * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#loadCommands()64 */65 protected void loadCommands()66 {67 commands.add(new AddDriver(this));68 commands.add(new RefreshLogs(this));69 commands.add(new Shutdown (this));70 commands.add(new GetXml(this));71 commands.add(new SaveConfiguration(this));72 commands.add(new ShowLoggingConfig(this));73 commands.add(new ListDatabases(this));74 commands.add(new Load(this));75 commands.add(new Admin(this));76 commands.add(new Bind(this));77 commands.add(new Connect(this));78 commands.add(new Monitor(this));79 commands.add(new DropDB(this));80 }81 82 /**83 * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#quit()84 */85 public void quit()86 {87 super.quit();88 console.println(ConsoleTranslate.get("console.byebye"));89 }90 91 /**92 * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#getPromptString()93 */94 public String getPromptString()95 {96 return console.getJmxClient().getRemoteName();97 }98 99 /**100 * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#login(String[])101 */102 public void login(String [] params)103 {104 // do nothing105 }106 107 /**108 * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#getDescriptionString()109 */110 public String getDescriptionString()111 {112 return "Controller";113 }114 }115