Examples of QmfConsoleData


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

                {
                    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

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

                    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

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

     * @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

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

    {
        readWhitelist();
        List<QmfConsoleData> subscriptions = _console.getObjects("org.apache.qpid.broker", "subscription");
        for (QmfConsoleData subscription : subscriptions)
        {
            QmfConsoleData queue = dereference(subscription.getRefValue("queueRef"));
            QmfConsoleData session = dereference(subscription.getRefValue("sessionRef"));
            QmfConsoleData connection = dereference(session.getRefValue("connectionRef"));
           
            String queueName = queue.getStringValue("name");
            String address = connection.getStringValue("address");
            String timestamp = new Date(subscription.getCreateTime()/1000000l).toString();
            validateQueue(queueName, address, timestamp);
        }
    }
View Full Code Here

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

            for (QmfConsoleData binding : bindings)
            {
                ObjectId queueRef = binding.getRefValue("queueRef");
                if (queueRef.equals(queueId))
                { // We've found a binding that matches queue queueName so look up the associated exchange and validate.
                    QmfConsoleData exchange = dereference(binding.getRefValue("exchangeRef"));
                    String exchangeName = exchange.getStringValue("name");
                    validateQueue(queueName, exchangeName, binding, address, timestamp);
                }
            }
        }
    }
View Full Code Here

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

                    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

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

                            tx.sendResponse(HTTP_NOT_FOUND, "text/plain", "404 Not Found.");
                        }
                        else
                        {   // If we get this far we can create the Object and invoke the method.
                            // We can create a QmfConsoleData with nothing but an ObjectId and the agent.
                            QmfConsoleData object = new QmfConsoleData(Collections.EMPTY_MAP, agent);
                            object.setObjectId(oid);

                            String request = tx.getRequestString();
                            _log.info("QpidServer.doPost path: {} body: {}", tx.getRequestURI(), request);

                            //System.out.println(request);
                            String method = "";
                            try
                            {
                                Map<String, Object> reqMap = JSON.toMap(request);

                                method = (String)reqMap.get("_method_name");
                                Object arguments = reqMap.get("_arguments");

                                Map args = (arguments instanceof Map) ? (Map)arguments : null;
                                //System.out.println("method: " + method + ", args: " + args);

                                // Parse the args if present into a QmfData (needed by invokeMethod).
                                QmfData inArgs = (args == null) ? new QmfData() : new QmfData(args);

                                // Invoke the specified method on the QmfConsoleData we've created.
                                MethodResult results = null;

                                _log.info("invokeMethod: {}", request);
                                results = object.invokeMethod(method, inArgs);
                                tx.sendResponse(HTTP_OK, "application/json", JSON.fromObject(results));
                            }
                            catch (QmfException qmfe)
                            {
                                _log.info("QpidServer.doPost() caught Exception {}", qmfe.getMessage());
View Full Code Here

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

    {
        String consoleDataInfo = "";

        if (data instanceof QmfConsoleData)
        {
            QmfConsoleData consoleData = (QmfConsoleData)data;
            SchemaClassId sid = consoleData.getSchemaClassId();
            long[] ts = consoleData.getTimestamps();

            String objectId = "\"_object_id\":\"" + consoleData.getObjectId().toString() + "\",";
            String schemaId = "\"_schema_id\":{" +
                "\"_package_name\":\"" + sid.getPackageName() +
                "\",\"_class_name\":\"" + sid.getClassName() +
                "\",\"_type\":\"" + sid.getType() +
                "\",\"_hash\":\"" + sid.getHashString() +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.