Home » openjdk-7 » javax » management » [javadoc | source]
javax.management
public class: Query [javadoc | source]
java.lang.Object
   javax.management.Query

Constructs query object constraints.

The MBean Server can be queried for MBeans that meet a particular condition, using its queryNames or queryMBeans method. The QueryExp parameter to the method can be any implementation of the interface {@code QueryExp}, but it is usually best to obtain the {@code QueryExp} value by calling the static methods in this class. This is particularly true when querying a remote MBean Server: a custom implementation of the {@code QueryExp} interface might not be present in the remote MBean Server, but the methods in this class return only standard classes that are part of the JMX implementation.

As an example, suppose you wanted to find all MBeans where the {@code Enabled} attribute is {@code true} and the {@code Owner} attribute is {@code "Duke"}. Here is how you could construct the appropriate {@code QueryExp} by chaining together method calls:

QueryExp query =
    Query.and(Query.eq(Query.attr("Enabled"), Query.value(true)),
              Query.eq(Query.attr("Owner"), Query.value("Duke")));
Field Summary
public static final  int GT    A code representing the Query#gt query. This is chiefly of interest for the serialized form of queries. 
public static final  int LT    A code representing the Query#lt query. This is chiefly of interest for the serialized form of queries. 
public static final  int GE    A code representing the Query#geq query. This is chiefly of interest for the serialized form of queries. 
public static final  int LE    A code representing the Query#leq query. This is chiefly of interest for the serialized form of queries. 
public static final  int EQ    A code representing the Query#eq query. This is chiefly of interest for the serialized form of queries. 
public static final  int PLUS    A code representing the Query#plus expression. This is chiefly of interest for the serialized form of queries. 
public static final  int MINUS    A code representing the Query#minus expression. This is chiefly of interest for the serialized form of queries. 
public static final  int TIMES    A code representing the Query#times expression. This is chiefly of interest for the serialized form of queries. 
public static final  int DIV    A code representing the Query#div expression. This is chiefly of interest for the serialized form of queries. 
Constructor:
 public Query() 
Method from javax.management.Query Summary:
and,   anySubString,   attr,   attr,   between,   classattr,   div,   eq,   finalSubString,   geq,   gt,   in,   initialSubString,   isInstanceOf,   leq,   lt,   match,   minus,   not,   or,   plus,   times,   value,   value,   value,   value,   value,   value,   value
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.management.Query Detail:
 public static QueryExp and(QueryExp q1,
    QueryExp q2) 
    Returns a query expression that is the conjunction of two other query expressions.
 public static QueryExp anySubString(AttributeValueExp a,
    StringValueExp s) 
    Returns a query expression that represents a matching constraint on a string argument. The value must contain the given literal string value.
 public static AttributeValueExp attr(String name) 
 public static AttributeValueExp attr(String className,
    String name) 
 public static QueryExp between(ValueExp v1,
    ValueExp v2,
    ValueExp v3) 
    Returns a query expression that represents the constraint that one value is between two other values.
 public static AttributeValueExp classattr() 

    Returns a new class attribute expression which can be used in any Query call that expects a ValueExp.

    Evaluating this expression for a given objectName includes performing MBeanServer.getObjectInstance(objectName) .

 public static ValueExp div(ValueExp value1,
    ValueExp value2) 
    Returns a binary expression representing the quotient of two numeric values.
 public static QueryExp eq(ValueExp v1,
    ValueExp v2) 
    Returns a query expression that represents an equality constraint on two values.
 public static QueryExp finalSubString(AttributeValueExp a,
    StringValueExp s) 
    Returns a query expression that represents a matching constraint on a string argument. The value must end with the given literal string value.
 public static QueryExp geq(ValueExp v1,
    ValueExp v2) 
    Returns a query expression that represents a "greater than or equal to" constraint on two values.
 public static QueryExp gt(ValueExp v1,
    ValueExp v2) 
    Returns a query expression that represents a "greater than" constraint on two values.
 public static QueryExp in(ValueExp val,
    ValueExp[] valueList) 
    Returns an expression constraining a value to be one of an explicit list.
 public static QueryExp initialSubString(AttributeValueExp a,
    StringValueExp s) 
    Returns a query expression that represents a matching constraint on a string argument. The value must start with the given literal string value.
 public static QueryExp isInstanceOf(StringValueExp classNameValue) 
 public static QueryExp leq(ValueExp v1,
    ValueExp v2) 
    Returns a query expression that represents a "less than or equal to" constraint on two values.
 public static QueryExp lt(ValueExp v1,
    ValueExp v2) 
    Returns a query expression that represents a "less than" constraint on two values.
 public static QueryExp match(AttributeValueExp a,
    StringValueExp s) 
    Returns a query expression that represents a matching constraint on a string argument. The matching syntax is consistent with file globbing: supports "?", "*", "[", each of which may be escaped with "\"; character classes may use "!" for negation and "-" for range. (* for any character sequence, ? for a single arbitrary character, [...] for a character sequence). For example: a*b?c would match a string starting with the character a, followed by any number of characters, followed by a b, any single character, and a c.
 public static ValueExp minus(ValueExp value1,
    ValueExp value2) 
    Returns a binary expression representing the difference between two numeric values.
 public static QueryExp not(QueryExp queryExp) 
    Returns a constraint that is the negation of its argument.
 public static QueryExp or(QueryExp q1,
    QueryExp q2) 
    Returns a query expression that is the disjunction of two other query expressions.
 public static ValueExp plus(ValueExp value1,
    ValueExp value2) 
    Returns a binary expression representing the sum of two numeric values, or the concatenation of two string values.
 public static ValueExp times(ValueExp value1,
    ValueExp value2) 
    Returns a binary expression representing the product of two numeric values.
 public static StringValueExp value(String val) 
    Returns a new string expression.
 public static ValueExp value(Number val) 
    Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
 public static ValueExp value(int val) 
    Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
 public static ValueExp value(long val) 
    Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
 public static ValueExp value(float val) 
    Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
 public static ValueExp value(double val) 
    Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
 public static ValueExp value(boolean val) 
    Returns a boolean value expression that can be used in any Query call that expects a ValueExp.