Package org.apache.qpid.qmf2.common

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


        try
        {
            System.out.println("** Starting BigPayloadAgentTest a test of basic Agent class functions **");
               
            Connection connection = ConnectionHelper.createConnection(url, "{reconnect: true}");
            _agent = new Agent(this);
            _agent.setVendor("test.com");
            _agent.setProduct("big-payload-agent");

            System.out.println("Agent name: " + _agent.getName());

View Full Code Here


        System.out.println("WorkItem type: " + wi.getType());

        if (wi.getType() == METHOD_CALL)
        {
            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"))
View Full Code Here

    {
        System.out.println("WorkItem type: " + wi.getType());

        if (wi.getType() == METHOD_CALL)
        {
            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

    public void populateData() throws QmfException
    {
        System.out.println("*** BigPayloadAgentTest creating a control object ***");

        _control = new QmfAgentData(_controlSchema);
        _control.setValue("name", "controller");
        _agent.addObject(_control);
        System.out.println("BigPayloadAgentTest Schema control object added OK");
    }
View Full Code Here

    {
        try
        {
            System.out.println("*** Starting Test2 asynchronous Agent discovery using WorkQueue API ***");
               
            BlockingNotifier notifier = new BlockingNotifier();

            Connection connection = ConnectionHelper.createConnection(url, "{reconnect: true}");
            _console = new Console(notifier);
//console.disableAgentDiscovery(); // To miss all notifications this needs done before addConnection()
            _console.addConnection(connection);

            int count = 0;
            while (true)
            {
                notifier.waitForWorkItem();
                System.out.println("WorkItem available, WorkItem count = " + _console.getWorkitemCount());

                WorkItem wi;
                while ((wi = _console.getNextWorkitem(0)) != null)
                {
View Full Code Here

        if (wi.getType() == METHOD_CALL)
        {
            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"))
                {
View Full Code Here

            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
                        _objects.remove(id);
                    }
                    else
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

                        _agent.methodResponse(methodName, item.getHandle(), inArgs, null);
                    }
                    else if (methodName.equals("event"))
                    {
                        System.out.println("Invoked event method");
                        QmfEvent event = new QmfEvent(_eventSchema);
                        event.setSeverity((int)inArgs.getLongValue("severity"));
                        event.setValue("text", inArgs.getStringValue("text"));
                        _agent.raiseEvent(event);
                        _agent.methodResponse(methodName, item.getHandle(), null, null);
                    }
                    else if (methodName.equals("fail"))
                    {
View Full Code Here

TOP

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

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.