KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > jetty > JAASJettyPrincipal


1 /**
2  *
3  * Copyright 2004 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.jetty;
18
19 import java.security.Principal JavaDoc;
20 import java.util.Stack JavaDoc;
21 import javax.security.auth.Subject JavaDoc;
22
23
24 /**
25  * @version $Rev: 122776 $ $Date: 2004-12-19 11:11:07 -0800 (Sun, 19 Dec 2004) $
26  */

27 public class JAASJettyPrincipal implements Principal JavaDoc {
28     private final String JavaDoc name;
29     private Subject JavaDoc subject;
30     private final Stack JavaDoc stack = new Stack JavaDoc();
31
32     public JAASJettyPrincipal(String JavaDoc name) {
33         this.name = name;
34     }
35
36     public String JavaDoc getName() {
37         return name;
38     }
39
40     public Subject JavaDoc getSubject() {
41         return subject;
42     }
43
44     public void setSubject(Subject JavaDoc subject) {
45         this.subject = subject;
46     }
47
48     void push(Subject JavaDoc roleDesignate) {
49         stack.push(roleDesignate);
50     }
51
52     Subject JavaDoc pop() {
53         return (Subject JavaDoc) stack.pop();
54     }
55 }
56
Popular Tags