KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > coyote > tomcat4 > CoyotePrincipal


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

16
17 package org.apache.coyote.tomcat4;
18
19 import java.security.Principal JavaDoc;
20
21 /**
22  * Generic implementation of <strong>java.security.Principal</strong> that
23  * is used to represent principals authenticated at the protocol handler level.
24  *
25  * @author Remy Maucherat
26  * @version $Revision: 1.2 $ $Date: 2004/02/24 08:54:29 $
27  */

28
29 public class CoyotePrincipal
30     implements Principal JavaDoc {
31
32
33     // ----------------------------------------------------------- Constructors
34

35
36     public CoyotePrincipal(String JavaDoc name) {
37
38         this.name = name;
39
40     }
41
42
43     // ------------------------------------------------------------- Properties
44

45
46     /**
47      * The username of the user represented by this Principal.
48      */

49     protected String JavaDoc name = null;
50
51     public String JavaDoc getName() {
52         return (this.name);
53     }
54
55
56     // --------------------------------------------------------- Public Methods
57

58
59     /**
60      * Return a String representation of this object, which exposes only
61      * information that should be public.
62      */

63     public String JavaDoc toString() {
64
65         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("CoyotePrincipal[");
66         sb.append(this.name);
67         sb.append("]");
68         return (sb.toString());
69
70     }
71
72
73 }
74
Popular Tags