Package org.apache.qpid.qmf2.common

Examples of org.apache.qpid.qmf2.common.NotifierWrapper


     * @param address the connection address information for the subscription.
     * @param timestamp the timestamp of the subscription.
     */
    private void validateQueue(final String queueName, final String address, final String timestamp)
    {
        ObjectId queueId = null;
        List<QmfConsoleData> queues = _console.getObjects("org.apache.qpid.broker", "queue");
        for (QmfConsoleData queue : queues)
        { // We first have to find the ObjectId of the queue called queueName.
            if (queue.getStringValue("name").equals(queueName))
            {
                queueId = queue.getObjectId();
                break;
            }
        }

        if (queueId == null)
        {
            System.out.printf("%s ERROR ConnectionAudit.validateQueue() %s reference couldn't be found\n",
                              new Date().toString(), queueName);
        }
        else
        { // If we've got the queue's ObjectId we then find the binding that references it.
            List<QmfConsoleData> bindings = _console.getObjects("org.apache.qpid.broker", "binding");
            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


        List<QmfConsoleData> bindings = _console.getObjects("org.apache.qpid.broker", "binding");
        List<QmfConsoleData> exchanges = _console.getObjects("org.apache.qpid.broker", "exchange");

        for (QmfConsoleData queue : queues)
        {
            ObjectId queueId = queue.getObjectId();

            if (ref == null || ref.equals(queueId))
            {
                System.out.printf("    Queue '%s'\n", queue.getStringValue("name"));
                System.out.println("        arguments " + (Map)queue.getValue("arguments"));

                for (QmfConsoleData binding : bindings)
                {
                    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)
                        {
View Full Code Here

                System.out.println(p + ": " + connection.getStringValue(p));
            }

            System.out.println("createTimestamp: " + new Date(connection.getCreateTime()/1000000l));

            ObjectId connectionId = connection.getObjectId();
            for (QmfConsoleData session : sessions)
            { // Iterate through all session objects
                ObjectId connectionRef = session.getRefValue("connectionRef");
                if (connectionRef.equals(connectionId))
                { // But only select sessions that are associated with the connection under consideration.
                    System.out.printf("Session '%s'\n", session.getStringValue("name"));
                    int subscriptionCount = 0;
                    ObjectId sessionId = session.getObjectId();
                    for (QmfConsoleData subscription : subscriptions)
                    { // Iterate through all subscription objects
                        ObjectId sessionRef = subscription.getRefValue("sessionRef");
                        if (sessionRef.equals(sessionId))
                        { // But only select subscriptions that are associated with the session under consideration.
                            subscriptionCount++;
                            ObjectId queueRef = subscription.getRefValue("queueRef");
                            if (_logQueues)
                            {
                                logQueueInformation(queueRef);
                            }
                        }
View Full Code Here

        // Finish up the name by incorporating package and class names
        objectName = classId.getPackageName() + ":" + classId.getClassName() + ":" + objectName;

        // Now we've got a good name for the object we create it's ObjectId and add that to the object
        ObjectId addr = new ObjectId("test"/*name*/, objectName, 0/*epoch*/);
        object.setObjectId(addr);

        if (_objectIndex.get(addr) != null)
        {
            throw new QmfException("Duplicate QmfAgentData Address");
View Full Code Here

        List<QmfConsoleData> results = new ArrayList<QmfConsoleData>();

        if (query.getObjectId() != null)
        {
            // Look up a QmfAgentData object by the ObjectId obtained from the query
            ObjectId objectId = query.getObjectId();
            QmfAgentData object = _objectIndex.get(objectId);
            if (object != null && !object.isDeleted())
            {
                results.add(new QmfConsoleData(object.mapEncode(), null));
            }
View Full Code Here

            MethodCallWorkItem item = (MethodCallWorkItem)wi;
            MethodCallParams methodCallParams = item.getMethodCallParams();
            String methodName = methodCallParams.getName();
            ObjectId objectId = methodCallParams.getObjectId();

            QmfData inArgs = methodCallParams.getArgs();
            ObjectId controlAddress = _control.getObjectId();

            if (objectId.equals(controlAddress))
            {
                if (methodName.equals("processPayload"))
                {
                    System.out.println("Invoked processPayload method");

                    byte[] parameter = inArgs.getValue("parameter");
                    System.out.println("payload size = " + parameter.length);

                    QmfData outArgs = new QmfData();
                    outArgs.setValue("return", parameter);
                    _agent.methodResponse(methodName, item.getHandle(), outArgs, null);
                }
            }
        }
    }
View Full Code Here

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

            QmfConsoleData broker = brokers.get(0);
            QmfData arguments = new QmfData();
            arguments.setValue("type", "queue");

            for (int i = 0; i < 300; i++)
            {
                arguments.setValue("name", "test " + i);

                try
                {
                    broker.invokeMethod("create", arguments);
                }
View Full Code Here

        if (_altExchange != null)
        {
            properties.put("alternate-exchange", _altExchange);
        }

        QmfData arguments = new QmfData();
        arguments.setValue("type", "exchange");
        arguments.setValue("name", args[1]);
        arguments.setValue("properties", properties);

        try
        {
            _broker.invokeMethod("create", arguments);
        }
View Full Code Here

        if (_flowResumeCount > 0)
        {
            properties.put(FLOW_RESUME_COUNT, _flowResumeCount);
        }

        QmfData arguments = new QmfData();
        arguments.setValue("type", "queue");
        arguments.setValue("name", args[0]);
        arguments.setValue("properties", properties);

        try
        {
            _broker.invokeMethod("create", arguments);
        }
View Full Code Here

            {
                QmfConsoleData control = controls.get(0);

                // ********** Invoke processPayload nethod **********
                System.out.println("Testing invokeMethod(processPayload, args)");
                QmfData inArgs = new QmfData();
                inArgs.setValue("parameter", new byte[150000000]);

                MethodResult results = control.invokeMethod("processPayload", inArgs);
                if (!results.succeeded())
                {
                    System.out.println("processPayload returned an exception object");
View Full Code Here

TOP

Related Classes of org.apache.qpid.qmf2.common.NotifierWrapper

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.