KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Thrown when the manager is attempting to add a principal that already
24  * exists.
25  *
26  * <p>
27  * Copyright 2002 Sapient
28  * </p>
29  *
30  * @author $Author: dvoet $ $Date: 2003/10/28 19:02:00 $
31  * @version $Revision: 1.8 $
32  *
33  * @stereotype exception
34  * @since carbon 1.2
35  */

36 public class DuplicatePrincipalException extends SecurityManagementException {
37     /**
38      * Constructor for DuplicatePrincipalException.
39      *
40      * @param sourceClass the source class of this exception
41      * @param principal principal object which already exists
42      * @param message a message describing this failure
43      */

44     public DuplicatePrincipalException(
45         Class JavaDoc sourceClass, Principal JavaDoc principal) {
46         super(
47             sourceClass,
48             "Principal name: [" + principal.getName() + "] already exists");
49     }
50
51     /**
52      * Constructor for DuplicatePrincipalException.
53      *
54      * @param sourceClass the source class of this exception
55      * @param principal principal object which already exists
56      * @param message a message describing this failure
57      * @param cause the exception that caused this failure
58      */

59     public DuplicatePrincipalException(Class JavaDoc sourceClass,
60             Principal JavaDoc principal, Throwable JavaDoc cause) {
61
62         super(
63             sourceClass,
64             "Principal name: [" + principal.getName() + "] already exists",
65             cause);
66     }
67 }
68
Popular Tags