From b483bb1fc5ad4aa8e6c2449bbd6ec0e7d5f3d92d Mon Sep 17 00:00:00 2001 From: Aidan Skinner Date: Wed, 7 Jan 2009 11:40:08 +0000 Subject: QPID-1522: Fix spelling error in classname git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@732308 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/CommandExecusionEngine.java | 88 ---------------------- .../org/apache/qpid/CommandExecutionEngine.java | 86 +++++++++++++++++++++ .../org/apache/qpid/CommandLineInterpreter.java | 10 +-- 3 files changed, 88 insertions(+), 96 deletions(-) delete mode 100644 java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecusionEngine.java create mode 100644 java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java (limited to 'java/management/tools/qpid-cli/src') diff --git a/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecusionEngine.java b/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecusionEngine.java deleted file mode 100644 index 52131bc1d5..0000000000 --- a/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecusionEngine.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.qpid; - -import org.apache.qpid.utils.CommandLineOptionParser; -import org.apache.qpid.utils.JMXinfo; -import org.apache.qpid.commands.*; -import org.apache.qpid.commands.CommandImpl; - - -public class CommandExecusionEngine { - private Command currentcommand = null; - private String commandname = null; - private JMXinfo info = null; - - public CommandExecusionEngine(JMXinfo info) { - this.info = info; - this.commandname = info.getCommandLineOptionParser().getcommandname(); - } - - public boolean CommandSelector() { - - if (CommandConstants.INFO_COMMAND.equalsIgnoreCase(this.commandname)) - currentcommand = new Commandinfo(info, this.commandname); - else if (CommandConstants.LIST_COMMAND.equalsIgnoreCase(this.commandname)) - currentcommand = new Commandlist(info, this.commandname); - else if (CommandConstants.HELP_COMMAND.equalsIgnoreCase(this.commandname)) - currentcommand = new Commandhelp(info, this.commandname); - else if (CommandConstants.DELETE_COMMAND.equalsIgnoreCase(this.commandname)) - currentcommand = new Commanddelete(info, this.commandname); - else if (CommandConstants.MOVE_COMMAND.equalsIgnoreCase(this.commandname)) - currentcommand = new Commandmove(info, this.commandname); - else if (CommandConstants.VIEW_COMMAND.equalsIgnoreCase(this.commandname)) - currentcommand = new Commandview(info, this.commandname); - else if (CommandConstants.VIEWCONTENT_COMMAND.equalsIgnoreCase(this.commandname)) - currentcommand = new Commandviewcontent(info, this.commandname); - else { - usage(); - return false; - } - return true; - - - } - - public void runcommand() { - currentcommand.execute(); - } - - public void usage() { - System.out.println(commandname + ":Command not found"); - } -} diff --git a/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java b/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java new file mode 100644 index 0000000000..50bc294780 --- /dev/null +++ b/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java @@ -0,0 +1,86 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.qpid; + +import org.apache.qpid.utils.JMXinfo; +import org.apache.qpid.commands.*; + + +public class CommandExecutionEngine { + private Command currentcommand = null; + private String commandname = null; + private JMXinfo info = null; + + public CommandExecutionEngine(JMXinfo info) { + this.info = info; + this.commandname = info.getCommandLineOptionParser().getcommandname(); + } + + public boolean CommandSelector() { + + if (CommandConstants.INFO_COMMAND.equalsIgnoreCase(this.commandname)) + currentcommand = new Commandinfo(info, this.commandname); + else if (CommandConstants.LIST_COMMAND.equalsIgnoreCase(this.commandname)) + currentcommand = new Commandlist(info, this.commandname); + else if (CommandConstants.HELP_COMMAND.equalsIgnoreCase(this.commandname)) + currentcommand = new Commandhelp(info, this.commandname); + else if (CommandConstants.DELETE_COMMAND.equalsIgnoreCase(this.commandname)) + currentcommand = new Commanddelete(info, this.commandname); + else if (CommandConstants.MOVE_COMMAND.equalsIgnoreCase(this.commandname)) + currentcommand = new Commandmove(info, this.commandname); + else if (CommandConstants.VIEW_COMMAND.equalsIgnoreCase(this.commandname)) + currentcommand = new Commandview(info, this.commandname); + else if (CommandConstants.VIEWCONTENT_COMMAND.equalsIgnoreCase(this.commandname)) + currentcommand = new Commandviewcontent(info, this.commandname); + else { + usage(); + return false; + } + return true; + + + } + + public void runcommand() { + currentcommand.execute(); + } + + public void usage() { + System.out.println(commandname + ":Command not found"); + } +} diff --git a/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java b/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java index e9073c79ce..cede874186 100644 --- a/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java +++ b/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java @@ -87,8 +87,6 @@ public class CommandLineInterpreter { } /* Connecting with the broker */ -// commandlineoptionparser = new CommandLineOptionParser(args); -// JMXConfiguration config = new JMXConfiguration(commandlineoptionparser.getAlloptions()); try { if (commandlineoptionparser == null) commandlineoptionparser = new CommandLineOptionParser(args); @@ -122,7 +120,6 @@ public class CommandLineInterpreter { String[] command; /* prividing GNU readline features using Jline library */ - //String list = "list"; PrintWriter out = new PrintWriter(System.out); reader.addCompletor(new ArgumentCompletor( new SimpleCompletor(new String[]{"list", "info", "exit", "quit", "delete", "move", "view", "viewcontent", "queue", "exchange", "connection", "usermanagement", "virtualhost"}))); @@ -136,7 +133,7 @@ public class CommandLineInterpreter { command = line.split("\\s+"); commandlineoptionparser = new CommandLineOptionParser(command); JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc); - CommandExecusionEngine engine = new CommandExecusionEngine(info); + CommandExecutionEngine engine = new CommandExecutionEngine(info); if (engine.CommandSelector()) engine.runcommand(); } @@ -164,9 +161,6 @@ public class CommandLineInterpreter { System.out.println("Please check the host name and the port given"); } - private static void commandlineerror() { - System.out.println("Please run the script again and try to connect to broker again"); - } public static String[] oneshotmode(String[] args,CommandLineOptionParser commandlineoptionparser,JMXConnector jmxc,MBeanServerConnection mbsc) { int check = 0; @@ -184,7 +178,7 @@ public class CommandLineInterpreter { commandlineoptionparser = new CommandLineOptionParser(args); //change the args string array which works as interactive mode// JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc); - CommandExecusionEngine engine = new CommandExecusionEngine(info); + CommandExecutionEngine engine = new CommandExecutionEngine(info); if (engine.CommandSelector()) engine.runcommand(); return args; -- cgit v1.2.1