qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r733073 [1/4] - in /qpid/trunk/qpid/java/management/tools/qpid-cli: src/org/apache/qpid/ src/org/apache/qpid/commands/ src/org/apache/qpid/commands/objects/ src/org/apache/qpid/utils/ test/org/apache/qpid/ test/org/apache/qpid/commands/ tes...
Date Fri, 09 Jan 2009 16:24:03 GMT
Author: aidan
Date: Fri Jan  9 08:24:01 2009
New Revision: 733073

URL: http://svn.apache.org/viewvc?rev=733073&view=rev
Log:
QPID-1564: Remove duplicate ASL header and unusued imports. Format code according to qpid conventions.  

Modified:
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/CommandImpl.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/AllObjects.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ConnectionObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ExchangeObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ObjectNames.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/UserManagementObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/VirtualHostObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOption.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionParser.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfigProperty.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXinfo.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java Fri Jan  9 08:24:01 2009
@@ -18,29 +18,13 @@
  * 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;
 
-public interface Command {
+public interface Command
+{
 
     public static String COMMAND_NAME = null;
-    
+
     public void execute();
 
     public void printusage();

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecutionEngine.java Fri Jan  9 08:24:01 2009
@@ -18,23 +18,6 @@
  * 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 java.util.HashMap;
@@ -42,19 +25,21 @@
 
 import org.apache.qpid.utils.JMXinfo;
 
-
-public class CommandExecutionEngine {
+public class CommandExecutionEngine
+{
     private static Map<String, Class<? extends Command>> _commands = new HashMap<String, Class<? extends Command>>();
     private Command currentcommand = null;
     private String commandname = null;
     private JMXinfo info = null;
 
-    public CommandExecutionEngine(JMXinfo info) {
+    public CommandExecutionEngine(JMXinfo info)
+    {
         this.info = info;
         this.commandname = info.getCommandLineOptionParser().getcommandname();
     }
 
-    public boolean CommandSelector() throws Exception {
+    public boolean CommandSelector() throws Exception
+    {
         Class<? extends Command> commandClass = _commands.get(this.commandname);
         if (commandClass != null)
         {
@@ -68,17 +53,19 @@
         }
         return true;
     }
-    
+
     public static void addCommand(String name, Class<? extends Command> newCommand)
     {
         _commands.put(name, newCommand);
     }
 
-    public void runcommand() {
+    public void runcommand()
+    {
         currentcommand.execute();
     }
 
-    public void usage() {
+    public void usage()
+    {
         System.out.println(commandname + ":Command not found");
     }
 }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java Fri Jan  9 08:24:01 2009
@@ -18,23 +18,6 @@
  * 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;
 
@@ -61,69 +44,93 @@
 import org.apache.qpid.utils.JMXConfiguration;
 import org.apache.qpid.utils.JMXinfo;
 
-public class CommandLineInterpreter {
-    
-    public static void main(String[] args) {
+public class CommandLineInterpreter
+{
+
+    public static void main(String[] args)
+    {
         Connector conn = null;
-        try {
+        try
+        {
             // Create an RMI connector client and
             // connect it to the RMI connector server
 
-            /*checking the commandline options and
-            parse them in to config method */
+            /*
+             * checking the commandline options and parse them in to config
+             * method
+             */
             JMXConnector jmxc = null;
             MBeanServerConnection mbsc = null;
             ConsoleReader reader = new ConsoleReader();
             reader.setBellEnabled(false);
             CommandLineOptionParser commandlineoptionparser = null;
 
-            if ((args == null) || (args.length) == 0) {
+            if ((args == null) || (args.length) == 0)
+            {
                 Usage();
             }
-            /* here special constructor is calling, when parsing options,in here first option value is starting from minus sign
-              so this is handle by a special constructor */
-            else {
-                if (args[0].startsWith("-")) {
-                    commandlineoptionparser = new CommandLineOptionParser(args, args[0]);     // if user specify any argument with the qpid-cli script
+            /*
+             * here special constructor is calling, when parsing options,in here
+             * first option value is starting from minus sign so this is handle
+             * by a special constructor
+             */
+            else
+            {
+                if (args[0].startsWith("-"))
+                {
+                    commandlineoptionparser = new CommandLineOptionParser(args, args[0]); // if
+                                                                                          // user
+                                                                                          // specify
+                                                                                          // any
+                                                                                          // argument
+                                                                                          // with
+                                                                                          // the
+                                                                                          // qpid-cli
+                                                                                          // script
                 }
             }
 
             registerCommands();
-            
+
             /* Connecting with the broker */
-            try {
+            try
+            {
                 if (commandlineoptionparser == null)
                     commandlineoptionparser = new CommandLineOptionParser(args);
 
                 JMXConfiguration config = new JMXConfiguration(commandlineoptionparser.getAlloptions());
-                conn = ConnectorFactory.getConnector(config.gethostname(), config.getport(), 
-                                                     config.getUsername(), config.getPassword());
+                conn = ConnectorFactory.getConnector(config.gethostname(), config.getport(), config.getUsername(),
+                        config.getPassword());
                 jmxc = conn.getConnector();
                 mbsc = conn.getMBeanServerConnection();
-                if (config.checkoptionsetting("r", commandlineoptionparser.getAlloptions())) {
+                if (config.checkoptionsetting("r", commandlineoptionparser.getAlloptions()))
+                {
                     JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
-                    ReportGenerator reportgen = new ReportGenerator(config.optionchecker("r", commandlineoptionparser.getAlloptions()), info);
+                    ReportGenerator reportgen = new ReportGenerator(config.optionchecker("r", commandlineoptionparser
+                            .getAlloptions()), info);
                     reportgen.loadproperties();
                     reportgen.run();
                 }
-                /* This implementation is for the people who are using the interactive
-                mode for one shot this run the user given command and exit */
-                for (int i = 0; i < args.length; i++) {
-                    if (args[i].compareTo("list") == 0 ||
-                        args[i].compareTo("info") == 0 ||
-                        args[i].compareTo("view") == 0 ||
-                        args[i].compareTo("viewcontent") == 0 ||
-                        args[i].compareTo("delete") == 0 ||
-                        args[i].compareTo("move") == 0 ||
-                        args[i].compareTo("set") == 0 ||
-                        args[i].compareTo("get") == 0)
+                /*
+                 * This implementation is for the people who are using the
+                 * interactive mode for one shot this run the user given command
+                 * and exit
+                 */
+                for (int i = 0; i < args.length; i++)
+                {
+                    if (args[i].compareTo("list") == 0 || args[i].compareTo("info") == 0
+                            || args[i].compareTo("view") == 0 || args[i].compareTo("viewcontent") == 0
+                            || args[i].compareTo("delete") == 0 || args[i].compareTo("move") == 0
+                            || args[i].compareTo("set") == 0 || args[i].compareTo("get") == 0)
                     {
                         oneshotmode(args, commandlineoptionparser, jmxc, mbsc);
 
                         return;
                     }
                 }
-            } catch (Exception ex) {
+            }
+            catch (Exception ex)
+            {
                 connectionrefuse(ex);
                 return;
             }
@@ -133,17 +140,18 @@
 
             /* prividing GNU readline features using Jline library */
             PrintWriter out = new PrintWriter(System.out);
-            reader.addCompletor(new ArgumentCompletor(
-                    new SimpleCompletor(new String[]{"get","set","list", "info", "exit", "quit", "delete", "move", "view", 
-                                                     "viewcontent", "queue", "exchange", "connection", "usermanagement",
-                                                     "virtualhost"})));
-            while ((line = reader.readLine("qpid-admin-$ ")) != null) {
+            reader.addCompletor(new ArgumentCompletor(new SimpleCompletor(new String[] { "get", "set", "list", "info",
+                    "exit", "quit", "delete", "move", "view", "viewcontent", "queue", "exchange", "connection",
+                    "usermanagement", "virtualhost" })));
+            while ((line = reader.readLine("qpid-admin-$ ")) != null)
+            {
                 out.flush();
                 if (removeSpaces(line).equalsIgnoreCase("quit") || removeSpaces(line).equalsIgnoreCase("exit"))
                     break;
                 else if (line.length() == 0)
                     continue;
-                else {
+                else
+                {
                     command = line.split("\\s+");
                     commandlineoptionparser = new CommandLineOptionParser(command);
                     JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
@@ -152,10 +160,11 @@
                         engine.runcommand();
                 }
             }
-            
+
             conn.getConnector().close();
         }
-        catch (Exception ex) {
+        catch (Exception ex)
+        {
             ex.printStackTrace();
         }
     }
@@ -173,18 +182,22 @@
         CommandExecutionEngine.addCommand(Commandviewcontent.COMMAND_NAME, Commandviewcontent.class);
     }
 
-    private static void Usage() {
+    private static void Usage()
+    {
         System.out.println("Connecting to localhost Qpid java broker...");
     }
 
-    private static String removeSpaces(String s) {
+    private static String removeSpaces(String s)
+    {
         StringTokenizer st = new StringTokenizer(s, " ", false);
         String t = "";
-        while (st.hasMoreElements()) t += st.nextElement();
+        while (st.hasMoreElements())
+            t += st.nextElement();
         return t;
     }
 
-    private static void connectionrefuse(Exception e) {
+    private static void connectionrefuse(Exception e)
+    {
         String message = e.getLocalizedMessage();
         if (e instanceof SecurityException)
         {
@@ -203,22 +216,33 @@
         System.out.println("Cannot connect with the broker: " + message);
     }
 
-    public static String[] oneshotmode(String[] args,CommandLineOptionParser commandlineoptionparser,JMXConnector jmxc,MBeanServerConnection mbsc) throws Exception
+    public static String[] oneshotmode(String[] args, CommandLineOptionParser commandlineoptionparser,
+            JMXConnector jmxc, MBeanServerConnection mbsc) throws Exception
     {
         int check = 0;
-        String [] temp;
-        for (int i = 0; i < args.length; i++) {
+        String[] temp;
+        for (int i = 0; i < args.length; i++)
+        {
 
             if (args[i].compareTo("-h") == 0)
                 check++;
             else if (args[i].compareTo("-p") == 0)
                 check++;
         }
-        for (int i = 0; i < (args.length - 2 * check); i++) {     // mulitply by 2 because have to remove the option letter with the option value//
+        for (int i = 0; i < (args.length - 2 * check); i++)
+        { // mulitply by 2 because have to remove the option letter with the
+          // option value//
             args[i] = args[i + check * 2];
         }
 
-        commandlineoptionparser = new CommandLineOptionParser(args);           //change the args string array which works as interactive mode//
+        commandlineoptionparser = new CommandLineOptionParser(args); // change
+                                                                     // the args
+                                                                     // string
+                                                                     // array
+                                                                     // which
+                                                                     // works as
+                                                                     // interactive
+                                                                     // mode//
         JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
         CommandExecutionEngine engine = new CommandExecutionEngine(info);
         if (engine.CommandSelector())
@@ -227,4 +251,3 @@
 
     }
 }
-

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java Fri Jan  9 08:24:01 2009
@@ -18,52 +18,32 @@
  * 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 javax.management.MBeanServerConnection;
 import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnectorFactory;
-import java.io.IOException;
-
 
-public class Connector {
+public class Connector
+{
     private JMXConnector jmxc = null;
     private MBeanServerConnection mbsc = null;
 
-
-    public Connector(JMXConnector jmxc, MBeanServerConnection mbsc) {
+    public Connector(JMXConnector jmxc, MBeanServerConnection mbsc)
+    {
 
         this.jmxc = jmxc;
         this.mbsc = mbsc;
 
-
     }
 
-    public JMXConnector getConnector() {
+    public JMXConnector getConnector()
+    {
         return jmxc;
     }
 
-    public MBeanServerConnection getMBeanServerConnection() {
+    public MBeanServerConnection getMBeanServerConnection()
+    {
         return mbsc;
     }
 
-
 }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java Fri Jan  9 08:24:01 2009
@@ -18,54 +18,31 @@
  * 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 java.io.IOException;
-
 import javax.management.MBeanServerConnection;
 import javax.management.remote.JMXConnector;
 
 import org.apache.qpid.management.common.JMXConnnectionFactory;
 
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jul 3, 2008
- * Time: 10:51:28 AM
- * To change this template use File | Settings | File Templates.
- */
-public class ConnectorFactory {
+public class ConnectorFactory
+{
 
     private static final long TIMEOUT = 30 * 1000;
 
-    public static Connector getConnector(String host, String port, String username, String password) throws Exception {
+    public static Connector getConnector(String host, String port, String username, String password) throws Exception
+    {
 
         JMXConnector jmxc = null;
         MBeanServerConnection mbsc = null;
-        try {
+        try
+        {
             jmxc = JMXConnnectionFactory.getJMXConnection(TIMEOUT, host, Integer.parseInt(port), username, password);
             mbsc = jmxc.getMBeanServerConnection();
-        } 
+        }
         catch (NumberFormatException e)
         {
-            System.out.println("Illegal port entered:"+port);
+            System.out.println("Illegal port entered:" + port);
             System.exit(1);
         }
         return new Connector(jmxc, mbsc);

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java Fri Jan  9 08:24:01 2009
@@ -18,23 +18,6 @@
  * 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.commands.objects.*;
@@ -45,16 +28,11 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 12, 2008
- * Time: 4:03:21 PM
- * To change this template use File | Settings | File Templates.
- */
-public class ReportGenerator implements Runnable {
+public class ReportGenerator implements Runnable
+{
 
-    String[] propertyname = {"object", "column", "filter.name", "filter.virtualhost", "output", "seperator", "interval"};
+    String[] propertyname = { "object", "column", "filter.name", "filter.virtualhost", "output", "seperator",
+            "interval" };
     String[] propertyvalue = null;
     String propertyfilepath = null;
     String[] columnvalue = null;
@@ -63,19 +41,24 @@
     JMXinfo info = null;
     int interval = 10;
 
-    public void run() {
-        for (; ;)  // creating infinite loop
+    public void run()
+    {
+        for (;;) // creating infinite loop
         {
             generatereport();
-            try {
+            try
+            {
                 Thread.sleep(this.interval * 60000);
-            } catch (Exception ex) {
+            }
+            catch (Exception ex)
+            {
                 ex.printStackTrace();
             }
         }
     }
 
-    public ReportGenerator(String propfile, JMXinfo info) {
+    public ReportGenerator(String propfile, JMXinfo info)
+    {
         this.propertyfilepath = propfile;
         props = new Properties();
         propertyvalue = new String[propertyname.length];
@@ -83,98 +66,130 @@
         columns = new ArrayList<String>();
     }
 
-    public void loadproperties()                                  // get all the property file values and set the columen values//
+    public void loadproperties() // get all the property file values and set the
+                                 // columen values//
     {
-        try {
+        try
+        {
 
             props.load(new FileInputStream(this.propertyfilepath));
-            for (int i = 0; i < propertyname.length; i++) {
+            for (int i = 0; i < propertyname.length; i++)
+            {
                 propertyvalue[i] = props.getProperty(propertyname[i]);
             }
             this.setcolumnvalues();
             this.setinterval();
         }
 
-        //catch exception in case properties file does not exist
+        // catch exception in case properties file does not exist
 
-        catch (IOException e) {
+        catch (IOException e)
+        {
             System.out.println("Oooops Give property file is not exist");
         }
     }
 
-    public void generatereport() {
+    public void generatereport()
+    {
         this.listobjects(propertyvalue[0]);
     }
 
-    private void setcolumnvalues() {
+    private void setcolumnvalues()
+    {
         columnvalue = propertyvalue[1].split(",");
-        for (int i = 0; i < columnvalue.length; i++) {
+        for (int i = 0; i < columnvalue.length; i++)
+        {
             columns.add(columnvalue[i]);
         }
     }
 
-    private void setinterval() {
+    private void setinterval()
+    {
         this.interval = (new Integer(propertyvalue[6])).intValue();
     }
 
-    private void listobjects(String option_value) {
-        /*pring usage if use is not give the correct option letter or no options */
-        if (option_value == null) {
-//            System.out.println("testing");
+    private void listobjects(String option_value)
+    {
+        /*
+         * pring usage if use is not give the correct option letter or no
+         * options
+         */
+        if (option_value == null)
+        {
+            // System.out.println("testing");
             return;
         }
         MBeanServerConnection mbsc = info.getmbserverconnector();
         Set set = null;
         ObjectNames objname = null;
 
-        try {
-            if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0) {
+        try
+        {
+            if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0)
+            {
                 objname = new QueueObject(mbsc);
 
-            } else
-            if (option_value.compareToIgnoreCase("Virtualhosts") == 0 || option_value.compareToIgnoreCase("Virtualhost") == 0) {
+            }
+            else if (option_value.compareToIgnoreCase("Virtualhosts") == 0
+                    || option_value.compareToIgnoreCase("Virtualhost") == 0)
+            {
                 objname = new VirtualHostObject(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Exchange") == 0 || option_value.compareToIgnoreCase("Exchanges") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Exchange") == 0
+                    || option_value.compareToIgnoreCase("Exchanges") == 0)
+            {
                 objname = new ExchangeObject(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Connection") == 0 || option_value.compareToIgnoreCase("Connections") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Connection") == 0
+                    || option_value.compareToIgnoreCase("Connections") == 0)
+            {
                 objname = new ConnectionObject(mbsc);
-//                this.name = option_value;
-            } else if (option_value.compareToIgnoreCase("all") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("all") == 0)
+            {
                 objname = new AllObjects(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Usermanagement") == 0 || option_value.compareToIgnoreCase("Usermanagmenets") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Usermanagement") == 0
+                    || option_value.compareToIgnoreCase("Usermanagmenets") == 0)
+            {
                 objname = new UserManagementObject(mbsc);
-//                this.name = option_value;
-            } else {
+                // this.name = option_value;
+            }
+            else
+            {
                 printusage();
                 echo("Wrong objectName");
                 return;
             }
             objname.setQueryString(this.propertyvalue[0], this.propertyvalue[2], this.propertyvalue[3]);
             objname.returnObjects();
-            if (objname.getSet().size() != 0) {
+            if (objname.getSet().size() != 0)
+            {
                 objname.reportgenerator(this.propertyvalue[4], this.propertyvalue[5], columns);
-            } else {
+            }
+            else
+            {
                 printusage();
             }
         }
-        catch (Exception ex) {
+        catch (Exception ex)
+        {
             ex.printStackTrace();
         }
 
-
     }
 
-    public void echo(String str) {
+    public void echo(String str)
+    {
         System.out.println(str);
     }
 
-    public void printusage() {
+    public void printusage()
+    {
         System.out.println("Wrong option or wrong option value");
     }
 }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/CommandImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/CommandImpl.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/CommandImpl.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/CommandImpl.java Fri Jan  9 08:24:01 2009
@@ -18,36 +18,17 @@
  * 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.commands;
 
+import java.util.Map;
 
 import org.apache.qpid.Command;
-import org.apache.qpid.CommandExecutionEngine;
-import org.apache.qpid.utils.JMXinfo;
 import org.apache.qpid.utils.CommandLineOption;
+import org.apache.qpid.utils.JMXinfo;
 
-import java.util.Map;
-
-
-public abstract class CommandImpl implements Command {
+public abstract class CommandImpl implements Command
+{
     protected JMXinfo info = null;
 
     private String name;
@@ -56,41 +37,48 @@
 
     private String outputformat = null;
     private String seperator = ",";
-    
-    public CommandImpl(JMXinfo info) {
+
+    public CommandImpl(JMXinfo info)
+    {
         this.info = info;
     }
 
-    public CommandImpl() 
+    public CommandImpl()
     {
 
     }
-    
-    protected void setName(String name) {
+
+    protected void setName(String name)
+    {
         this.name = name;
     }
 
-    public String getName() {
+    public String getName()
+    {
         return this.name;
     }
-    
-    protected boolean hasName() {
+
+    protected boolean hasName()
+    {
         if (this.name == null)
             return false;
 
         else
             return true;
     }
-    
-    protected void setObject(String object) {
+
+    protected void setObject(String object)
+    {
         this.object = object;
     }
-    
-    public String getObject() {
+
+    public String getObject()
+    {
         return this.object;
     }
-    
-    protected void setOutputFormat(String outputformat) {
+
+    protected void setOutputFormat(String outputformat)
+    {
         this.outputformat = outputformat;
     }
 
@@ -98,8 +86,9 @@
     {
         return outputformat;
     }
-    
-    protected void setSeperator(String seperator) {
+
+    protected void setSeperator(String seperator)
+    {
         this.seperator = seperator;
     }
 
@@ -107,16 +96,19 @@
     {
         return seperator;
     }
-    
-    protected void setVirtualhost(String virtualhost) {
+
+    protected void setVirtualhost(String virtualhost)
+    {
         this.virtualhost = virtualhost;
     }
 
-    public String getVirtualhost() {
+    public String getVirtualhost()
+    {
         return this.virtualhost;
     }
 
-    public String optionchecker(String option_letter) {
+    public String optionchecker(String option_letter)
+    {
         Map map = info.getCommandLineOptionParser().getAlloptions();
         if (map == null)
             return null;
@@ -127,7 +119,8 @@
         return value;
     }
 
-    public boolean checkoptionsetting(String option_letter) {
+    public boolean checkoptionsetting(String option_letter)
+    {
         Map map = info.getCommandLineOptionParser().getAlloptions();
         if (map == null)
             return false;
@@ -141,12 +134,14 @@
         else
             return false;
     }
-    
-    public void echo(String str) {
+
+    public void echo(String str)
+    {
         System.out.println(str);
     }
 
-    public void unrecognizeoption() {
+    public void unrecognizeoption()
+    {
         echo("list: Unrecognized option");
         echo("Try `" + COMMAND_NAME + " --help` for more information");
     }
@@ -155,5 +150,4 @@
 
     public abstract void printusage();
 
-
 }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java Fri Jan  9 08:24:01 2009
@@ -18,48 +18,23 @@
  * 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.commands;
 
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.commands.objects.*;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.StringTokenizer;
 
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
 
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 6, 2008
- * Time: 5:34:51 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Commanddelete extends CommandImpl {
+import org.apache.qpid.commands.objects.QueueObject;
+import org.apache.qpid.utils.JMXinfo;
+
+public class Commanddelete extends CommandImpl
+{
     private int number = 0;
     private QueueObject objname;
     private MBeanServerConnection mbsc;
@@ -67,7 +42,8 @@
     private ObjectName queue;
     public static final String COMMAND_NAME = "delete";
 
-    public Commanddelete(JMXinfo info) {
+    public Commanddelete(JMXinfo info)
+    {
         super(info);
         this.mbsc = info.getmbserverconnector();
         this.objname = new QueueObject(mbsc);
@@ -76,16 +52,20 @@
 
     }
 
-    public void deletemessages() {
+    public void deletemessages()
+    {
         Set set = null;
         objname.setQueryString(this.getObject(), this.getName(), this.getVirtualhost());
         set = objname.returnObjects();
 
-        if (objname.getSet().size() != 0) {
+        if (objname.getSet().size() != 0)
+        {
             Iterator it = set.iterator();
             this.queue = (ObjectName) it.next();
-            try {
-                if (this.number == 0) {
+            try
+            {
+                if (this.number == 0)
+                {
                     echo("");
                     System.out.print("Do you want to delete all the messages from the Queue [Y/N] :");
                     InputStreamReader isr = new InputStreamReader(System.in);
@@ -96,59 +76,79 @@
                         this.mbsc.invoke(queue, this.method2, null, null);
                     else
                         return;
-                } else if (objname.getmessagecount(this.queue) < this.number) {
+                }
+                else if (objname.getmessagecount(this.queue) < this.number)
+                {
                     echo("Given number is Greater than the Queue Depth");
                     return;
-                } else {
-                    for (int i = 0; i < this.number; i++) {
+                }
+                else
+                {
+                    for (int i = 0; i < this.number; i++)
+                    {
                         this.mbsc.invoke(queue, this.method1, null, null);
                     }
                 }
-            } catch (Exception ex) {
+            }
+            catch (Exception ex)
+            {
                 ex.printStackTrace();
             }
 
-        } else {
-            if (hasName()) {
+        }
+        else
+        {
+            if (hasName())
+            {
 
                 echo("The Queue you have specified is not in the current broker");
                 echo("");
-            } else {
+            }
+            else
+            {
                 printusage();
             }
         }
     }
 
-    public void execute() {
-        /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
-        with main option object or o
+    public void execute()
+    {
+        /*
+         * In here you it's easy to handle any number of otpions which are going
+         * to add with the list command which works with main option object or o
          */
 
-        if (checkoptionsetting("object") || checkoptionsetting("o")) {
+        if (checkoptionsetting("object") || checkoptionsetting("o"))
+        {
             String object = optionchecker("object");
-            if (object == null) {
+            if (object == null)
+            {
                 object = optionchecker("o");
             }
             if (object.compareToIgnoreCase("queue") == 0)
                 setObject(object);
-            else {
+            else
+            {
                 unrecognizeoption();
                 echo("This command is only applicable for delete command so please start with queue");
             }
-            if (checkoptionsetting("name") || checkoptionsetting("n")) {
+            if (checkoptionsetting("name") || checkoptionsetting("n"))
+            {
                 String name = optionchecker("name");
                 if (name == null)
                     name = optionchecker("n");
 
                 setName(name);
             }
-            if (checkoptionsetting("virtualhost") || checkoptionsetting("v")) {
+            if (checkoptionsetting("virtualhost") || checkoptionsetting("v"))
+            {
                 String vhost = optionchecker("virtualhost");
                 if (vhost == null)
                     vhost = optionchecker("v");
                 setVirtualhost(vhost);
             }
-            if (checkoptionsetting("top") || checkoptionsetting("t")) {
+            if (checkoptionsetting("top") || checkoptionsetting("t"))
+            {
                 String number = optionchecker("top");
                 if (number == null)
                     number = optionchecker("t");
@@ -156,13 +156,15 @@
                 setnumber(removeSpaces(number));
             }
             this.deletemessages();
-        } else if (checkoptionsetting("h") || checkoptionsetting("help"))
+        }
+        else if (checkoptionsetting("h") || checkoptionsetting("help"))
             printusage();
         else
             unrecognizeoption();
     }
 
-    public void printusage() {
+    public void printusage()
+    {
         echo("");
         echo("Usage:delete [OPTION] ... [OBJECT TYPE]...\n");
         echo("Delete the top most messages from the given queue object\n");
@@ -175,19 +177,23 @@
 
     }
 
-    private void setnumber(String number) {
+    private void setnumber(String number)
+    {
         Integer i = new Integer(number);
         this.number = i.intValue();
     }
 
-    public int getnumber() {
+    public int getnumber()
+    {
         return this.number;
     }
 
-    private static String removeSpaces(String s) {
+    private static String removeSpaces(String s)
+    {
         StringTokenizer st = new StringTokenizer(s, " ", false);
         String t = "";
-        while (st.hasMoreElements()) t += st.nextElement();
+        while (st.hasMoreElements())
+            t += st.nextElement();
         return t;
     }
 }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java Fri Jan  9 08:24:01 2009
@@ -18,23 +18,6 @@
  * 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.commands;
 
@@ -48,7 +31,7 @@
 
 public class Commandget extends CommandImpl
 {
-    
+
     private String _attributeName;
     private String _value;
     public static String COMMAND_NAME = "get";
@@ -99,7 +82,7 @@
             {
                 ObjectName object = (ObjectName) objname.getSet().iterator().next();
 
-                Object value= objname.getAttribute(object, _attributeName);
+                Object value = objname.getAttribute(object, _attributeName);
 
                 echo(value.toString());
             }
@@ -129,8 +112,9 @@
 
     public void execute()
     {
-        /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
-        with main option object or o
+        /*
+         * In here you it's easy to handle any number of otpions which are going
+         * to add with the list command which works with main option object or o
          */
         if (checkoptionsetting("output"))
         {
@@ -225,8 +209,3 @@
 
     }
 }
-
-
-
-
-

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java Fri Jan  9 08:24:01 2009
@@ -18,48 +18,27 @@
  * 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.commands;
 
 import org.apache.qpid.utils.JMXinfo;
 
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jul 6, 2008
- * Time: 5:55:28 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Commandhelp extends CommandImpl {
+public class Commandhelp extends CommandImpl
+{
 
     public static final String COMMAND_NAME = "help";
-    
-    public Commandhelp(JMXinfo info) 
+
+    public Commandhelp(JMXinfo info)
     {
     }
-    
-    public void execute() {
+
+    public void execute()
+    {
         printusage();
     }
 
-    public void printusage() {
+    public void printusage()
+    {
         echo("");
         echo("Current version of qpid CLI is supporting following commands");
         echo("");

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java Fri Jan  9 08:24:01 2009
@@ -18,48 +18,41 @@
  * 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.commands;
 
-
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.commands.objects.*;
+import java.util.Set;
 
 import javax.management.MBeanServerConnection;
-import java.util.Set;
 
+import org.apache.qpid.commands.objects.AllObjects;
+import org.apache.qpid.commands.objects.ConnectionObject;
+import org.apache.qpid.commands.objects.ExchangeObject;
+import org.apache.qpid.commands.objects.ObjectNames;
+import org.apache.qpid.commands.objects.QueueObject;
+import org.apache.qpid.commands.objects.UserManagementObject;
+import org.apache.qpid.commands.objects.VirtualHostObject;
+import org.apache.qpid.utils.JMXinfo;
 
-public class Commandinfo extends CommandImpl {
+public class Commandinfo extends CommandImpl
+{
 
     public static final String COMMAND_NAME = "info";
-    
+
     public Commandinfo(JMXinfo info)
     {
         super(info);
     }
 
-    private void listobjects(String option_value) {
-        /*pring usage if use is not give the correct option letter or no options */
-        if (option_value == null) {
-//            System.out.println("testing");
+    private void listobjects(String option_value)
+    {
+        /*
+         * pring usage if use is not give the correct option letter or no
+         * options
+         */
+        if (option_value == null)
+        {
+            // System.out.println("testing");
             printusage();
             return;
         }
@@ -67,95 +60,124 @@
         Set set = null;
         ObjectNames objname = null;
 
-        try {
-            if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0) {
+        try
+        {
+            if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0)
+            {
                 objname = new QueueObject(mbsc);
 
-            } else
-            if (option_value.compareToIgnoreCase("Virtualhosts") == 0 || option_value.compareToIgnoreCase("Virtualhost") == 0) {
+            }
+            else if (option_value.compareToIgnoreCase("Virtualhosts") == 0
+                    || option_value.compareToIgnoreCase("Virtualhost") == 0)
+            {
                 objname = new VirtualHostObject(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Exchange") == 0 || option_value.compareToIgnoreCase("Exchanges") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Exchange") == 0
+                    || option_value.compareToIgnoreCase("Exchanges") == 0)
+            {
                 objname = new ExchangeObject(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Connection") == 0 || option_value.compareToIgnoreCase("Connections") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Connection") == 0
+                    || option_value.compareToIgnoreCase("Connections") == 0)
+            {
                 objname = new ConnectionObject(mbsc);
-//                this.name = option_value;
-            } else if (option_value.compareToIgnoreCase("all") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("all") == 0)
+            {
                 objname = new AllObjects(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Usermanagement") == 0 || option_value.compareToIgnoreCase("Usermanagmenets") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Usermanagement") == 0
+                    || option_value.compareToIgnoreCase("Usermanagmenets") == 0)
+            {
                 objname = new UserManagementObject(mbsc);
-//                this.name = option_value;
-            } else {
+                // this.name = option_value;
+            }
+            else
+            {
                 printusage();
                 echo("Wrong objectName");
                 return;
             }
             objname.setQueryString(this.getObject(), this.getName(), this.getVirtualhost());
             objname.returnObjects();
-            if (objname.getSet().size() != 0) {
+            if (objname.getSet().size() != 0)
+            {
                 objname.displayinfo(this.getOutputFormat(), this.getSeperator());
 
-            } else {
-                if (hasName()) {
+            }
+            else
+            {
+                if (hasName())
+                {
 
                     echo("You might quering wrong " + this.getObject() + " name with --name or -n option ");
                     echo("");
                     echo(this.getObject() + "Type Objects might not in the broker currently");
                     echo("");
-                } else {
+                }
+                else
+                {
                     printusage();
                 }
             }
 
-
-        } catch (Exception ex) {
+        }
+        catch (Exception ex)
+        {
             ex.printStackTrace();
         }
 
-
     }
 
-    public void execute() {
-        /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
-        with main option object or o
+    public void execute()
+    {
+        /*
+         * In here you it's easy to handle any number of otpions which are going
+         * to add with the list command which works with main option object or o
          */
-        if (checkoptionsetting("output")) {
+        if (checkoptionsetting("output"))
+        {
             setOutputFormat(optionchecker("output"));
             if (checkoptionsetting("separator"))
                 setSeperator(optionchecker("separator"));
         }
-        if (checkoptionsetting("object") || checkoptionsetting("o")) {
+        if (checkoptionsetting("object") || checkoptionsetting("o"))
+        {
             String object = optionchecker("object");
-            if (object == null) {
+            if (object == null)
+            {
                 object = optionchecker("o");
             }
             setObject(object);
-            if (checkoptionsetting("name") || checkoptionsetting("n")) {
+            if (checkoptionsetting("name") || checkoptionsetting("n"))
+            {
                 String name = optionchecker("name");
                 if (name == null)
                     name = optionchecker("n");
 
                 setName(name);
             }
-            if (checkoptionsetting("virtualhost") || checkoptionsetting("v")) {
+            if (checkoptionsetting("virtualhost") || checkoptionsetting("v"))
+            {
                 String vhost = optionchecker("virtualhost");
                 if (vhost == null)
                     vhost = optionchecker("v");
                 setVirtualhost(vhost);
             }
             listobjects(this.getObject());
-        } else if (checkoptionsetting("h") || checkoptionsetting("help"))
+        }
+        else if (checkoptionsetting("h") || checkoptionsetting("help"))
             printusage();
         else
             unrecognizeoption();
     }
 
-    public void printusage() {
+    public void printusage()
+    {
         echo("");
         echo("Usage:info [OPTION] ... [OBJECT TYPE]...\n");
         echo("Give ALL the information about the given object\n");

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java Fri Jan  9 08:24:01 2009
@@ -18,42 +18,24 @@
  * 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.commands;
 
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.CommandLineOptionConstants;
-import org.apache.qpid.utils.CommandLineOption;
-import org.apache.qpid.commands.objects.*;
-
-import javax.management.ObjectName;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import javax.management.MBeanServerConnection;
 import java.util.Set;
-import java.util.Iterator;
-import java.util.Map;
 
+import javax.management.MBeanServerConnection;
+
+import org.apache.qpid.commands.objects.AllObjects;
+import org.apache.qpid.commands.objects.ConnectionObject;
+import org.apache.qpid.commands.objects.ExchangeObject;
+import org.apache.qpid.commands.objects.ObjectNames;
+import org.apache.qpid.commands.objects.QueueObject;
+import org.apache.qpid.commands.objects.UserManagementObject;
+import org.apache.qpid.commands.objects.VirtualHostObject;
+import org.apache.qpid.utils.JMXinfo;
 
-public class Commandlist extends CommandImpl {
+public class Commandlist extends CommandImpl
+{
 
     public static final String COMMAND_NAME = "list";
 
@@ -62,10 +44,15 @@
         super(info);
     }
 
-    private void listobjects(String option_value) {
-        /*pring usage if use is not give the correct option letter or no options */
-        if (option_value == null) {
-//            System.out.println("testing");
+    private void listobjects(String option_value)
+    {
+        /*
+         * pring usage if use is not give the correct option letter or no
+         * options
+         */
+        if (option_value == null)
+        {
+            // System.out.println("testing");
             printusage();
             return;
         }
@@ -73,104 +60,137 @@
         Set set = null;
         ObjectNames objname = null;
 
-        try {
-            if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0) {
+        try
+        {
+            if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0)
+            {
                 objname = new QueueObject(mbsc);
 
-            } else
-            if (option_value.compareToIgnoreCase("Virtualhosts") == 0 || option_value.compareToIgnoreCase("Virtualhost") == 0) {
+            }
+            else if (option_value.compareToIgnoreCase("Virtualhosts") == 0
+                    || option_value.compareToIgnoreCase("Virtualhost") == 0)
+            {
                 objname = new VirtualHostObject(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Exchange") == 0 || option_value.compareToIgnoreCase("Exchanges") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Exchange") == 0
+                    || option_value.compareToIgnoreCase("Exchanges") == 0)
+            {
                 objname = new ExchangeObject(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Connection") == 0 || option_value.compareToIgnoreCase("Connections") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Connection") == 0
+                    || option_value.compareToIgnoreCase("Connections") == 0)
+            {
                 objname = new ConnectionObject(mbsc);
-//                this.name = option_value;
-            } else if (option_value.compareToIgnoreCase("all") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("all") == 0)
+            {
                 objname = new AllObjects(mbsc);
-//                this.name = option_value;
-            } else
-            if (option_value.compareToIgnoreCase("Usermanagement") == 0 || option_value.compareToIgnoreCase("Usermanagmenets") == 0) {
+                // this.name = option_value;
+            }
+            else if (option_value.compareToIgnoreCase("Usermanagement") == 0
+                    || option_value.compareToIgnoreCase("Usermanagmenets") == 0)
+            {
                 objname = new UserManagementObject(mbsc);
-//                this.name = option_value;
-            } else {
+                // this.name = option_value;
+            }
+            else
+            {
                 printusage();
                 echo("Wrong objectName");
                 return;
             }
             objname.setQueryString(this.getObject(), this.getName(), this.getVirtualhost());
             objname.returnObjects();
-            if (objname.getSet().size() != 0) {
-                if (this.getObject().compareToIgnoreCase("queue") == 0 || this.getObject().compareToIgnoreCase("queues") == 0)
+            if (objname.getSet().size() != 0)
+            {
+                if (this.getObject().compareToIgnoreCase("queue") == 0
+                        || this.getObject().compareToIgnoreCase("queues") == 0)
                     objname.displayqueues(this.getOutputFormat(), this.getSeperator());
                 else
                     objname.displayobjects(this.getOutputFormat(), this.getSeperator());
-            } else {
-                if (hasName()) {
+            }
+            else
+            {
+                if (hasName())
+                {
 
                     echo("You might quering wrong " + this.getObject() + " name with --name or -n option ");
                     echo("");
                     echo(this.getObject() + "Type Objects might not in the broker currently");
                     echo("");
-                } else {
+                }
+                else
+                {
                     printusage();
                 }
             }
 
-
-        } catch (Exception ex) {
+        }
+        catch (Exception ex)
+        {
             ex.printStackTrace();
         }
 
-
     }
 
-    public void listdomains() {
+    public void listdomains()
+    {
         MBeanServerConnection mbsc = info.getmbserverconnector();
-        try {
+        try
+        {
             String[] domains = mbsc.getDomains();
             echo("DOMAINS");
             for (int i = 0; i < domains.length; i++)
                 echo("\tDomain[" + i + "] = " + domains[i]);
 
-        } catch (Exception ex) {
+        }
+        catch (Exception ex)
+        {
             ex.printStackTrace();
         }
     }
 
-    public void execute() {
-        /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
-        with main option object or o
+    public void execute()
+    {
+        /*
+         * In here you it's easy to handle any number of otpions which are going
+         * to add with the list command which works with main option object or o
          */
-        if (checkoptionsetting("output")) {
+        if (checkoptionsetting("output"))
+        {
             setOutputFormat(optionchecker("output"));
             if (checkoptionsetting("separator"))
                 setSeperator(optionchecker("separator"));
         }
-        if (checkoptionsetting("object") || checkoptionsetting("o")) {
+        if (checkoptionsetting("object") || checkoptionsetting("o"))
+        {
             String object = optionchecker("object");
-            if (object == null) {
+            if (object == null)
+            {
                 object = optionchecker("o");
             }
             setObject(object);
-            if (checkoptionsetting("name") || checkoptionsetting("n")) {
+            if (checkoptionsetting("name") || checkoptionsetting("n"))
+            {
                 String name = optionchecker("name");
                 if (name == null)
                     name = optionchecker("n");
 
                 setName(name);
             }
-            if (checkoptionsetting("virtualhost") || checkoptionsetting("v")) {
+            if (checkoptionsetting("virtualhost") || checkoptionsetting("v"))
+            {
                 String vhost = optionchecker("virtualhost");
                 if (vhost == null)
                     vhost = optionchecker("v");
                 setVirtualhost(vhost);
             }
             listobjects(this.getObject());
-        } else if (checkoptionsetting("domain") || checkoptionsetting("d"))
+        }
+        else if (checkoptionsetting("domain") || checkoptionsetting("d"))
             listdomains();
         else if (checkoptionsetting("h") || checkoptionsetting("help"))
             printusage();
@@ -178,7 +198,8 @@
             unrecognizeoption();
     }
 
-    public void printusage() {
+    public void printusage()
+    {
         echo("");
         echo("Usage:list [OPTION] ... [OBJECT TYPE]...\n");
         echo("List the information about the given object\n");
@@ -207,11 +228,5 @@
         echo("                              ex: <queue list -n ping -v development> list all the queue objects with name ");
         echo("                              of ping and virtualhost of developement \n");
 
-
     }
 }
-
-
-
-
-

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java Fri Jan  9 08:24:01 2009
@@ -18,149 +18,160 @@
  * 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.commands;
 
+import java.util.Iterator;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
 
 import org.apache.qpid.commands.objects.QueueObject;
-import org.apache.qpid.commands.objects.ObjectNames;
 import org.apache.qpid.utils.JMXinfo;
 
-import javax.management.ObjectName;
-import javax.management.MBeanInfo;
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanAttributeInfo;
-import java.util.StringTokenizer;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.List;
-import java.io.InputStreamReader;
-import java.io.BufferedReader;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 6, 2008
- * Time: 5:35:05 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Commandmove extends CommandImpl {
-    
+public class Commandmove extends CommandImpl
+{
 
     public static final String COMMAND_NAME = "move";
-    
-    private String name1 = null, name2 = null, vhost1 = null, vhost2 = null, method1 = null, method2 = null;    //target and starting queue specifications happen with these options
+
+    private String name1 = null, name2 = null, vhost1 = null, vhost2 = null, method1 = null, method2 = null; // target
+                                                                                                             // and
+                                                                                                             // starting
+                                                                                                             // queue
+                                                                                                             // specifications
+                                                                                                             // happen
+                                                                                                             // with
+                                                                                                             // these
+                                                                                                             // options
     private QueueObject queue1;
     private MBeanServerConnection mbsc;
     private ObjectName queue;
     private int fmid = 0, tmid = 0;
 
-    public Commandmove(JMXinfo info) {
+    public Commandmove(JMXinfo info)
+    {
         super(info);
-        
+
         this.mbsc = info.getmbserverconnector();
         this.queue1 = new QueueObject(mbsc);
         this.method1 = "moveMessages";
         this.method2 = "getMessagesOnTheQueue";
 
     }
-    
-    public void movemessages() {
+
+    public void movemessages()
+    {
         Set set = null;
         queue1.setQueryString(this.getObject(), this.name1, this.vhost1);
         set = queue1.returnObjects();
-        if (queue1.getSet().size() != 0) {                   // find the queue 
+        if (queue1.getSet().size() != 0)
+        { // find the queue
             Iterator it = set.iterator();
             this.queue = (ObjectName) it.next();
-        } else {
-            if (isname1() || isname2()) {                   // if the specified queue is not there in the broker
+        }
+        else
+        {
+            if (isname1() || isname2())
+            { // if the specified queue is not there in the broker
 
                 echo("The Queue you have specified is not in the current broker");
                 echo("");
-            } else {
+            }
+            else
+            {
                 printusage();
             }
         }
-        try {
-            Object[] params1 = {getfmid(), gettmid(), this.name2};
-            String[] signature1 = {new String("long"), new String("long"), new String("java.lang.String")};
+        try
+        {
+            Object[] params1 = { getfmid(), gettmid(), this.name2 };
+            String[] signature1 = { new String("long"), new String("long"), new String("java.lang.String") };
             this.mbsc.invoke(this.queue, this.method1, params1, signature1);
 
-        } catch (Exception ex) {
+        }
+        catch (Exception ex)
+        {
             ex.printStackTrace();
             echo("Given messageId's might be wrong please run the view command and check messageId's you have given\n");
             echo("From MessageId should be greater than 0 and should less than To messageId");
         }
 
-
     }
 
-    public void execute() {
-        /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
-        with main option object or o
+    public void execute()
+    {
+        /*
+         * In here you it's easy to handle any number of otpions which are going
+         * to add with the list command which works with main option object or o
          */
 
-        if (checkoptionsetting("object") || checkoptionsetting("o")) {
+        if (checkoptionsetting("object") || checkoptionsetting("o"))
+        {
             String object = optionchecker("object");
-            if (object == null) {
+            if (object == null)
+            {
                 object = optionchecker("o");
             }
             if (object.compareToIgnoreCase("queue") == 0)
                 setObject(object);
-            else {
+            else
+            {
                 unrecognizeoption();
                 echo("This command is only applicable for queue command so please start with queue");
             }
-            if (checkoptionsetting("n2") && checkoptionsetting("n1")) {
+            if (checkoptionsetting("n2") && checkoptionsetting("n1"))
+            {
                 setname1(optionchecker("n1"));
                 setname2(optionchecker("n2"));
-            } else {
-                echo("You have to specify both n1 and n2 option value to move a message");   /* when user forget to specify target or starting queue name */
+            }
+            else
+            {
+                echo("You have to specify both n1 and n2 option value to move a message"); /*
+                                                                                            * when
+                                                                                            * user
+                                                                                            * forget
+                                                                                            * to
+                                                                                            * specify
+                                                                                            * target
+                                                                                            * or
+                                                                                            * starting
+                                                                                            * queue
+                                                                                            * name
+                                                                                            */
                 return;
             }
 
-            if (checkoptionsetting("v1")) {
+            if (checkoptionsetting("v1"))
+            {
 
                 setvhost1(optionchecker("v1"));
             }
-            if (checkoptionsetting("tmid") && checkoptionsetting("fmid")) {
+            if (checkoptionsetting("tmid") && checkoptionsetting("fmid"))
+            {
                 String tmid = optionchecker("tmid");
                 String fmid = optionchecker("fmid");
 
-
                 settomessageIdandfrommessageId(removeSpaces(tmid), removeSpaces(fmid));
-            } else {
+            }
+            else
+            {
                 echo("You have to set from MessageId and to MessageId in order to move messages between queues");
                 echo("To view MessageId's use <view> command with -n and -v options");
                 return;
             }
             this.movemessages();
 
-        } else if (checkoptionsetting("h") || checkoptionsetting("help"))
+        }
+        else if (checkoptionsetting("h") || checkoptionsetting("help"))
             printusage();
         else
             unrecognizeoption();
     }
 
-    public void printusage() {
+    public void printusage()
+    {
         echo("");
         echo("Usage:move [OPTION] ... [OBJECT TYPE]...\n");
         echo("Move the top most messages from the given queue object to the given destination object\n");
@@ -175,15 +186,18 @@
 
     }
 
-    private void setname1(String name) {
+    private void setname1(String name)
+    {
         this.name1 = name;
     }
 
-    private void setname2(String name) {
+    private void setname2(String name)
+    {
         this.name2 = name;
     }
 
-    private boolean isname1() {
+    private boolean isname1()
+    {
         if (this.name1 == null)
             return false;
 
@@ -191,7 +205,8 @@
             return true;
     }
 
-    private boolean isname2() {
+    private boolean isname2()
+    {
         if (this.name2 == null)
             return false;
 
@@ -199,37 +214,45 @@
             return true;
     }
 
-    private void setvhost1(String vhost) {
+    private void setvhost1(String vhost)
+    {
         this.vhost1 = vhost;
     }
 
-    private static String removeSpaces(String s) {
+    private static String removeSpaces(String s)
+    {
         StringTokenizer st = new StringTokenizer(s, " ", false);
         String t = "";
-        while (st.hasMoreElements()) t += st.nextElement();
+        while (st.hasMoreElements())
+            t += st.nextElement();
         return t;
     }
 
-    private void settomessageIdandfrommessageId(String tmid, String fmid) {
+    private void settomessageIdandfrommessageId(String tmid, String fmid)
+    {
         Integer i = new Integer(tmid);
         Integer j = new Integer(fmid);
         this.tmid = i.intValue();
         this.fmid = j.intValue();
     }
 
-    public int gettmid() {
+    public int gettmid()
+    {
         return this.tmid;
     }
 
-    public int getfmid() {
+    public int getfmid()
+    {
         return this.fmid;
     }
 
-    public String getname1() {
+    public String getname1()
+    {
         return this.name1;
     }
 
-    public String getname2() {
+    public String getname2()
+    {
         return this.name2;
     }
 

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java?rev=733073&r1=733072&r2=733073&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java Fri Jan  9 08:24:01 2009
@@ -43,7 +43,10 @@
 
     private void setAttribute(String option_value)
     {
-        /*print usage if use is not give the correct option letter or no options */
+        /*
+         * print usage if use is not give the correct option letter or no
+         * options
+         */
         if (option_value == null)
         {
             printusage();
@@ -140,8 +143,9 @@
 
     public void execute()
     {
-        /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
-        with main option object or o
+        /*
+         * In here you it's easy to handle any number of otpions which are going
+         * to add with the list command which works with main option object or o
          */
         if (checkoptionsetting("output"))
         {
@@ -254,8 +258,3 @@
     }
 
 }
-
-
-
-
-



Mime
View raw message