Package org.apache.qpid.commands.objects

Examples of org.apache.qpid.commands.objects.ObjectNames


            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("Your query returned more than one object to set was this intended?" + 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())
                {
View Full Code Here


            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("Your query returned more than one object 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
            {
View Full Code Here

            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("Your query returned more than one object to set was this intended?" + 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())
                {
View Full Code Here

            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 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)
            {
                objname = new ExchangeObject(mbsc);
                // 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)
            {
                objname = new AllObjects(mbsc);
                // 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
            {
                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)
                    objname.displayqueues(this.getOutputFormat(), this.getSeperator());
                else
                    objname.displayobjects(this.getOutputFormat(), this.getSeperator());
            }
            else
            {
                if (hasName())
                {
View Full Code Here

            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("Your query returned more than one object 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
            {
View Full Code Here

            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 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)
            {
                objname = new ExchangeObject(mbsc);
                // 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)
            {
                objname = new AllObjects(mbsc);
                // 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
            {
                printusage();
                echo("Wrong objectName");
                return;
            }
            objname.setQueryString(this.getObject(), this.getName(), this.getVirtualhost());
            objname.returnObjects();
            if (objname.getSet().size() != 0)
            {
                objname.displayinfo(this.getOutputFormat(), this.getSeperator());

            }
            else
            {
                if (hasName())
View Full Code Here

TOP

Related Classes of org.apache.qpid.commands.objects.ObjectNames

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.