01: /**
02: * Sequoia: Database clustering technology.
03: * Copyright (C) 2002-2004 French National Institute For Research In Computer
04: * Science And Control (INRIA).
05: * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
06: * Contact: sequoia@continuent.org
07: *
08: * Licensed under the Apache License, Version 2.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: * Initial developer(s): Nicolas Modrzyk
21: * Contributor(s): Emmanuel Cecchet.
22: */package org.continuent.sequoia.console.text.commands.controller;
23:
24: import org.continuent.sequoia.common.i18n.ConsoleTranslate;
25: import org.continuent.sequoia.console.text.ConsoleException;
26: import org.continuent.sequoia.console.text.commands.ConsoleCommand;
27: import org.continuent.sequoia.console.text.module.AbstractConsoleModule;
28:
29: /**
30: * This class defines a GetXml
31: *
32: * @author <a href="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>
33: * @author <a href="mailto:emmanuel.cecchet@emicnetworks.com">Emmanuel Cecchet
34: * </a>
35: * @version 1.0
36: */
37: public class GetXml extends ConsoleCommand {
38:
39: /**
40: * Creates a new <code>GetXml.java</code> object
41: *
42: * @param module the command is attached to
43: */
44: public GetXml(AbstractConsoleModule module) {
45: super (module);
46: }
47:
48: /**
49: * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#parse(java.lang.String)
50: */
51: public void parse(String commandText) throws Exception {
52: checkJmxConnectionToController();
53: try {
54: console.println(jmxClient.getControllerProxy().getXml());
55: } catch (Exception e) {
56: throw new ConsoleException(ConsoleTranslate
57: .get("controller.command.get.xml.error")); //$NON-NLS-1$
58: }
59:
60: }
61:
62: /**
63: * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#getCommandName()
64: */
65: public String getCommandName() {
66: return "show controller config"; //$NON-NLS-1$
67: }
68:
69: /**
70: * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#getCommandDescription()
71: */
72: public String getCommandDescription() {
73: return ConsoleTranslate
74: .get("controller.command.get.xml.description"); //$NON-NLS-1$
75: }
76:
77: }
|