Package org.apache.qpid.qmf2.common

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


                    }
                    else if (_subscriptionEmulationEnabled && agentName.equals(_brokerAgentName))
                    { // If the data has come from is the broker Agent we emulate a Subscription on the Console
                        for (SubscriptionManager subscription : _subscriptionByHandle.values())
                        {
                            QmfQuery query = subscription.getQuery();
                            if (subscription.getAgent().getName().equals(_brokerAgentName) &&
                                query.getTarget() == QmfQueryTarget.OBJECT)
                            { // Only evaluate broker Agent subscriptions with QueryTarget == OBJECT on the Console.
                                long objectEpoch = 0;
                                consoleHandle = subscription.getConsoleHandle();
                                List<Map> list = AMQPMessage.getList(message);
                                List<QmfConsoleData> resultList = new ArrayList<QmfConsoleData>(list.size());
                                for (Map m : list)
                                { // Evaluate the QmfConsoleData object against the query
                                    QmfConsoleData object = new QmfConsoleData(m, agent);
                                    if (query.evaluate(object))
                                    {
                                        long epoch = object.getObjectId().getAgentEpoch();
                                        objectEpoch = (epoch > objectEpoch && !object.isDeleted()) ? epoch : objectEpoch;
                                        resultList.add(object);
                                    }
View Full Code Here


            {
                if (AMQPMessage.isAMQPMap(message))
                {
                    try
                    {
                        QmfQuery query = new QmfQuery(AMQPMessage.getMap(message));
                        handleQueryRequest(handle, query);
                    }
                    catch (QmfException qmfe)
                    {
                        raiseException(handle, "Query Request failed, invalid Query: " + qmfe.getMessage());
View Full Code Here

        _objectIndex.put(addr, object);

        // Does the new object match any Subscriptions? If so add a reference to the matching Subscription and publish.
        for (Subscription subscription : _subscriptions.values())
        {
            QmfQuery query = subscription.getQuery();
            if (query.getObjectId() != null)
            {
                if (query.getObjectId().equals(addr))
                {
                    object.addSubscription(subscription.getSubscriptionId(), subscription);
                    object.publish();
                }
            }
            else if (query.evaluate(object))
            {
                object.addSubscription(subscription.getSubscriptionId(), subscription);
                object.publish();
            }
        }
View Full Code Here

     * Return the QmfQuery object associated with the SubscriptionParams.
     * @return the QmfQuery object associated with the SubscriptionParams.
     */
    public QmfQuery getQuery() throws QmfException
    {
        return new QmfQuery((Map)getValue("_query"));
    }
View Full Code Here

            {
                if (AMQPMessage.isAMQPMap(message))
                {
                    try
                    {
                        QmfQuery query = new QmfQuery(AMQPMessage.getMap(message));
                        handleQueryRequest(handle, query);
                    }
                    catch (QmfException qmfe)
                    {
                        raiseException(handle, "Query Request failed, invalid Query: " + qmfe.getMessage());
View Full Code Here

        _objectIndex.put(addr, object);

        // Does the new object match any Subscriptions? If so add a reference to the matching Subscription and publish.
        for (Subscription subscription : _subscriptions.values())
        {
            QmfQuery query = subscription.getQuery();
            if (query.getObjectId() != null)
            {
                if (query.getObjectId().equals(addr))
                {
                    object.addSubscription(subscription.getSubscriptionId(), subscription);
                    object.publish();
                }
            }
            else if (query.evaluate(object))
            {
                object.addSubscription(subscription.getSubscriptionId(), subscription);
                object.publish();
            }
        }
View Full Code Here

            {
                if (AMQPMessage.isAMQPMap(message))
                {
                    try
                    {
                        QmfQuery query = new QmfQuery(AMQPMessage.getMap(message));
                        handleQueryRequest(handle, query);
                    }
                    catch (QmfException qmfe)
                    {
                        raiseException(handle, "Query Request failed, invalid Query: " + qmfe.getMessage());
View Full Code Here

        _objectIndex.put(addr, object);

        // Does the new object match any Subscriptions? If so add a reference to the matching Subscription and publish.
        for (Subscription subscription : _subscriptions.values())
        {
            QmfQuery query = subscription.getQuery();
            if (query.getObjectId() != null)
            {
                if (query.getObjectId().equals(addr))
                {
                    object.addSubscription(subscription.getSubscriptionId(), subscription);
                    object.publish();
                }
            }
            else if (query.evaluate(object))
            {
                object.addSubscription(subscription.getSubscriptionId(), subscription);
                object.publish();
            }
        }
View Full Code Here

     * <p>
     * I <i>believe</i> that there should only be one entry in the list returned when looking up a specific chema by classId.
     */
    public List<SchemaClass> getSchema(final SchemaClassId classId)
    {
        SchemaClass schema = _schemaCache.get(classId);
        if (schema == SchemaClass.EMPTY_SCHEMA)
        {
            return Collections.emptyList();
        }
       
View Full Code Here

    }

    public void addObject(QmfAgentData object) throws QmfException
    {
        SchemaClassId classId = object.getSchemaClassId();
        SchemaClass schema = _schemaCache.get(classId);

        // Try to create an objectName using the set of property names that have been specified as idNames in the schema
        StringBuilder buf = new StringBuilder();
        if (schema != null && schema instanceof SchemaObjectClass)
        {
View Full Code Here

TOP

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

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.