KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > console > text > commands > controller > GetXml


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
6  * Contact: sequoia@continuent.org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * 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  */

23
24 package org.continuent.sequoia.console.text.commands.controller;
25
26 import org.continuent.sequoia.common.i18n.ConsoleTranslate;
27 import org.continuent.sequoia.console.text.ConsoleException;
28 import org.continuent.sequoia.console.text.commands.ConsoleCommand;
29 import org.continuent.sequoia.console.text.module.AbstractConsoleModule;
30
31 /**
32  * This class defines a GetXml
33  *
34  * @author <a HREF="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>
35  * @author <a HREF="mailto:emmanuel.cecchet@emicnetworks.com">Emmanuel Cecchet
36  * </a>
37  * @version 1.0
38  */

39 public class GetXml extends ConsoleCommand
40 {
41
42   /**
43    * Creates a new <code>GetXml.java</code> object
44    *
45    * @param module the command is attached to
46    */

47   public GetXml(AbstractConsoleModule module)
48   {
49     super(module);
50   }
51
52   /**
53    * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#parse(java.lang.String)
54    */

55   public void parse(String JavaDoc commandText) throws Exception JavaDoc
56   {
57     checkJmxConnectionToController();
58     try
59     {
60       console.println(jmxClient.getControllerProxy().getXml());
61     }
62     catch (Exception JavaDoc e)
63     {
64       throw new ConsoleException(ConsoleTranslate
65           .get("controller.command.get.xml.error")); //$NON-NLS-1$
66
}
67
68   }
69
70   /**
71    * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#getCommandName()
72    */

73   public String JavaDoc getCommandName()
74   {
75     return "show controller config"; //$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("controller.command.get.xml.description"); //$NON-NLS-1$
84
}
85
86 }
Popular Tags