qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r732310 - in /qpid/trunk/qpid/java/management: common/ common/src/ common/src/main/ common/src/main/java/ common/src/main/java/org/ common/src/main/java/org/apache/ common/src/main/java/org/apache/qpid/ common/src/main/java/org/apache/qpid/...
Date Wed, 07 Jan 2009 11:50:44 GMT
Author: aidan
Date: Wed Jan  7 03:50:43 2009
New Revision: 732310

URL: http://svn.apache.org/viewvc?rev=732310&view=rev
Log:
QPID-1522: Move command line constants to individual command files. Centralise list of commands in CommandLineInterpreter. Make CommandExecutionEngine look up command from registered list rather than use a big if().


Added:
    qpid/trunk/qpid/java/management/common/
    qpid/trunk/qpid/java/management/common/src/
    qpid/trunk/qpid/java/management/common/src/main/
    qpid/trunk/qpid/java/management/common/src/main/java/
    qpid/trunk/qpid/java/management/common/src/main/java/org/
    qpid/trunk/qpid/java/management/common/src/main/java/org/apache/
    qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/
    qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/
    qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/
    qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/JMXConnnectionFactory.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/Commandset.java
Removed:
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandConstants.java
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/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/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/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/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/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

Added: qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/JMXConnnectionFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/JMXConnnectionFactory.java?rev=732310&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/JMXConnnectionFactory.java (added)
+++ qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/JMXConnnectionFactory.java Wed Jan  7 03:50:43 2009
@@ -0,0 +1,249 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.qpid.management.common;
+
+import java.io.IOException;
+import java.security.Security;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.sasl.SaslClientFactory;
+
+import org.apache.qpid.management.common.sasl.CRAMMD5HashedSaslClientFactory;
+import org.apache.qpid.management.common.sasl.Constants;
+import org.apache.qpid.management.common.sasl.JCAProvider;
+import org.apache.qpid.management.common.sasl.SaslProvider;
+import org.apache.qpid.management.common.sasl.UserPasswordCallbackHandler;
+import org.apache.qpid.management.common.sasl.UsernameHashedPasswordCallbackHandler;
+
+public class JMXConnnectionFactory {
+
+	public static JMXConnector getJMXConnection(long timeout, String host, int port, String username, String password) throws Exception
+	{
+		//auto-negotiate an RMI or JMXMP (SASL/CRAM-MD5 or SASL/PLAIN) JMX connection to broker
+        try
+        {
+            return createJMXconnector("RMI", timeout, host, port, username, password);
+        }
+        catch (IOException rmiIOE)
+        {
+            // check if the ioe was raised because we tried connecting to a non RMI-JRMP based JMX server
+            boolean jrmpServer = !rmiIOE.getMessage().contains("non-JRMP server at remote endpoint");
+
+            if (jrmpServer)
+            {
+                throw rmiIOE;
+            }
+            else
+            {
+                try
+                {
+                    //It wasnt an RMI ConnectorServer at the broker end. Try to establish a JMXMP SASL/CRAM-MD5 connection instead.
+                    return createJMXconnector("JMXMP_CRAM-MD5", timeout, host, port, username, password);
+                }
+                catch (IOException cramIOE)
+                {
+                    // check if the IOE was raised because we tried connecting to a SASL/PLAIN server using SASL/CRAM-MD5
+                    boolean plainProfileServer = cramIOE.getMessage().contains("The server supported profiles [SASL/PLAIN]" +
+                    					                            " do not match the client required profiles [SASL/CRAM-MD5]");
+
+                    if (!plainProfileServer)
+                    {
+                        IOException nioe = new IOException();
+                        nioe.initCause(cramIOE);
+                        throw nioe;
+                    }
+                    else
+                    {                    	
+                        try
+                        {
+                            // Try to establish a JMXMP SASL/PLAIN connection instead.
+                            return createJMXconnector("JMXMP_PLAIN", timeout, host, port, username, password);
+                        }
+                        catch (IOException plainIOE)
+                        {
+                            /* Out of options now. Check that the IOE was raised because we tried connecting to a server
+                             * which didnt support SASL/PLAIN. If so, signal an unknown profile type. If not, raise the exception. */
+                            boolean unknownProfile = cramIOE.getMessage().contains("do not match the client required profiles [SASL/PLAIN]");
+
+                            if (unknownProfile)
+                            {
+                                throw new Exception("Unknown JMXMP authentication mechanism, unable to connect.");
+                            }
+                            else
+                            {
+                                IOException nioe = new IOException();
+                                nioe.initCause(plainIOE);
+                                throw nioe;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+	}
+	
+	private static JMXConnector createJMXconnector(String connectionType, long timeout, String host, int port, String userName, String password) throws IOException, Exception
+    {
+	    Map<String, Object> env = new HashMap<String, Object>();
+	    String securityMechanism = null;
+	    JMXServiceURL jmxUrl = null;
+	    
+        if (connectionType == "RMI")
+        {
+            securityMechanism = Constants.MECH_PLAIN;
+
+            jmxUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi");
+            env = null;
+        }
+        else if (connectionType.contains("JMXMP"))
+        {
+            // Check that the JMXMPConnector is available to provide SASL support
+            final String jmxmpcClass = "javax.management.remote.jmxmp.JMXMPConnector";
+
+            try
+            {
+                Class.forName(jmxmpcClass);
+            }
+            catch (ClassNotFoundException cnfe)
+            {
+                throw new Exception("JMXMPConnector class not found, unable to connect to specified server.\n\n"
+                                + "Please add the jmxremote_optional.jar to the jmxremote.sasl plugin folder, or the classpath.");
+            }
+
+            jmxUrl = new JMXServiceURL("jmxmp", host, port);
+            env = new HashMap<String, Object>();
+
+            /* set the package in which to find the JMXMP ClientProvider.class file loaded by the 
+             * jmxremote.sasl plugin (from the jmxremote_optional.jar) */
+            env.put("jmx.remote.protocol.provider.pkgs", "com.sun.jmx.remote.protocol");
+
+            if (connectionType == "JMXMP_CRAM-MD5")
+            {
+                securityMechanism = Constants.MECH_CRAMMD5;
+
+                Map<String, Class<? extends SaslClientFactory>> map = new HashMap<String, Class<? extends SaslClientFactory>>();
+                map.put("CRAM-MD5-HASHED", CRAMMD5HashedSaslClientFactory.class);
+                Security.addProvider(new JCAProvider(map));
+
+                CallbackHandler handler = new UsernameHashedPasswordCallbackHandler(
+                                                userName, password);
+                env.put("jmx.remote.profiles", Constants.SASL_CRAMMD5);
+                env.put("jmx.remote.sasl.callback.handler", handler);
+            }
+            else if (connectionType == "JMXMP_PLAIN")
+            {
+                securityMechanism = Constants.MECH_PLAIN;
+
+                Security.addProvider(new SaslProvider());
+                CallbackHandler handler = new UserPasswordCallbackHandler(userName, password);
+                env.put("jmx.remote.profiles", Constants.SASL_PLAIN);
+                env.put("jmx.remote.sasl.callback.handler", handler);
+            }
+            else
+            {
+                throw new Exception("Unknown authentication mechanism");
+            }
+        }
+        else
+        {
+            throw new Exception("Unknown connection type");
+        }
+
+        ConnectWaiter connector = new ConnectWaiter(jmxUrl, env);
+        Thread connectorThread = new Thread(connector);
+        connectorThread.start();
+        connectorThread.join(timeout);
+
+        if (connector.getConnectionException() != null)
+        {
+            throw connector.getConnectionException();
+        }
+        return connector.getJmxc();
+    }
+	
+    public static class ConnectWaiter implements Runnable
+    {
+        private boolean _connected;
+        private Exception _connectionException;
+        private JMXConnector _jmxc;
+        private JMXServiceURL _jmxUrl;
+        private Map<String, ?> _env;
+        
+        public ConnectWaiter(JMXServiceURL url, Map<String, ?> env)
+        {
+            super();
+            _jmxUrl = url;
+            _env = env;
+        }
+
+        public void run()
+        {
+            try
+            {
+                setConnected(false);
+                setConnectionException(null);
+                setJmxc(JMXConnectorFactory.connect(_jmxUrl, _env));
+
+                setConnected(true);
+            }
+            catch (Exception ex)
+            {
+                setConnectionException(ex);
+            }
+        }
+
+        public void setConnected(boolean _connected)
+        {
+            this._connected = _connected;
+        }
+
+        public boolean getConnected()
+        {
+            return _connected;
+        }
+
+        public void setConnectionException(Exception _connectionException)
+        {
+            this._connectionException = _connectionException;
+        }
+
+        public Exception getConnectionException()
+        {
+            return _connectionException;
+        }
+
+        public void setJmxc(JMXConnector _jmxc)
+        {
+            this._jmxc = _jmxc;
+        }
+
+        public JMXConnector getJmxc()
+        {
+            return _jmxc;
+        }
+    }
+}

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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -39,6 +39,8 @@
 
 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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -37,11 +37,14 @@
  */
 package org.apache.qpid;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.commands.*;
 
 
 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;
@@ -51,29 +54,24 @@
         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 {
+    public boolean CommandSelector() throws Exception {
+        Class<? extends Command> commandClass = _commands.get(this.commandname);
+        if (commandClass != null)
+        {
+            Class<?> parameterTypes = JMXinfo.class;
+            currentcommand = (Command) commandClass.getConstructor(parameterTypes).newInstance(info);
+        }
+        else
+        {
             usage();
             return false;
         }
         return true;
-
-
+    }
+    
+    public static void addCommand(String name, Class<? extends Command> newCommand)
+    {
+        _commands.put(name, newCommand);
     }
 
     public void runcommand() {

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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -38,29 +38,29 @@
 
 package org.apache.qpid;
 
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXConfiguration;
-import org.apache.qpid.utils.JMXinfo;
+import java.io.PrintWriter;
+import java.util.StringTokenizer;
 
 import javax.management.MBeanServerConnection;
 import javax.management.remote.JMXConnector;
-import javax.naming.ServiceUnavailableException;
-import java.io.PrintWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.FileInputStream;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.Properties;
-import java.rmi.ConnectException;
 
-import jline.ConsoleReader;
 import jline.ArgumentCompletor;
+import jline.ConsoleReader;
 import jline.SimpleCompletor;
 
+import org.apache.qpid.commands.Commanddelete;
+import org.apache.qpid.commands.Commandhelp;
+import org.apache.qpid.commands.Commandinfo;
+import org.apache.qpid.commands.Commandlist;
+import org.apache.qpid.commands.Commandmove;
+import org.apache.qpid.commands.Commandview;
+import org.apache.qpid.commands.Commandviewcontent;
+import org.apache.qpid.utils.CommandLineOptionParser;
+import org.apache.qpid.utils.JMXConfiguration;
+import org.apache.qpid.utils.JMXinfo;
 
 public class CommandLineInterpreter {
+    
     public static void main(String[] args) {
         Connector conn = null;
         try {
@@ -86,6 +86,8 @@
                 }
             }
 
+            registerCommands();
+            
             /* Connecting with the broker */
             try {
                 if (commandlineoptionparser == null)
@@ -145,6 +147,17 @@
         }
     }
 
+    private static void registerCommands()
+    {
+        CommandExecutionEngine.addCommand(Commanddelete.COMMAND_NAME, Commanddelete.class);
+        CommandExecutionEngine.addCommand(Commandhelp.COMMAND_NAME, Commandhelp.class);
+        CommandExecutionEngine.addCommand(Commandinfo.COMMAND_NAME, Commandinfo.class);
+        CommandExecutionEngine.addCommand(Commandlist.COMMAND_NAME, Commandlist.class);
+        CommandExecutionEngine.addCommand(Commandmove.COMMAND_NAME, Commandmove.class);
+        CommandExecutionEngine.addCommand(Commandview.COMMAND_NAME, Commandview.class);
+        CommandExecutionEngine.addCommand(Commandviewcontent.COMMAND_NAME, Commandviewcontent.class);
+    }
+
     private static void Usage() {
         System.out.println("Connecting to localhost Qpid java broker...");
     }
@@ -161,7 +174,7 @@
         System.out.println("Please check the host name and the port given");
     }
 
-    public static String[] oneshotmode(String[] args,CommandLineOptionParser commandlineoptionparser,JMXConnector jmxc,MBeanServerConnection mbsc)
+    public static String[] oneshotmode(String[] args,CommandLineOptionParser commandlineoptionparser,JMXConnector jmxc,MBeanServerConnection mbsc) throws Exception
     {
         int check = 0;
         String [] temp;

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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -40,6 +40,7 @@
 
 
 import org.apache.qpid.Command;
+import org.apache.qpid.CommandExecutionEngine;
 import org.apache.qpid.utils.JMXinfo;
 import org.apache.qpid.utils.CommandLineOption;
 
@@ -48,7 +49,6 @@
 
 public abstract class CommandImpl implements Command {
     protected JMXinfo info = null;
-    private String commandname = null;
 
     private String name;
     private String virtualhost = null;
@@ -56,16 +56,16 @@
 
     private String outputformat = null;
     private String seperator = ",";
-
-    public CommandImpl(JMXinfo info, String name) {
+    
+    public CommandImpl(JMXinfo info) {
         this.info = info;
-        this.commandname = name;
     }
 
-    public CommandImpl() {
+    public CommandImpl() 
+    {
 
     }
-
+    
     protected void setName(String name) {
         this.name = name;
     }
@@ -148,11 +148,12 @@
 
     public void unrecognizeoption() {
         echo("list: Unrecognized option");
-        echo("Try `" + this.commandname + " --help` for more information");
+        echo("Try `" + COMMAND_NAME + " --help` for more information");
     }
 
     public abstract void execute();
 
     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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -65,9 +65,10 @@
     private MBeanServerConnection mbsc;
     private String method1, method2;
     private ObjectName queue;
+    public static final String COMMAND_NAME = "delete";
 
-    public Commanddelete(JMXinfo info, String name) {
-        super(info, name);
+    public Commanddelete(JMXinfo info) {
+        super(info);
         this.mbsc = info.getmbserverconnector();
         this.objname = new QueueObject(mbsc);
         this.method1 = "deleteMessageFromTop";
@@ -189,5 +190,4 @@
         while (st.hasMoreElements()) t += st.nextElement();
         return t;
     }
-
 }

Added: 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=732310&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java (added)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java Wed Jan  7 03:50:43 2009
@@ -0,0 +1,232 @@
+/*
+ *
+ * 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.commands;
+
+import org.apache.qpid.commands.objects.ObjectNames;
+import org.apache.qpid.commands.objects.QueueObject;
+import org.apache.qpid.utils.JMXinfo;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import java.util.Set;
+
+public class Commandget extends CommandImpl
+{
+    
+    private String _attributeName;
+    private String _value;
+    public static String COMMAND_NAME = "get";
+
+    public Commandget(JMXinfo info)
+    {
+        super(info);
+    }
+
+    private void getAttribute(String option_value)
+    {
+        if (option_value == null)
+        {
+            printusage();
+            return;
+        }
+        MBeanServerConnection mbsc = info.getmbserverconnector();
+        Set set = null;
+        ObjectNames objname = null;
+
+        try
+        {
+            if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0)
+            {
+                objname = new QueueObject(mbsc);
+            }
+            else
+            {
+                printusage();
+                echo("Wrong objectName");
+                return;
+            }
+
+            if (_attributeName == null)
+            {
+                echo("attribute name not specified. See --help for details");
+                return;
+            }
+
+            objname.setQueryString(this.getObject(), this.getName(), this.getVirtualhost());
+            objname.returnObjects();
+
+            if (objname.getSet().size() != 1)
+            {
+                echo("You quering return more than one queue to set was this intended?\n" + objname.getQueryString());
+            }
+            else if (objname.getSet().size() == 1)
+            {
+                ObjectName object = (ObjectName) objname.getSet().iterator().next();
+
+                Object value= objname.getAttribute(object, _attributeName);
+
+                echo(value.toString());
+            }
+            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
+                {
+                    printusage();
+                }
+            }
+
+        }
+        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
+         */
+        if (checkoptionsetting("output"))
+        {
+            setOutputFormat(optionchecker("output"));
+            if (checkoptionsetting("separator"))
+            {
+                setSeperator(optionchecker("separator"));
+            }
+        }
+        if (checkoptionsetting("object") || checkoptionsetting("o"))
+        {
+            String object = optionchecker("object");
+            if (object == null)
+            {
+                object = optionchecker("o");
+            }
+            setObject(object);
+
+            if (checkoptionsetting("name") || checkoptionsetting("n"))
+            {
+                String name = optionchecker("name");
+                if (name == null)
+                {
+                    name = optionchecker("n");
+                }
+
+                setName(name);
+            }
+
+            if (checkoptionsetting("attribute") || checkoptionsetting("a"))
+            {
+                String name = optionchecker("attribute");
+                if (name == null)
+                {
+                    name = optionchecker("a");
+                }
+
+                setAttributeName(name);
+            }
+            if (checkoptionsetting("virtualhost") || checkoptionsetting("v"))
+            {
+                String vhost = optionchecker("virtualhost");
+                if (vhost == null)
+                {
+                    vhost = optionchecker("v");
+                }
+                setVirtualhost(vhost);
+            }
+            getAttribute(this.getObject());
+        }
+        else if (checkoptionsetting("h") || checkoptionsetting("help"))
+        {
+            printusage();
+        }
+        else
+        {
+            unrecognizeoption();
+        }
+    }
+
+    private void setAttributeName(String name)
+    {
+        this._attributeName = name;
+    }
+
+    public void printusage()
+    {
+        echo("");
+        echo("Usage:set [OPTION] ... [OBJECT TYPE]...\n");
+        echo("List the information about the given object\n");
+        echo("Where possible options include:\n");
+        echo("        -o      --object      type of objects which you want to list\n");
+        echo("                              ex: < list -o queue > : lists all the queues created in the java broker\n");
+        echo("                              For now list command is supporting following object typse \n");
+        echo("                              Queue  Connection  VirtualHost  UserMangement  Exchange");
+        echo("                              Or You can specify object type by giving it at the beginning");
+        echo("                              rather giving it as a argument");
+        echo("                              Ex:< queue list > this command is equal to list -o queue \n");
+        echo("        -v      --virtualhost After specifying the object type you can filter output with this option");
+        echo("                              list objects with the given virtualhost which will help to find ");
+        echo("                              identical queue objects with -n option");
+        echo("                              ex: queue list -v develop   ment");
+        echo("        -n      --name        After specifying what type of objects you want to monitor you can filter");
+        echo("                              the output using -n option by specifying the name of the object you want ");
+        echo("                              to monitor exactly");
+        echo("                              ex: <list -o queue -n ping> : list all the queue objects having queue name");
+        echo("                              of ping");
+        echo("                              ex: <queue list -n ping -v development> list all the queue objects with name ");
+        echo("                              of ping and virtualhost of developement \n");
+        echo("        -a      --attribute   ");
+        echo("        -h      --help        Display the help and back to the qpid-cli prompt\n");
+
+    }
+}
+
+
+
+
+

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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -48,10 +48,13 @@
  * To change this template use File | Settings | File Templates.
  */
 public class Commandhelp extends CommandImpl {
-    public Commandhelp(JMXinfo info, String name) {
-        super(info, name);
-    }
 
+    public static final String COMMAND_NAME = "help";
+    
+    public Commandhelp(JMXinfo info) 
+    {
+    }
+    
     public void execute() {
         printusage();
     }
@@ -70,4 +73,5 @@
         echo("[quit]    This command is disconnect the connection with the Qpid Java broker and go back to normal propmt");
         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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -49,10 +49,11 @@
 
 public class Commandinfo extends CommandImpl {
 
-    public Commandinfo(JMXinfo info, String name) {
-
-        super(info, name);
-
+    public static final String COMMAND_NAME = "info";
+    
+    public Commandinfo(JMXinfo info)
+    {
+        super(info);
     }
 
     private void listobjects(String option_value) {

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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -55,9 +55,11 @@
 
 public class Commandlist extends CommandImpl {
 
-    public Commandlist(JMXinfo info, String name) {
-        super(info, name);
+    public static final String COMMAND_NAME = "list";
 
+    public Commandlist(JMXinfo info)
+    {
+        super(info);
     }
 
     private void listobjects(String option_value) {

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=732310&r1=732309&r2=732310&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 Wed Jan  7 03:50:43 2009
@@ -63,21 +63,26 @@
  * To change this template use File | Settings | File Templates.
  */
 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 QueueObject queue1;
     private MBeanServerConnection mbsc;
     private ObjectName queue;
     private int fmid = 0, tmid = 0;
 
-    public Commandmove(JMXinfo info, String name) {
-        super(info, name);
+    public Commandmove(JMXinfo info) {
+        super(info);
+        
         this.mbsc = info.getmbserverconnector();
         this.queue1 = new QueueObject(mbsc);
         this.method1 = "moveMessages";
         this.method2 = "getMessagesOnTheQueue";
 
     }
-
+    
     public void movemessages() {
         Set set = null;
         queue1.setQueryString(this.getObject(), this.name1, this.vhost1);

Added: 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=732310&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java (added)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java Wed Jan  7 03:50:43 2009
@@ -0,0 +1,261 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.qpid.commands;
+
+import org.apache.qpid.commands.objects.ObjectNames;
+import org.apache.qpid.commands.objects.QueueObject;
+import org.apache.qpid.utils.JMXinfo;
+
+import javax.management.Attribute;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import java.util.Set;
+
+public class Commandset extends CommandImpl
+{
+    private String _attributeName;
+    private String _value;
+    public static String COMMAND_NAME = "set";
+
+    public Commandset(JMXinfo info)
+    {
+        super(info);
+    }
+
+    private void setAttribute(String option_value)
+    {
+        /*print usage if use is not give the correct option letter or no options */
+        if (option_value == null)
+        {
+            printusage();
+            return;
+        }
+        MBeanServerConnection mbsc = info.getmbserverconnector();
+        Set set = null;
+        ObjectNames objname = null;
+
+        try
+        {
+            if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0)
+            {
+                objname = new QueueObject(mbsc);
+            }
+            else
+            {
+                printusage();
+                echo("Wrong objectName");
+                return;
+            }
+
+            if (_attributeName == null)
+            {
+                echo("attribute name not specified. See --help for details");
+                return;
+            }
+
+            if (_value == null)
+            {
+                echo("new value not specified. See --help for details");
+                return;
+            }
+
+            objname.setQueryString(this.getObject(), this.getName(), this.getVirtualhost());
+            objname.returnObjects();
+
+            if (objname.getSet().size() != 1)
+            {
+                echo("You quering return more than one queue to set was this intended?\n" + objname.getQueryString());
+            }
+            else if (objname.getSet().size() == 1)
+            {
+                ObjectName object = (ObjectName) objname.getSet().iterator().next();
+
+                Object value = objname.getAttribute(object, _attributeName);
+
+                Object attributeValue = _value;
+
+                try
+                {
+                    if (value instanceof Integer)
+                    {
+                        attributeValue = Integer.valueOf(_value);
+                    }
+                    else if (value instanceof Long)
+                    {
+                        attributeValue = Long.valueOf(_value);
+                    }
+                }
+                catch (NumberFormatException nfe)
+                {
+                    echo("Value(" + _attributeName + ") should be of type " + value.getClass().getName());
+                    return;
+                }
+
+                Attribute attribute = new Attribute(_attributeName, attributeValue);
+
+                objname.setAttribute(object, attribute);
+            }
+            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
+                {
+                    printusage();
+                }
+            }
+
+        }
+        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
+         */
+        if (checkoptionsetting("output"))
+        {
+            setOutputFormat(optionchecker("output"));
+            if (checkoptionsetting("separator"))
+            {
+                setSeperator(optionchecker("separator"));
+            }
+        }
+        if (checkoptionsetting("object") || checkoptionsetting("o"))
+        {
+            String object = optionchecker("object");
+            if (object == null)
+            {
+                object = optionchecker("o");
+            }
+            setObject(object);
+
+            if (checkoptionsetting("name") || checkoptionsetting("n"))
+            {
+                String name = optionchecker("name");
+                if (name == null)
+                {
+                    name = optionchecker("n");
+                }
+
+                setName(name);
+            }
+
+            if (checkoptionsetting("attribute") || checkoptionsetting("a"))
+            {
+                String name = optionchecker("attribute");
+                if (name == null)
+                {
+                    name = optionchecker("a");
+                }
+
+                setAttributeName(name);
+            }
+
+            if (checkoptionsetting("set") || checkoptionsetting("s"))
+            {
+                String value = optionchecker("set");
+                if (value == null)
+                {
+                    value = optionchecker("s");
+                }
+
+                setAttributeValue(value);
+            }
+
+            if (checkoptionsetting("virtualhost") || checkoptionsetting("v"))
+            {
+                String vhost = optionchecker("virtualhost");
+                if (vhost == null)
+                {
+                    vhost = optionchecker("v");
+                }
+                setVirtualhost(vhost);
+            }
+            setAttribute(this.getObject());
+        }
+        else if (checkoptionsetting("h") || checkoptionsetting("help"))
+        {
+            printusage();
+        }
+        else
+        {
+            unrecognizeoption();
+        }
+    }
+
+    private void setAttributeValue(String value)
+    {
+        _value = value;
+    }
+
+    private void setAttributeName(String name)
+    {
+        this._attributeName = name;
+    }
+
+    public void printusage()
+    {
+        echo("");
+        echo("Usage:set [OPTION] ... [OBJECT TYPE]...\n");
+        echo("List the information about the given object\n");
+        echo("Where possible options include:\n");
+        echo("        -o      --object      type of objects which you want to list\n");
+        echo("                              ex: < list -o queue > : lists all the queues created in the java broker\n");
+        echo("                              For now list command is supporting following object typse \n");
+        echo("                              Queue  Connection  VirtualHost  UserMangement  Exchange");
+        echo("                              Or You can specify object type by giving it at the beginning");
+        echo("                              rather giving it as a argument");
+        echo("                              Ex:< queue list > this command is equal to list -o queue \n");
+        echo("        -v      --virtualhost After specifying the object type you can filter output with this option");
+        echo("                              list objects with the given virtualhost which will help to find ");
+        echo("                              identical queue objects with -n option");
+        echo("                              ex: queue list -v develop   ment");
+        echo("        -n      --name        After specifying what type of objects you want to monitor you can filter");
+        echo("                              the output using -n option by specifying the name of the object you want ");
+        echo("                              to monitor exactly");
+        echo("                              ex: <list -o queue -n ping> : list all the queue objects having queue name");
+        echo("                              of ping");
+        echo("                              ex: <queue list -n ping -v development> list all the queue objects with name ");
+        echo("                              of ping and virtualhost of developement \n");
+        echo("        -a      --attribute   ");
+        echo("        -h      --help        Display the help and back to the qpid-cli prompt\n");
+
+    }
+
+}
+
+
+
+
+

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java Wed Jan  7 03:50:43 2009
@@ -60,14 +60,17 @@
  * To change this template use File | Settings | File Templates.
  */
 public class Commandview extends CommandImpl {
+    
+    public static final String COMMAND_NAME = "view";
+    
     private int number = 0;
     private QueueObject objname;
     private MBeanServerConnection mbsc;
     private String method1;
     private ObjectName queue;
 
-    public Commandview(JMXinfo info, String name) {
-        super(info, name);
+    public Commandview(JMXinfo info) {
+        super(info);
         this.mbsc = info.getmbserverconnector();
         this.objname = new QueueObject(mbsc);
         this.method1 = "viewMessages";

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java Wed Jan  7 03:50:43 2009
@@ -56,6 +56,9 @@
  * To change this template use File | Settings | File Templates.
  */
 public class Commandviewcontent extends CommandImpl {
+
+    public static final String COMMAND_NAME = "viewcontent";
+    
     private String object;
     private String name;
     private String vhost;
@@ -65,14 +68,14 @@
     private String method1;
     private ObjectName queue;
 
-    public Commandviewcontent(JMXinfo info, String name) {
-        super(info, name);
+    public Commandviewcontent(JMXinfo info) {
+        super(info);
         this.mbsc = info.getmbserverconnector();
         this.objname = new QueueObject(mbsc);
         this.method1 = "viewMessageContent";
 
     }
-
+    
     public void viewcontent() {
         Set set = null;
         Object temp[] = {null};

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java Wed Jan  7 03:50:43 2009
@@ -69,7 +69,7 @@
 
     }
     @Test
-    public void TestCommandSelector()
+    public void TestCommandSelector() throws Exception
     {
         line = "list -o queue";
         command = line.split(" ");

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java Wed Jan  7 03:50:43 2009
@@ -80,7 +80,7 @@
 
     }
     @Test
-    public void TestSetQueryString()
+    public void TestSetQueryString() throws Exception
     {
         CommandLineInterpreter.oneshotmode(args,parser,jmxc,mbsc);
         Assert.assertEquals(args[0],"info");

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java Wed Jan  7 03:50:43 2009
@@ -75,7 +75,7 @@
         parser = new CommandLineOptionParser(list);
         test = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT);
         info = new JMXinfo(test.getConnector(),parser,test.getMBeanServerConnection());
-        cmd = new Commandinfo(info,"list");
+        cmd = new Commandinfo(info);
 
     }
     @Test

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java Wed Jan  7 03:50:43 2009
@@ -70,7 +70,7 @@
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
         info = new JMXinfo(jmxc,parser,mbsc);
-        delete = new Commanddelete(info,"delete");
+        delete = new Commanddelete(info);
 
 
 

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java Wed Jan  7 03:50:43 2009
@@ -70,7 +70,7 @@
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
         info = new JMXinfo(jmxc,parser,mbsc);
-        infocommand = new Commandinfo(info,"list");
+        infocommand = new Commandinfo(info);
 
     }
     @Test

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java Wed Jan  7 03:50:43 2009
@@ -74,7 +74,7 @@
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
         info = new JMXinfo(jmxc,parser,mbsc);
-        list = new Commandlist(info,"list");
+        list = new Commandlist(info);
 
     }
     @Test

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java Wed Jan  7 03:50:43 2009
@@ -70,7 +70,7 @@
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
         info = new JMXinfo(jmxc,parser,mbsc);
-        move = new Commandmove(info,"move");
+        move = new Commandmove(info);
 
 
 

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java Wed Jan  7 03:50:43 2009
@@ -70,7 +70,7 @@
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
         info = new JMXinfo(jmxc,parser,mbsc);
-        view = new Commandview(info,"view");
+        view = new Commandview(info);
     }
     @Test
     public void TestSetQueryString()

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java?rev=732310&r1=732309&r2=732310&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java Wed Jan  7 03:50:43 2009
@@ -70,7 +70,7 @@
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
         info = new JMXinfo(jmxc,parser,mbsc);
-        viewcontent = new Commandviewcontent(info,"viewcontent");
+        viewcontent = new Commandviewcontent(info);
 
 
 



Mime
View raw message