RoleStatus.java :  » JMX » XMOJO » javax » management » relation » Java Open Source

Java Open Source » JMX » XMOJO 
XMOJO » javax » management » relation » RoleStatus.java
/**
* The XMOJO Project 5
* Copyright  2003 XMOJO.org. All rights reserved.

* NO WARRANTY

* BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
* THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
* OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
* PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
* OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
* TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE
* LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
* REPAIR OR CORRECTION.

* IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
* ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
* THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
* GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
* USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF
* DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
* PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE),
* EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGES.
**/

package javax.management.relation;


/**
 * This class describes the various problems which can be encountered when
 * accessing a role.
 */
public class RoleStatus
{
  /**
   * Problem type when trying to access an unknown role
   */
  public static final int NO_ROLE_WITH_NAME = 1;

  /**
   * Problem type when trying to read a non-readable attribute
   */
  public static final int ROLE_NOT_READABLE = 2;

  /**
   * Problem type when trying to update a non-writable attribute
   */
  public static final int ROLE_NOT_WRITABLE = 3;

    /**
   * Problem type when trying to set a role value with less ObjectNames
   * than the minimum expected cardinality
   */
    public static final int LESS_THAN_MIN_ROLE_DEGREE = 4;

  /**
   * Problem type when trying to set a role value with more ObjectNames
   * than the maximum expected cardinality
   */
  public static final int MORE_THAN_MAX_ROLE_DEGREE = 5;

  /**
   * Problem type when trying to set a role value including the ObjectName
   * of a MBean not of the class expected for that role
     */
  public static final int REF_MBEAN_OF_INCORRECT_CLASS = 6;

  /**
   * Problem type when trying to set a role value including the ObjectName
   * of a MBean not registered in the MBean Server
   */
  public static final int REF_MBEAN_NOT_REGISTERED = 7;


  /**
   * Default constructor to create RoleStatus
   */
  public RoleStatus()
  {
  }

  /**
   * Returns true if given value corresponds to a known role status, false else.
   *
   * @param theRoleStatus value  corresponds to role status
   *
   * @return True if given value corresponds to a known role status, false else.
   */
  public static boolean isRoleStatus(int theRoleStatus)
  {
    if(theRoleStatus < NO_ROLE_WITH_NAME ||
        theRoleStatus > REF_MBEAN_NOT_REGISTERED)
      return false;

    return true;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.