Package org.apache.qpid.qmf2.console

Examples of org.apache.qpid.qmf2.console.QmfConsoleData


        }

        if (wi.getType() == OBJECT_UPDATE)
        {
            ObjectUpdateWorkItem item = (ObjectUpdateWorkItem)wi;
            QmfConsoleData object = item.getQmfConsoleData();
            ObjectId objectId = object.getObjectId();
            String correlationId = item.getHandle().getCorrelationId();
            System.out.println("correlationId = " + correlationId);
            System.out.println("objectId = " + objectId);
            System.out.println("MethodCount = " + object.getLongValue("methodCount"));
        }

    }
View Full Code Here


        }

        if (wi.getType() == OBJECT_UPDATE)
        {
            ObjectUpdateWorkItem item = (ObjectUpdateWorkItem)wi;
            QmfConsoleData object = item.getQmfConsoleData();
            ObjectId objectId = object.getObjectId();
            String correlationId = item.getHandle().getCorrelationId();
            System.out.println("correlationId = " + correlationId);
            System.out.println("objectId = " + objectId);
            System.out.println("MethodCount = " + object.getLongValue("methodCount"));
        }

        if (wi.getType() == SUBSCRIBE_RESPONSE)
        {
            SubscribeResponseWorkItem item = (SubscribeResponseWorkItem)wi;
            SubscribeParams params = item.getSubscribeParams();
            System.out.println("duration = " + params.getLifetime());
            System.out.println("interval = " + params.getPublishInterval());
            System.out.println("subscriptionId = " + params.getSubscriptionId());
            System.out.println("consoleHandle = " + params.getConsoleHandle());
            String correlationId = item.getHandle().getCorrelationId();
            System.out.println("correlationId = " + correlationId);
        }

        if (wi.getType() == SUBSCRIPTION_INDICATION)
        {
            SubscriptionIndicationWorkItem item = (SubscriptionIndicationWorkItem)wi;
            SubscribeIndication indication = item.getSubscribeIndication();
            String correlationId = indication.getConsoleHandle();
            System.out.println("correlationId = " + correlationId);

            List<QmfConsoleData> objects = indication.getData();
            for (QmfConsoleData object : objects)
            {
                if (object.isDeleted())
                {
                    System.out.println("object has been deleted");
                }
                String className = object.getSchemaClassId().getClassName();
                System.out.println("object class = " + className);
                if (className.equals("queue") || className.equals("exchange"))
                {
                    if (object.hasValue("name"))
                    {
                        System.out.println("property update, name = " + object.getStringValue("name"));
                    }
                    else
                    {
                        _objectId = object.getObjectId();
                        System.out.println("statistic update, oid = " + _objectId);
                    }
                }
            }
        }
View Full Code Here

        }

        if (wi.getType() == OBJECT_UPDATE)
        {
            ObjectUpdateWorkItem item = (ObjectUpdateWorkItem)wi;
            QmfConsoleData object = item.getQmfConsoleData();
            ObjectId objectId = object.getObjectId();
            String correlationId = item.getHandle().getCorrelationId();
            System.out.println("correlationId = " + correlationId);
            System.out.println("objectId = " + objectId);
            System.out.println("MethodCount = " + object.getLongValue("methodCount"));
        }

        if (wi.getType() == SUBSCRIBE_RESPONSE)
        {
            SubscribeResponseWorkItem item = (SubscribeResponseWorkItem)wi;
            SubscribeParams params = item.getSubscribeParams();
            System.out.println("duration = " + params.getLifetime());
            System.out.println("interval = " + params.getPublishInterval());
            System.out.println("subscriptionId = " + params.getSubscriptionId());
            System.out.println("consoleHandle = " + params.getConsoleHandle());
            String correlationId = item.getHandle().getCorrelationId();
            System.out.println("correlationId = " + correlationId);
        }

        if (wi.getType() == SUBSCRIPTION_INDICATION)
        {
            SubscriptionIndicationWorkItem item = (SubscriptionIndicationWorkItem)wi;
            SubscribeIndication indication = item.getSubscribeIndication();
            String correlationId = indication.getConsoleHandle();
            System.out.println("correlationId = " + correlationId);

            List<QmfConsoleData> objects = indication.getData();
            for (QmfConsoleData object : objects)
            {
                if (object.isDeleted())
                {
                    System.out.println("object has been deleted");
                }
                System.out.println("offset = " + object.getValue("offset"));
            }
        }
    }
