KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > console > text > commands > dbadmin > DumpQueues


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2006 Continuent.
4  * Contact: sequoia@continuent.org
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * Initial developer(s): Jeff Mesnil.
19  * Contributor(s): ______________________.
20  */

21
22 package org.continuent.sequoia.console.text.commands.dbadmin;
23
24 import org.continuent.sequoia.common.i18n.ConsoleTranslate;
25 import org.continuent.sequoia.common.jmx.mbeans.BackendTaskQueuesControlMBean;
26 import org.continuent.sequoia.console.text.module.VirtualDatabaseAdmin;
27
28 /**
29  * This class defines the command used to dump the backend task queues.
30  */

31 public class DumpQueues extends AbstractAdminCommand
32 {
33
34   /**
35    * Creates a new <code>DumpQueues</code> object
36    *
37    * @param module the commands is attached to
38    */

39   public DumpQueues(VirtualDatabaseAdmin module)
40   {
41     super(module);
42   }
43
44   /**
45    * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#parse(java.lang.String)
46    */

47   public void parse(String JavaDoc commandText) throws Exception JavaDoc
48   {
49     if (commandText.trim().length() == 0)
50     {
51       console.printError(getUsage());
52       return;
53     }
54
55     String JavaDoc backend = commandText.trim();
56     BackendTaskQueuesControlMBean taskQueues = jmxClient.getBackendTaskQueues(
57         dbName, backend, user, password);
58     console.print(taskQueues.dump());
59   }
60
61   /**
62    * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#getCommandName()
63    */

64   public String JavaDoc getCommandName()
65   {
66
67     return "dump queues"; //$NON-NLS-1$
68
}
69
70   /**
71    * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#getCommandParameters()
72    */

73   public String JavaDoc getCommandParameters()
74   {
75     return ConsoleTranslate.get("DumpQueues.params"); //$NON-NLS-1$
76
}
77
78   /**
79    * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#getCommandDescription()
80    */

81   public String JavaDoc getCommandDescription()
82   {
83     return ConsoleTranslate.get("DumpQueues.description"); //$NON-NLS-1$
84
}
85 }
86
Popular Tags