KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > security > auth > weblogic61 > WeblogicCarbonUser


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.auth.weblogic61;
19
20 import java.security.Principal JavaDoc;
21
22 import weblogic.security.acl.BasicRealm;
23 import weblogic.security.acl.User;
24
25 /**
26  * Weblogic Wrapper Object around a standard
27  * <code>java.security.Principal</code>.
28  * <p>
29  * The Weblogic SPI has it's own version of a user that must be returned,
30  * so this object wraps the standard java implementation of Principal in
31  * the Weblogic specific API.
32  * </p>
33  *
34  * @see java.security.Principal
35  * @author $Author: dvoet $ $Date: 2003/05/05 21:21:34 $
36  * @version $Revision: 1.4 $
37  *
38  * @since carbon 1.2
39  */

40 public class WeblogicCarbonUser extends User {
41     /** Holds the realm this group is a part of. */
42     protected WeblogicCarbonRealm realm;
43
44     /** Holds the user this is adapting to. */
45     protected Principal JavaDoc principal;
46
47     /**
48      * Constructs a new Weblogic specific user in a realm wrapping
49      * a standard principal object.
50      *
51      * @param principal the principal to wrap
52      * @param realm the weblogic realm this user belongs to
53      */

54     WeblogicCarbonUser(Principal JavaDoc principal, WeblogicCarbonRealm realm) {
55         // Call base constructor class passing in the name of the
56
// User
57
super(principal.getName());
58
59         // Keep track of this User's realm
60
this.realm = realm;
61
62         this.principal = principal;
63     }
64
65     /**
66      * Returns the Realm associated with this group object.
67      *
68      * @return the realm associated with this objectfs
69      */

70     public BasicRealm getRealm() {
71         return realm;
72     }
73 }
Popular Tags