01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package javax.management.relation;
23:
24: /**
25: * The problems that occur when resolving roles.
26: *
27: * @author <a href="mailto:Adrian.Brock@HappeningTimes.com">Adrian Brock</a>
28: * @version $Revision: 57200 $
29: */
30: public class RoleStatus {
31: // Attributes ----------------------------------------------------
32:
33: // Static --------------------------------------------------------
34:
35: /**
36: * Tried to set a role with less objects that minimum cardinality
37: */
38: public static final int LESS_THAN_MIN_ROLE_DEGREE = 4;
39:
40: /**
41: * Tried to set a role with more objects that maximum cardinality
42: */
43: public static final int MORE_THAN_MAX_ROLE_DEGREE = 5;
44:
45: /**
46: * Tried to use an unknown role
47: */
48: public static final int NO_ROLE_WITH_NAME = 1;
49:
50: /**
51: * Tried to use an an object name that is not registered
52: */
53: public static final int REF_MBEAN_NOT_REGISTERED = 7;
54:
55: /**
56: * Tried to use an an object name for an MBean with an incorrect class
57: */
58: public static final int REF_MBEAN_OF_INCORRECT_CLASS = 6;
59:
60: /**
61: * Tried to access a role that is not readable
62: */
63: public static final int ROLE_NOT_READABLE = 2;
64:
65: /**
66: * Tried to set a role that is not writable
67: */
68: public static final int ROLE_NOT_WRITABLE = 3;
69:
70: /**
71: * See if the passed integer is a valid problem type.
72: *
73: * @return true when it is, false otherwise.
74: */
75: public static boolean isRoleStatus(int problemType) {
76: return (problemType >= NO_ROLE_WITH_NAME && problemType <= REF_MBEAN_NOT_REGISTERED);
77: }
78:
79: // Constructors --------------------------------------------------
80:
81: // Public --------------------------------------------------------
82: }
|