Package org.apache.qpid.qmf2.common

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


        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

            registerObjectClass(mammal);
            registerObjectClass(insect);
            registerObjectClass(reptile);
            registerObjectClass(bird);

            QmfAgentData cat = new QmfAgentData(mammal);
            cat.setValue("name", "cat");
            cat.setValue("legs", 4l);
            addObject(cat);

            QmfAgentData dog = new QmfAgentData(mammal);
            dog.setValue("name", "dog");
            dog.setValue("legs", 4l);
            addObject(dog);

            QmfAgentData rabbit = new QmfAgentData(mammal);
            rabbit.setValue("name", "rabbit");
            rabbit.setValue("legs", 4);
            addObject(rabbit);

            QmfAgentData horse = new QmfAgentData(mammal);
            horse.setValue("name", "horse");
            horse.setValue("legs", 4);
            addObject(horse);

            QmfAgentData human = new QmfAgentData(mammal);
            human.setValue("name", "human");
            human.setValue("legs", 2);
            addObject(human);


            QmfAgentData wasp = new QmfAgentData(insect);
            wasp.setValue("name", "wasp");
            wasp.setValue("legs", 6);
            addObject(wasp);

            QmfAgentData ant = new QmfAgentData(insect);
            ant.setValue("name", "ant");
            ant.setValue("legs", 6);
            addObject(ant);

            QmfAgentData crocodile = new QmfAgentData(reptile);
            crocodile.setValue("name", "crocodile");
            crocodile.setValue("legs", 4);
            addObject(crocodile);

            QmfAgentData gecko = new QmfAgentData(reptile);
            gecko.setValue("name", "gecko");
            gecko.setValue("legs", 4);
            addObject(gecko);

            QmfAgentData python = new QmfAgentData(reptile);
            python.setValue("name", "python");
            python.setValue("legs", 0);
            addObject(python);

            QmfAgentData hawk = new QmfAgentData(bird);
            hawk.setValue("name", "hawk");
            hawk.setValue("legs", 2);
            addObject(hawk);

            QmfAgentData ostrich = new QmfAgentData(bird);
            ostrich.setValue("name", "ostrich");
            ostrich.setValue("legs", 2);
            addObject(ostrich);


            System.out.println("total number of objects registered: " + _objectIndex.size());
View Full Code Here

        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));
            }
        }
        else
        {
            for (QmfAgentData object : _objectIndex.values())
            {
                if (!object.isDeleted() && query.evaluate(object))
                {
                    results.add(new QmfConsoleData(object.mapEncode(), null));
                }
            }
        }

        return results;
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

                    System.out.printf("--ive ");
                }

                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"));
                    }
View Full Code Here

TOP

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

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.