Package org.apache.qpid.qmf2.common

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


                        _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


    public void onEvent(final WorkItem wi)
    {
        if (wi instanceof EventReceivedWorkItem)
        {
            EventReceivedWorkItem item = (EventReceivedWorkItem)wi;
            QmfEvent event = item.getEvent();
            String className = event.getSchemaClassId().getClassName();
            if (className.equals("subscribe"))
            {
                readWhitelist();
                String queueName = event.getStringValue("qName");
                String address = event.getStringValue("rhost");
                String timestamp = new Date(event.getTimestamp()/1000000l).toString();
                validateQueue(queueName, address, timestamp);
            }
        }
        else if (wi instanceof AgentRestartedWorkItem)
        {
View Full Code Here

    {
        if (wi instanceof EventReceivedWorkItem)
        {
            EventReceivedWorkItem item = (EventReceivedWorkItem)wi;
            Agent agent = item.getAgent();
            QmfEvent event = item.getEvent();

            String className = event.getSchemaClassId().getClassName();
            if (className.equals("clientConnect") ||
                className.equals("clientDisconnect"))
            {
                _stateChanged = true;
            }
View Full Code Here

        {
            return _proxy.refresh(this, objectId, replyHandle, timeout);
        }
        else
        {
            throw new QmfException("Agent.refresh() called from deactivated Agent");
        }
    }
View Full Code Here

        {
            return _proxy.invokeMethod(this, createRequest(objectId, name, inArgs), null, timeout);
        }
        else
        {
            throw new QmfException("Agent.invokeMethod() called from deactivated Agent");
        }
    }
View Full Code Here

        {
            _proxy.invokeMethod(this, createRequest(objectId, name, inArgs), replyHandle, -1);
        }
        else
        {
            throw new QmfException("Agent.invokeMethod() called from deactivated Agent");
        }
    }
View Full Code Here

    {
        if (_exception == this)
        {
            if (hasValue("error_text"))
            {
                return new QmfException(getStringValue("error_text"));
            }

            if (hasValue("message"))
            {
                return new QmfException(getStringValue("message"));
            }
        }
        return null;
    }
View Full Code Here

        ObjectId addr = new ObjectId("test"/*name*/, objectName, 0/*epoch*/);
        object.setObjectId(addr);

        if (_objectIndex.get(addr) != null)
        {
            throw new QmfException("Duplicate QmfAgentData Address");
        }

        _objectIndex.put(addr, object);
    }
View Full Code Here

                if (count == 10)
                {
                    System.out.println("Applying Agent Discovery Query ['eq', '_product', ['quote', 'gizmo']]");
                    System.out.println("This should disable broker Agent events but allow gizmo Agent events");
                    System.out.println("Run AgentTest to prove this");
                    QmfQuery query = new QmfQuery(QmfQueryTarget.OBJECT, "['eq', '_product', ['quote', 'gizmo']]");
                    _console.enableAgentDiscovery(query);
                }
            }
        }
        catch (QmfException qmfe)
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();
        }
View Full Code Here

TOP

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

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.