Examples of QMFEvent


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

     * Factory method to create an Unsubscribe Event Object with timestamp of now.
     * @return the newly created Unsubscribe Event Object.
     */
    public QmfEvent createUnsubscribeEvent()
    {
        QmfEvent unsubscribe = new QmfEvent(_unsubscribeSchema);
        unsubscribe.setSeverity("info");
        unsubscribe.setValue("dest", getStringValue("name"));
        // TODO Not sure of a way to get these for Java Broker Subscription.
        //unsubscribe.setValue("rhost", _connection.getName());
        //unsubscribe.setValue("user", getStringValue("authIdentity"));
        return unsubscribe;
    }
View Full Code Here

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

     * Factory method to create a Subscribe Event Object with timestamp of now.
     * @return the newly created Subscribe Event Object.
     */
    public QmfEvent createSubscribeEvent()
    {
        QmfEvent subscribe = new QmfEvent(_subscribeSchema);
        subscribe.setSeverity("info");
        subscribe.setValue("args", Collections.EMPTY_MAP);
        subscribe.setValue("dest", getStringValue("name"));
        subscribe.setValue("excl", _exclusive);
        subscribe.setValue("qName", _qName);
        // TODO Not sure of a way to get these for Java Broker Subscription.
        //subscribe.setValue("rhost", _connection.getName());
        //subscribe.setValue("user", getStringValue("authIdentity"));
        return subscribe;
    }
View Full Code Here

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

     * Factory method to create an Unsubscribe Event Object with timestamp of now.
     * @return the newly created Unsubscribe Event Object.
     */
    public QmfEvent createUnsubscribeEvent()
    {
        QmfEvent unsubscribe = new QmfEvent(_unsubscribeSchema);
        unsubscribe.setSeverity("info");
        unsubscribe.setValue("dest", getStringValue("name"));
        // TODO Not sure of a way to get these for Java Broker Subscription.
        //unsubscribe.setValue("rhost", _connection.getName());
        //unsubscribe.setValue("user", getStringValue("authIdentity"));
        return unsubscribe;
    }
View Full Code Here

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

     * Factory method to create a Queue Declare Event Object with timestamp of now.
     * @return the newly created Queue Declare Event Object.
     */
    public QmfEvent createQueueDeclareEvent()
    {
        QmfEvent queueDeclare = new QmfEvent(_queueDeclareSchema);
        queueDeclare.setSeverity("info");
        // TODO the _alternateExchangeName gets set some time after the Constructor - how do I get its value for
        // the queueDeclareEvent???!!!
        queueDeclare.setValue("altEx", _alternateExchangeName);
        queueDeclare.setValue("args", Collections.EMPTY_MAP); // TODO
        queueDeclare.setValue("autoDel", getBooleanValue("autoDelete"));
        queueDeclare.setValue("disp", "created");
        queueDeclare.setValue("durable", getBooleanValue("durable"));
        queueDeclare.setValue("excl", getBooleanValue("exclusive"));
        queueDeclare.setValue("qName", getStringValue("name"));
        // TODO Not sure of a way to get these for Java Broker Exchange.
        //queueDeclare.setValue("rhost", _connection.getName());
        //queueDeclare.setValue("user", getStringValue("authIdentity"));
        return queueDeclare;
    }
View Full Code Here

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

     * Factory method to create a Queue Delete Event Object with timestamp of now.
     * @return the newly created Queue Delete Event Object.
     */
    public QmfEvent createQueueDeleteEvent()
    {
        QmfEvent queueDelete = new QmfEvent(_queueDeleteSchema);
        queueDelete.setSeverity("info");
        queueDelete.setValue("qName", getStringValue("name"));
        // TODO Not sure of a way to get these for Java Broker Exchange.
        //queueDelete.setValue("rhost", _connection.getName());
        //queueDelete.setValue("user", getStringValue("authIdentity"));
        return queueDelete;
    }
View Full Code Here

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

            // The results of an Event delivered from an Agent
            if (opcode.equals("_data_indication") && content.equals("_event"))
            { // There are differences in the type of message sent by Qpid 0.8 and 0.10 onwards.
                if (AMQPMessage.isAMQPMap(message))
                { // 0.8 broker passes Events as amqp/map encoded as MapMessages (we convert into java.util.Map)
                    _eventListener.onEvent(new EventReceivedWorkItem(agent, new QmfEvent(AMQPMessage.getMap(message))));
                }
                else if (AMQPMessage.isAMQPList(message))
                { // 0.10 and above broker passes Events as amqp/list encoded as BytesMessage (needs decoding)
                  // 0.20 encodes amqp/list in a MapMessage!!?? AMQPMessage hopefully abstracts this detail.
                    List<Map> list = AMQPMessage.getList(message);
                    for (Map m : list)
                    {
                        _eventListener.onEvent(new EventReceivedWorkItem(agent, new QmfEvent(m)));
                    }
                }
                else
                {
                    _log.info("onMessage() Received Event message in incorrect format");
View Full Code Here

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

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

            if (className.equals("queueDeclare"))
            {
                updateQueueCache();
            }
            else if (className.equals("queueThresholdExceeded"))
            {
                String queueName = event.getStringValue("qName");
                boolean matches = false;
                for (Pattern x : _filter)
                { // Check the queue name against the regexes in the filter List (if any)
                    Matcher m = x.matcher(queueName);
                    if (m.find())
                    {
                        matches = true;
                        break;
                    }
                }

                if (_filter.isEmpty() || matches)
                { // If there's no filter enabled or the filter matches the queue name we call purgeQueue().
                    long msgDepth = event.getLongValue("msgDepth");
                    purgeQueue(queueName, msgDepth);
                }
            }
        }
    }
View Full Code Here

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

    public void onEvent(final WorkItem wi)
    {
        if (wi instanceof EventReceivedWorkItem)
        {
            EventReceivedWorkItem item = (EventReceivedWorkItem)wi;
            QmfEvent event = item.getEvent();
            System.out.println(event + " broker=" + _url);
        }
    }
View Full Code Here

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

    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

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

    {
        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
TOP
Copyright © 2018 www.massapi.com. 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.