01: /**
02: * Sequoia: Database clustering technology.
03: * Copyright (C) 2005 Continuent, Inc.
04: * Contact: sequoia@continuent.org
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
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): Emmanuel Cecchet
19: * Contributor(s): ______________________.
20: */package org.continuent.sequoia.console.text.commands.dbadmin;
21:
22: import org.continuent.sequoia.common.i18n.ConsoleTranslate;
23: import org.continuent.sequoia.console.text.module.VirtualDatabaseAdmin;
24:
25: /**
26: * This class defines a command that resets the controller SQL statistics.
27: *
28: * @author <a href="mailto:emmanuel.cecchet@continuent.com">Emmanuel Cecchet</a>
29: * @version 1.0
30: */
31: public class ResetSqlStats extends AbstractAdminCommand {
32:
33: /**
34: * Creates a new <code>ResetSqlStats</code> object
35: *
36: * @param module virtual database admin module
37: */
38: public ResetSqlStats(VirtualDatabaseAdmin module) {
39: super (module);
40: }
41:
42: /**
43: * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#parse(java.lang.String)
44: */
45: public void parse(String commandText) throws Exception {
46: jmxClient.getVirtualDatabaseProxy(dbName, user, password)
47: .setMonitoringToActive(false);
48: jmxClient.getVirtualDatabaseProxy(dbName, user, password)
49: .setMonitoringToActive(true);
50: }
51:
52: /**
53: * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#getCommandName()
54: */
55: public String getCommandName() {
56: return "reset sql stats";
57: }
58:
59: /**
60: * @see org.continuent.sequoia.console.text.commands.ConsoleCommand#getCommandDescription()
61: */
62: public String getCommandDescription() {
63: return ConsoleTranslate
64: .get("admin.command.reset.sql.stats.description");
65: }
66:
67: }
|