01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.core.security;
19:
20: import de.finix.contelligent.exception.ContelligentRuntimeException;
21:
22: /**
23: * This exception is thrown if an object of type {@link Principal} is neither of
24: * type {@link User} nor {@link Role}. For example
25: * {@link AccessControlList#addOwner} throws this if the 2nd parameter principal
26: * cannot be cast to User or to Role. <BR>
27: *
28: * This should normally never happen but better be careful ... (and we need an
29: * alternative in the 'if (instanceof) ...' clause)
30: */
31: public class PrincipalTypeException extends
32: ContelligentRuntimeException {
33:
34: /**
35: * Creates a new <code>PrincipalTypeException</code> instance with the
36: * given String as additional message and with a nested
37: * <code>Throwable</code> object.
38: *
39: * @param message
40: * a non-null <code>String</code> value
41: * @param t
42: * a <code>Throwable</code> value
43: */
44: public PrincipalTypeException(String message, Throwable t) {
45: super (message, t);
46: }
47:
48: /**
49: * Creates a new <code>PrincipalTypeException</code> instance with the
50: * given String as additional message.
51: *
52: * @param message
53: * a non-null <code>String</code> value
54: */
55: public PrincipalTypeException(String message) {
56: super(message);
57: }
58:
59: }
|