View Full Code Here

            {
                System.out.println("No broker QmfConsoleData returned");
                System.exit(1);
            }

            QmfConsoleData broker = brokers.get(0);
            QmfData arguments = new QmfData();

            while (true)
            {
                try
                {
                    MethodResult results = broker.invokeMethod("getLogLevel", arguments);
//System.out.println(results.getStringValue("level"));
                }
                catch (QmfException e)
                { // This may be throw if we've already added the queues, we just catch and ignore for this test.
                    //System.out.println(e.getMessage());
View Full Code Here

                                }
                            }

                            if (_filter.isEmpty() || matches)
                            { // If there's no filter enabled or the filter matches the queue name we display statistics.
                                QmfConsoleData lastSample = stats.getData();
                                stats.setData(record);
   
                                float deltaTime = record.getUpdateTime() - lastSample.getUpdateTime();
                                if (deltaTime > 1000000000.0f)
                                {
                                    float deltaEnqueues = record.getLongValue("msgTotalEnqueues") -
                                                          lastSample.getLongValue("msgTotalEnqueues");
                                    float deltaDequeues = record.getLongValue("msgTotalDequeues") -
                                                          lastSample.getLongValue("msgTotalDequeues");
                                    long msgDepth = record.getLongValue("msgDepth");
                                    float enqueueRate = deltaEnqueues/(deltaTime/1000000000.0f);
                                    float dequeueRate = deltaDequeues/(deltaTime/1000000000.0f);

                                    System.out.printf("%-46s%10.2f%11d%13.2f%13.2f\n",
View Full Code Here

                }

                if (exchange.hasValue("altExchange"))
                {
                    ObjectId altExchangeRef = exchange.getRefValue("altExchange");
                    QmfConsoleData altExchange = findById(exchanges, altExchangeRef);
                    if (altExchange != null)
                    {
                        System.out.printf("--alternate-exchange=%s", altExchange.getStringValue("name"));
                    }
                }

                System.out.println();
            }
View Full Code Here

                    ObjectId exchangeRef = binding.getRefValue("exchangeRef");

                    if (exchangeRef.equals(exchangeId))
                    {
                        ObjectId queueRef = binding.getRefValue("queueRef");
                        QmfConsoleData queue = findById(queues, queueRef);

                        String queueName = "<unknown>";
                        if (queue != null)
                        {
                            queueName = queue.getStringValue("name");
                            if (queueName.equals(""))
                            {
                                queueName = "''";
                            }
                        }
View Full Code Here

                {
                    ObjectId altExchangeRef = queue.getRefValue("altExchange");
                    List<QmfConsoleData> altExchanges = _console.getObjects(altExchangeRef);
                    if (altExchanges.size() == 1)
                    {
                        QmfConsoleData altExchange = altExchanges.get(0);
                        System.out.printf("--alternate-exchange=%s", altExchange.getStringValue("name"));
                    }
                }

                if (args.containsKey(FLOW_STOP_SIZE))
                {
View Full Code Here

                    ObjectId queueRef = binding.getRefValue("queueRef");

                    if (queueRef.equals(queueId))
                    {
                        ObjectId exchangeRef = binding.getRefValue("exchangeRef");
                        QmfConsoleData exchange = findById(exchanges, exchangeRef);

                        String exchangeName = "<unknown>";
                        if (exchange != null)
                        {
                            exchangeName = exchange.getStringValue("name");
                            if (exchangeName.equals(""))
                            {
                                exchangeName = "''";
                            }
                        }
View Full Code Here

     * @param queueName the name of the queue to purge
     * @param msgDepth the number of messages on the queue, used to determine how many messages to purge.
     */
    private void purgeQueue(final String queueName, long msgDepth)
    {
        QmfConsoleData queue = _queueCache.get(queueName);

        if (queue == null)
        {
            System.out.printf("%s ERROR QueueFuse.disconnectQueue() %s reference couldn't be found\n",
                              new Date().toString(), queueName);
        }
        else
        { // If we've found a queue called queueName we then find the bindings that reference it.

            Map args = (Map)queue.getValue("arguments");
            String policyType = (String)args.get("qpid.policy_type");
            if (policyType != null && policyType.equals("ring"))
            {  // If qpid.policy_type=ring we return.
                return;
            }

            try
            {
                QmfData arguments = new QmfData();
                arguments.setValue("request", (long)(_purge*msgDepth));
                queue.invokeMethod("purge", arguments);
            }
            catch (QmfException e)
            {
                System.out.println(e.getMessage());
            }   
View Full Code Here

TOP

Related Classes of org.apache.qpid.qmf2.console.QmfConsoleData

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.