Package org.apache.qpid.qmf2.console

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


            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

                    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

                            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

    {
        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

            _objects.clear();
        }
        else if (wi instanceof SubscriptionIndicationWorkItem)
        {
            SubscriptionIndicationWorkItem item = (SubscriptionIndicationWorkItem)wi;
            SubscribeIndication indication = item.getSubscribeIndication();
            String correlationId = indication.getConsoleHandle();
            if (correlationId.equals("queueStatsHandle"))
            { // If it is (and it should be!!) then it's our queue object Subscription
                List<QmfConsoleData> data = indication.getData();
                for (QmfConsoleData record : data)
                {
                    ObjectId id = record.getObjectId();
                    if (record.isDeleted())
                    { // If the object was deleted by the Agent we remove it from out Map
View Full Code Here

    private void createQueueSubscription()
    {
        try
        {   // This QmfQuery simply does an ID query for objects with the className "queue"
            QmfQuery query = new QmfQuery(QmfQueryTarget.OBJECT, new SchemaClassId("queue"));
            SubscribeParams params = _console.createSubscription(_broker, query, "queueStatsHandle");
            _subscriptionId = params.getSubscriptionId();
            _subscriptionDuration = params.getLifetime() - 10; // Subtract 10 as we want to refresh before it times out
            _startTime = System.currentTimeMillis();
        }
        catch (QmfException qmfe)
        {
        }
View Full Code Here

        {
            _objects.clear();
        }
        else if (wi instanceof SubscriptionIndicationWorkItem)
        {
            SubscriptionIndicationWorkItem item = (SubscriptionIndicationWorkItem)wi;
            SubscribeIndication indication = item.getSubscribeIndication();
            String correlationId = indication.getConsoleHandle();
            if (correlationId.equals("queueStatsHandle"))
            { // If it is (and it should be!!) then it's our queue object Subscription
                List<QmfConsoleData> data = indication.getData();
                for (QmfConsoleData record : data)
View Full Code Here

        try
        {
            String host = "localhost";
            String connectionOptions = "{reconnect: true}";
            List<Pattern> filter = new ArrayList<Pattern>();
            GetOpt getopt = new GetOpt(args, "ha:f:", longOpts);
            List<String[]> optList = getopt.getOptList();

            for (String[] opt : optList)
            {
                if (opt[0].equals("-h") || opt[0].equals("--help"))
                {
View Full Code Here

        String[] longOpts = {"help", "whitelist=", "sasl-mechanism="};
        try
        {
            String connectionOptions = "{reconnect: true}";
            String whitelist = "./whitelist.xml";
            GetOpt getopt = new GetOpt(args, "h", longOpts);
            List<String[]> optList = getopt.getOptList();
            String[] cargs = {};
            cargs = getopt.getEncArgs().toArray(cargs);
            for (String[] opt : optList)
            {
                if (opt[0].equals("-h") || opt[0].equals("--help"))
                {
                    System.out.println(_usage);
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.