Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.management.Query
MBeanServer
. By using the methods in this class,
complex queries can be created from their more basic
components.
Field Summary | |
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
Method Summary | |
static QueryExp | |
static QueryExp |
|
static AttributeValueExp | |
static AttributeValueExp | |
static QueryExp | |
static AttributeValueExp |
|
static ValueExp | |
static QueryExp | |
static QueryExp |
|
static QueryExp | |
static QueryExp | |
static QueryExp | |
static QueryExp |
|
static QueryExp |
|
static QueryExp | |
static QueryExp | |
static QueryExp |
|
static ValueExp | |
static QueryExp | |
static QueryExp | |
static ValueExp | |
static ValueExp | |
static ValueExp |
|
static ValueExp |
|
static ValueExp |
|
static ValueExp |
|
static ValueExp | |
static StringValueExp | |
static ValueExp |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static final int DIV
A code representing the #div(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 3
public static final int EQ
A code representing the #eq(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 4
public static final int GE
A code representing the #ge(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 2
public static final int GT
A code representing the #gt(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 0
public static final int LE
A code representing the #le(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 3
public static final int LT
A code representing the #lt(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 1
public static final int MINUS
A code representing the #minus(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 1
public static final int PLUS
A code representing the #plus(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 0
public static final int TIMES
A code representing the #times(ValueExp, ValueExp) query to be used in serialization.
- Field Value:
- 2
public static QueryExp and(QueryExp q1, QueryExp q2)
Returns a query expression formed from the conjunction of the two supplied query expressions.
- Parameters:
q1
- the first query expression.q2
- the second query expression.
- Returns:
- a query expression representing q1 && q2. This will be serialized as the non-public class
AndQueryExp
.
public static QueryExp anySubString(AttributeValueExp attrib, StringValueExp string)
Returns a query expression which checks that an attribute value held by the specifiedAttributeValueExp
contains the string specified by the givenStringValueExp
.
- Parameters:
attrib
- the attribute to match.string
- the substring to find.
- Returns:
- a query expression representing
attrib.matches("*" + string + "*")
. This will be serialized as the non-public classMatchQueryExp
.
public static AttributeValueExp attr(String name)
Returns a value expression for the value of the named attribute. Evaluating this using anObjectName
involves an underlying call toMBeanServer.getAttribute(ObjectName,String)
.
- Parameters:
name
- the name of the attribute.
- Returns:
- a value expression which returns the value of the named attribute when applied.
public static AttributeValueExp attr(String className, String name)
Returns a value expression for the value of the named attribute from the specified class. Evaluating this using anObjectName
involves an underlying call to bothMBeanServer.getObjectInstance(ObjectName)
andMBeanServer.getAttribute(ObjectName,String)
.
- Parameters:
className
- the class containing the attribute.name
- the name of the attribute.
- Returns:
- a value expression which returns the value of the named attribute when applied. This will be serialized as the non-public class
QualifiedAttributeValueExp
.
public static QueryExp between(ValueExp v1, ValueExp v2, ValueExp v3)
Returns a query expression representing the constraint that the value,v1
, lies betweenv2
andv3
.
- Parameters:
v1
- the value to compare against the boundaries.v2
- the lower boundary.v3
- the upper boundary.
- Returns:
- a query expression representing a comparison of
v1
againstv2
andv3
. It returns true ifv2 <= v1 <= v3
. This will be serialized as the non-public classBetweenQueryExp
.
public static AttributeValueExp classattr()
Returns a value expression which evaluates to the name of the class of the bean when applied. Associating the expression with anObjectName
involves an underlying call to bothMBeanServer.getObjectInstance(ObjectName)
to obtain this information.
- Returns:
- a value expression which returns the class name of the bean to which it is applied. This will be serialized as the non-public class
ClassAttributeValueExp
.
public static ValueExp div(ValueExp v1, ValueExp v2)
Returns a value expression which evaluates to the result of dividingv1
byv2
.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the division when applied. This will be serialized as the non-public class
BinaryOpValueExp
with an operation ofDIV
.
public static QueryExp eq(ValueExp v1, ValueExp v2)
Returns a query expression which evaluates to the result of comparingv1
tov2
for equality.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the comparison when applied. This will be serialized as the non-public class
BinaryRelQueryExp
with an operation ofEQ
.
public static QueryExp finalSubString(AttributeValueExp attrib, StringValueExp string)
Returns a query expression which checks that an attribute value held by the specifiedAttributeValueExp
ends with the string specified by the givenStringValueExp
.
- Parameters:
attrib
- the attribute to match.string
- the substring to find.
- Returns:
- a query expression representing
attrib.matches("*" + string)
. This will be serialized as the non-public classMatchQueryExp
.
public static QueryExp geq(ValueExp v1, ValueExp v2)
Returns a query expression which evaluates to the result of comparingv1
tov2
to see ifv1
is greater than or equal tov2
.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the comparison when applied. This will be serialized as the non-public class
BinaryRelQueryExp
with an operation ofGE
.
public static QueryExp gt(ValueExp v1, ValueExp v2)
Returns a query expression which evaluates to the result of comparingv1
tov2
to see ifv1
is greater thanv2
.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the comparison when applied. This will be serialized as the non-public class
BinaryRelQueryExp
with an operation ofGT
.
public static QueryExp in(ValueExp v, ValueExp[] vlist)
Returns a query expression representing the constraint that the value,v
, is a member of the list,vlist
.
- Parameters:
v
- the value to look for in the list.vlist
- the list of allowed values.
- Returns:
- a query expression representing a membership check of
v
against the list,vlist
. This will be serialized as the non-public classInQueryExp
.
public static QueryExp initialSubString(AttributeValueExp attrib, StringValueExp string)
Returns a query expression which checks that an attribute value held by the specifiedAttributeValueExp
starts with the string specified by the givenStringValueExp
.
- Parameters:
attrib
- the attribute to match.string
- the substring to find.
- Returns:
- a query expression representing
attrib.matches(string + "*")
. This will be serialized as the non-public classMatchQueryExp
.
public static QueryExp isInstanceOf(StringValueExp className)
Returns a query expression which checks that a bean is an instance of the class specified by the givenStringValueExp
. Associating the expression with anObjectName
involves an underlying call toMBeanServer.isInstanceOf(ObjectName,String)
using the value of((StringValueExp) className.apply(objectName)).getValue()
as the class name.
- Parameters:
className
- the name of the class which the bean should be an instance of.
- Returns:
- a query expression representing the inheritance check. This will be serialized as the non-public class
InstanceOfQueryExp
.
- Since:
- 1.6
public static QueryExp leq(ValueExp v1, ValueExp v2)
Returns a query expression which evaluates to the result of comparingv1
tov2
to see ifv1
is less than or equal tov2
.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the comparison when applied. This will be serialized as the non-public class
BinaryRelQueryExp
with an operation ofLE
.
public static QueryExp lt(ValueExp v1, ValueExp v2)
Returns a query expression which evaluates to the result of comparingv1
tov2
to see ifv1
is less thanv2
.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the comparison when applied. This will be serialized as the non-public class
BinaryRelQueryExp
with an operation ofLT
.
public static QueryExp match(AttributeValueExp attrib, StringValueExp string)
Returns a query expression which checks that an attribute value matches the pattern specified by the givenStringValueExp
. The pattern uses file-globbing syntax:
- '*' stands for any number of arbitrary characters.
- '?' stands for a single arbitrary characters.
- An expression within '[' and ']' specify a character class.
- A range of characters can be specified by separating the start and end character with '-'.
- The complement of the class can be obtained by using '!' as the first character of the class.
- '?', '*' and '[' can occur freely within the class. '-' may occur as the first or last character. '!' may occur normally in any position other than the first. ']' may occur as the first element of the class.
'?', '*' and '[' may be escaped using a backslash character, '\'.
- Parameters:
attrib
- the attribute to match.string
- the substring to find.
- Returns:
- a query expression representing the result of matching the pattern against the evaluated value of the attribute. This will be serialized as the non-public class
MatchQueryExp
.
public static ValueExp minus(ValueExp v1, ValueExp v2)
Returns a value expression which evaluates to the result of subtractingv2
fromv1
.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the subtraction when applied. This will be serialized as the non-public class
BinaryOpValueExp
with an operation ofMINUS
.
public static QueryExp not(QueryExp q)
Returns a query expression representing the negation of the specified query expression.
- Parameters:
q
- the query to negate.
- Returns:
- a query expression representing the negation of
q
. This will be serialized as the non-public classNotQueryExp
.
public static QueryExp or(QueryExp q1, QueryExp q2)
Returns a query expression formed from the disjunction of the two supplied query expressions.
- Parameters:
q1
- the first query expression.q2
- the second query expression.
- Returns:
- a query expression representing q1 || q2. This will be serialized as the non-public class
OrQueryExp
.
public static ValueExp plus(ValueExp v1, ValueExp v2)
Returns a value expression which evaluates to the result of addingv1
tov2
.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the addition when applied. This will be serialized as the non-public class
BinaryOpValueExp
with an operation ofPLUS
.
public static ValueExp times(ValueExp v1, ValueExp v2)
Returns a value expression which evaluates to the result of multiplyingv1
byv2
.
- Parameters:
v1
- the left-hand operand.v2
- the right-hand operand.
- Returns:
- a value expression which returns the result of the multiplication when applied. This will be serialized as the non-public class
BinaryOpValueExp
with an operation ofTIMES
.
public static ValueExp value(boolean val)
Returns a value expression wrapping the specified value.
- Parameters:
val
- the boolean value to wrap.
- Returns:
- a value expression wrapping
val
. This will be serialized as the non-public classBooleanValueExp
.
public static ValueExp value(double val)
Returns a value expression wrapping the specified value.
- Parameters:
val
- the double value to wrap.
- Returns:
- a value expression wrapping
val
. This will be serialized as the non-public classNumericValueExp
.
public static ValueExp value(float val)
Returns a value expression wrapping the specified value.
- Parameters:
val
- the float value to wrap.
- Returns:
- a value expression wrapping
val
. This will be serialized as the non-public classNumericValueExp
.
public static ValueExp value(int val)
Returns a value expression wrapping the specified value.
- Parameters:
val
- the integer value to wrap.
- Returns:
- a value expression wrapping
val
. This will be serialized as the non-public classNumericValueExp
.
public static ValueExp value(Number val)
Returns a value expression wrapping the specified value.
- Parameters:
val
- theNumber
value to wrap.
- Returns:
- a value expression wrapping
val
. This will be serialized as the non-public classNumericValueExp
.
public static StringValueExp value(String val)
Returns a value expression wrapping the specified string.
- Parameters:
val
- theString
to wrap.
- Returns:
- a
StringValueExp
wrappingval
.
public static ValueExp value(long val)
Returns a value expression wrapping the specified value.
- Parameters:
val
- the long value to wrap.
- Returns:
- a value expression wrapping
val
. This will be serialized as the non-public classNumericValueExp
.