KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > security > management > UnknownPrincipalException


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * 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 JavaDoc;
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 SecurityManagementException {
39     /**
40      * Constructor for DuplicatePrincipalException.
41      *
42      * @param sourceClass the source class of this exception
43      * @param principalName name of principal that could not be found
44      * @param message a message describing this failure
45      */

46     public UnknownPrincipalException(
47         Class JavaDoc sourceClass, String JavaDoc principalName) {
48         super(
49             sourceClass, "Principal name: ["
50             + principalName
51             + "] not found");
52     }
53
54     /**
55      * Constructor for DuplicatePrincipalException.
56      *
57      * @param sourceClass the source class of this exception
58      * @param principal the principal that could not be found
59      * @param message a message describing this failure
60      */

61     public UnknownPrincipalException(
62         Class JavaDoc sourceClass, Principal JavaDoc principal) {
63         this(sourceClass, principal.getName());
64     }
65
66     /**
67      * Constructor for DuplicatePrincipalException.
68      *
69      * @param sourceClass the source class of this exception
70      * @param principalName name of principal that could not be found
71      * @param message a message describing this failure
72      * @param cause the exception that caused this failure
73      */

74     public UnknownPrincipalException(
75         Class JavaDoc sourceClass, String JavaDoc principalName, Throwable JavaDoc cause) {
76         super(
77             sourceClass, "Principal name: ["
78             + principalName
79             + "] not found",
80             cause);
81     }
82
83     /**
84      * Constructor for DuplicatePrincipalException.
85      *
86      * @param sourceClass the source class of this exception
87      * @param principal the principal that could not be found
88      * @param message a message describing this failure
89      * @param cause the exception that caused this failure
90      */

91     public UnknownPrincipalException(Class JavaDoc sourceClass,
92             Principal JavaDoc principal, Throwable JavaDoc cause) {
93
94         this(sourceClass, principal.getName(), cause);
95     }
96 }
97
Popular Tags