java.lang.Object
javax.management.relation.RoleInfo
- All Implemented Interfaces:
- Serializable
public class RoleInfo extends Object implements Serializable
A RoleInfo object summarises a role in a relation type.
 
The serialVersionUID of this class is 2504952983494636987L.
- Since:
- 1.5
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description static intROLE_CARDINALITY_INFINITYTo specify an unlimited cardinality.
- 
Constructor SummaryConstructors Constructor Description RoleInfo(String roleName, String mbeanClassName)Constructor.RoleInfo(String roleName, String mbeanClassName, boolean read, boolean write)Constructor.RoleInfo(String roleName, String mbeanClassName, boolean read, boolean write, int min, int max, String descr)Constructor.RoleInfo(RoleInfo roleInfo)Copy constructor.
- 
Method SummaryModifier and Type Method Description booleancheckMaxDegree(int value)Returns true if thevalueparameter is lower than or equal to the expected maximum degree, false otherwise.booleancheckMinDegree(int value)Returns true if thevalueparameter is greater than or equal to the expected minimum degree, false otherwise.StringgetDescription()Returns description text for the role.intgetMaxDegree()Returns maximum degree for corresponding role reference.intgetMinDegree()Returns minimum degree for corresponding role reference.StringgetName()Returns the name of the role.StringgetRefMBeanClassName()Returns name of type of MBean expected to be referenced in corresponding role.booleanisReadable()Returns read access mode for the role (true if it is readable).booleanisWritable()Returns write access mode for the role (true if it is writable).StringtoString()Returns a string describing the role info.
- 
Field Details- 
ROLE_CARDINALITY_INFINITYpublic static final int ROLE_CARDINALITY_INFINITYTo specify an unlimited cardinality.- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details- 
RoleInfopublic RoleInfo(String roleName, String mbeanClassName, boolean read, boolean write, int min, int max, String descr) throws IllegalArgumentException, InvalidRoleInfoException, ClassNotFoundException, NotCompliantMBeanExceptionConstructor.- Parameters:
- roleName- name of the role.
- mbeanClassName- name of the class of MBean(s) expected to be referenced in corresponding role. If an MBean M is in this role, then the MBean server must return true for- isInstanceOf(M, mbeanClassName).
- read- flag to indicate if the corresponding role can be read
- write- flag to indicate if the corresponding role can be set
- min- minimum degree for role, i.e. minimum number of MBeans to provide in corresponding role Must be less than or equal to- max. (ROLE_CARDINALITY_INFINITY for unlimited)
- max- maximum degree for role, i.e. maximum number of MBeans to provide in corresponding role Must be greater than or equal to- min(ROLE_CARDINALITY_INFINITY for unlimited)
- descr- description of the role (can be null)
- Throws:
- IllegalArgumentException- if null parameter
- InvalidRoleInfoException- if the minimum degree is greater than the maximum degree.
- ClassNotFoundException- As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.
- NotCompliantMBeanException- if the class mbeanClassName is not a MBean class.
 
- 
RoleInfopublic RoleInfo(String roleName, String mbeanClassName, boolean read, boolean write) throws IllegalArgumentException, ClassNotFoundException, NotCompliantMBeanExceptionConstructor.- Parameters:
- roleName- name of the role
- mbeanClassName- name of the class of MBean(s) expected to be referenced in corresponding role. If an MBean M is in this role, then the MBean server must return true for- isInstanceOf(M, mbeanClassName).
- read- flag to indicate if the corresponding role can be read
- write- flag to indicate if the corresponding role can be set- Minimum and maximum degrees defaulted to 1. - Description of role defaulted to null. 
- Throws:
- IllegalArgumentException- if null parameter
- ClassNotFoundException- As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.
- NotCompliantMBeanException- As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.
 
- 
RoleInfopublic RoleInfo(String roleName, String mbeanClassName) throws IllegalArgumentException, ClassNotFoundException, NotCompliantMBeanExceptionConstructor.- Parameters:
- roleName- name of the role
- mbeanClassName- name of the class of MBean(s) expected to be referenced in corresponding role. If an MBean M is in this role, then the MBean server must return true for- isInstanceOf(M, mbeanClassName).- IsReadable and IsWritable defaulted to true. - Minimum and maximum degrees defaulted to 1. - Description of role defaulted to null. 
- Throws:
- IllegalArgumentException- if null parameter
- ClassNotFoundException- As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.
- NotCompliantMBeanException- As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.
 
- 
RoleInfoCopy constructor.- Parameters:
- roleInfo- the- RoleInfoinstance to be copied.
- Throws:
- IllegalArgumentException- if null parameter
 
 
- 
- 
Method Details- 
getNameReturns the name of the role.- Returns:
- the name of the role.
 
- 
isReadablepublic boolean isReadable()Returns read access mode for the role (true if it is readable).- Returns:
- true if the role is readable.
 
- 
isWritablepublic boolean isWritable()Returns write access mode for the role (true if it is writable).- Returns:
- true if the role is writable.
 
- 
getDescriptionReturns description text for the role.- Returns:
- the description of the role.
 
- 
getMinDegreepublic int getMinDegree()Returns minimum degree for corresponding role reference.- Returns:
- the minimum degree.
 
- 
getMaxDegreepublic int getMaxDegree()Returns maximum degree for corresponding role reference.- Returns:
- the maximum degree.
 
- 
getRefMBeanClassNameReturns name of type of MBean expected to be referenced in corresponding role. - Returns:
- the name of the referenced type.
 
- 
checkMinDegreepublic boolean checkMinDegree(int value)Returns true if thevalueparameter is greater than or equal to the expected minimum degree, false otherwise.- Parameters:
- value- the value to be checked
- Returns:
- true if greater than or equal to minimum degree, false otherwise.
 
- 
checkMaxDegreepublic boolean checkMaxDegree(int value)Returns true if thevalueparameter is lower than or equal to the expected maximum degree, false otherwise.- Parameters:
- value- the value to be checked
- Returns:
- true if lower than or equal to maximum degree, false otherwise.
 
- 
toStringReturns a string describing the role info.
 
-