.apache.org/qpid/qmfv2-api-proposal.html>QMF2 API Proposal and the QMF2 protocol that is specified at
QMF Map Message Protocol in particular the use of the underscore to specify key names e.g. "_what", "_where", "_object_id", "_schema_id".
This implementation trusts the protocol specification more than the API specification as the underscores are more consistent with the rest of the protocol and the underscored variants are what have been observed when querying the broker ManagementAgent.
A QmfQuery may be constructed as either an "ID" query (to query for a specific ObjectId or SchemaClassId) or a "PREDICATE" query (to query based upon an expression). Note that QMF considers string arguments in boolean expressions to be names of data values in the target object. When evaluating a predicate expression, QMF will fetch the value of the named data item from each candidate target object. The value is then used in the boolean expression. In other words, QMF considers string arguments to be variables in the expression. In order to indicate that a string should be treated as a literal instead, the string must be quoted using the "quote" expression.
Examples
Assume a QmfData type defines fields named "name", "address" and "town". The following predicate expression matches any instance with a name field set to "tross", or any instance where the name field is "jross", the address field is "1313 Spudboy Lane" and the town field is "Utopia":
["or" ["eq" "name" ["quote" "tross"]] ["and" ["eq" "name" ["quote" "jross"]] ["eq" "address" ["quote" "1313 Spudboy Lane"]] ["eq" ["quote" "Utopia"] "town"] ] ]
Assume a QmfData type with fields "name" and "age". A predicate to find all instances with name matching the regular expression "?ross" with an optional age field that is greater than the value 29 or less than 12 would be:
["and" ["re_match" "name" ["quote" "?ross"]] ["and" ["exists" "age"] ["or" ["gt" "age" 27] ["lt" "age" 12]] ] ]
The Expression structure is illustrated below in the context of its relationship with QmfQuery.
@author Fraser Adams