01: /*
02: * The contents of this file are subject to the Sapient Public License
03: * Version 1.0 (the "License"); you may not use this file except in compliance
04: * with the License. You may obtain a copy of the License at
05: * http://carbon.sf.net/License.html.
06: *
07: * Software distributed under the License is distributed on an "AS IS" basis,
08: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
09: * the specific language governing rights and limitations under the License.
10: *
11: * The Original Code is The Carbon Component Framework.
12: *
13: * The Initial Developer of the Original Code is Sapient Corporation
14: *
15: * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16: */
17:
18: package org.sape.carbon.services.security.management;
19:
20: import java.security.Principal;
21:
22: /**
23: * <p>
24: * Thrown when the manager is attempting to remove a principal that does
25: * not exist.
26: * </p>
27: *
28: * <p>
29: * Copyright 2002 Sapient
30: * </p>
31: *
32: * @author $Author: dvoet $ $Date: 2003/10/28 19:02:00 $
33: * @version $Revision: 1.8 $
34: *
35: * @stereotype exception
36: * @since carbon 1.0
37: */
38: public class UnknownPrincipalException extends
39: SecurityManagementException {
40: /**
41: * Constructor for DuplicatePrincipalException.
42: *
43: * @param sourceClass the source class of this exception
44: * @param principalName name of principal that could not be found
45: * @param message a message describing this failure
46: */
47: public UnknownPrincipalException(Class sourceClass,
48: String principalName) {
49: super (sourceClass, "Principal name: [" + principalName
50: + "] not found");
51: }
52:
53: /**
54: * Constructor for DuplicatePrincipalException.
55: *
56: * @param sourceClass the source class of this exception
57: * @param principal the principal that could not be found
58: * @param message a message describing this failure
59: */
60: public UnknownPrincipalException(Class sourceClass,
61: Principal principal) {
62: this (sourceClass, principal.getName());
63: }
64:
65: /**
66: * Constructor for DuplicatePrincipalException.
67: *
68: * @param sourceClass the source class of this exception
69: * @param principalName name of principal that could not be found
70: * @param message a message describing this failure
71: * @param cause the exception that caused this failure
72: */
73: public UnknownPrincipalException(Class sourceClass,
74: String principalName, Throwable cause) {
75: super (sourceClass, "Principal name: [" + principalName
76: + "] not found", cause);
77: }
78:
79: /**
80: * Constructor for DuplicatePrincipalException.
81: *
82: * @param sourceClass the source class of this exception
83: * @param principal the principal that could not be found
84: * @param message a message describing this failure
85: * @param cause the exception that caused this failure
86: */
87: public UnknownPrincipalException(Class sourceClass,
88: Principal principal, Throwable cause) {
89:
90: this(sourceClass, principal.getName(), cause);
91: }
92: }
|