javax.management.relation
Class RoleInfo

java.lang.Object
  |
  +--javax.management.relation.RoleInfo
All Implemented Interfaces:
java.io.Serializable

public class RoleInfo
extends java.lang.Object
implements java.io.Serializable

A RoleInfo object represents a role information in a relation type.

Author:
Young Yang
See Also:
Serialized Form

Field Summary
static int ROLE_CARDINALITY_INFINITY
          To specify an unlimited cardinality, -1
 
Constructor Summary
RoleInfo(RoleInfo roleInfo)
          Copy constructor
RoleInfo(java.lang.String theName, java.lang.String theRefMBeanClassName)
          Constructor with true readable,true writable,1 minDegree,1 maxDegree,null description
RoleInfo(java.lang.String name, java.lang.String refMBeanClassName, boolean readable, boolean writable)
          Constructor with 1 minDegree and 1 maxDegree,null description
RoleInfo(java.lang.String name, java.lang.String refMBeanClassName, boolean readable, boolean writable, int minDegree, int maxDegree, java.lang.String description)
          Constructor
 
Method Summary
 boolean checkMaxDegree(int value)
          Returns a boolean to specify if given value is less or equal than expected maximum degree (true if yes)
 boolean checkMinDegree(int value)
          Returns a boolean to specify if given value is greater or equal than expected minimum degree (true if yes)
 java.lang.String getDescription()
          Returns description text for the role
 int getMaxDegree()
          Returns maximum degree for corresponding role reference
 int getMinDegree()
          Returns minimum degree for corresponding role reference
 java.lang.String getName()
          Returns the name of the role
 java.lang.String getRefMBeanClassName()
          Returns name of class of MBean expected to be referenced in corresponding role
 boolean isReadable()
          Returns read access mode for the role (true if it is readable)
 boolean isWritable()
          Returns write access mode for the role (true if it is writable)
 java.lang.String toString()
          Prints a string describing the role info
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ROLE_CARDINALITY_INFINITY

public static final int ROLE_CARDINALITY_INFINITY
To specify an unlimited cardinality, -1
Constructor Detail

RoleInfo

public RoleInfo(java.lang.String name,
                java.lang.String refMBeanClassName,
                boolean readable,
                boolean writable,
                int minDegree,
                int maxDegree,
                java.lang.String description)
         throws java.lang.IllegalArgumentException,
                InvalidRoleInfoException,
                java.lang.ClassNotFoundException,
                NotCompliantMBeanException
Constructor
Parameters:
name - name of the role
refMBeanClassName - name of the class of MBean(s) expected to be referenced in corresponding role
readable - flag to indicate if the corresponding role can be read
writable - flag to indicate if the corresponding role can be set
minDegree - minimum degree for role, i.e. minimum number of MBeans to provide in corresponding role Must be less or equal than maxDegree. (ROLE_CARDINALITY_INFINITY for unlimited)
maxDegree - maximum degree for role, i.e. maximum number of MBeans to provide in corresponding role Must be greater or equal than minDegree (ROLE_CARDINALITY_INFINITY for unlimited)
description - description of the role (can be null)
Throws:
java.lang.IllegalArgumentException - if null parameter
InvalidRoleInfoException - if the minimum degree is greater than the maximum degree.
java.lang.ClassNotFoundException - if the class refMBeanClassName does not exist.
NotCompliantMBeanException - if the class refMBeanClassName is not a MBean class.

RoleInfo

public RoleInfo(java.lang.String name,
                java.lang.String refMBeanClassName,
                boolean readable,
                boolean writable)
         throws java.lang.IllegalArgumentException,
                java.lang.ClassNotFoundException,
                NotCompliantMBeanException
Constructor with 1 minDegree and 1 maxDegree,null description

RoleInfo

public RoleInfo(java.lang.String theName,
                java.lang.String theRefMBeanClassName)
         throws java.lang.IllegalArgumentException,
                java.lang.ClassNotFoundException,
                NotCompliantMBeanException
Constructor with true readable,true writable,1 minDegree,1 maxDegree,null description

RoleInfo

public RoleInfo(RoleInfo roleInfo)
         throws java.lang.IllegalArgumentException
Copy constructor
Throws:
java.lang.IllegalArgumentException - if null parameter
Method Detail

getName

public java.lang.String getName()
Returns the name of the role

isReadable

public boolean isReadable()
Returns read access mode for the role (true if it is readable)

isWritable

public boolean isWritable()
Returns write access mode for the role (true if it is writable)

getDescription

public java.lang.String getDescription()
Returns description text for the role

getMinDegree

public int getMinDegree()
Returns minimum degree for corresponding role reference

getMaxDegree

public int getMaxDegree()
Returns maximum degree for corresponding role reference

getRefMBeanClassName

public java.lang.String getRefMBeanClassName()
Returns name of class of MBean expected to be referenced in corresponding role

checkMinDegree

public boolean checkMinDegree(int value)
Returns a boolean to specify if given value is greater or equal than expected minimum degree (true if yes)
Parameters:
value - value
Returns:
true if greater or equal than minimum degree, false else

checkMaxDegree

public boolean checkMaxDegree(int value)
Returns a boolean to specify if given value is less or equal than expected maximum degree (true if yes)
Parameters:
value - value
Returns:
true if less or equal than maximum degree, false else

toString

public java.lang.String toString()
Prints a string describing the role info
Overrides:
toString in class java.lang.Object