KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > security > AbstractSecurityContext


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.security;
24
25 import java.security.Principal JavaDoc;
26 import javax.security.auth.Subject JavaDoc;
27
28 /**
29  * This base class defines the methods that Security Context should exhibit.
30  * There are two places where a derived class are used. They are on the
31  * appclient side and ejb side. The derived classes can use thread local
32  * storage to store the security contexts.
33  *
34  * @author Harpreet Singh
35  */

36 public abstract class AbstractSecurityContext implements java.io.Serializable JavaDoc {
37     // the principal that this security context represents.
38
protected Principal JavaDoc initiator = null;
39     protected Subject JavaDoc subject = null;
40     
41     /**
42      * This method should be implemented by the subclasses to
43      * return the caller principal. This information may be redundant
44      * since the same information can be inferred by inspecting the
45      * Credentials of the caller.
46      * @return The caller Principal.
47      */

48     abstract public Principal JavaDoc getCallerPrincipal();
49     
50     /**
51      * This method should be implemented by the subclasses to return
52      * the Credentials of the caller principal.
53      * @return A credentials object associated with the current client
54      * invocation.
55      */

56     abstract public Subject JavaDoc getSubject();
57 }
58
59
60
61
62
63
64
65
Popular Tags