KickJava   Java API By Example, From Geeks To Geeks.

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


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

27
28
29 package org.apache.coyote.tomcat5;
30
31 import java.security.Principal JavaDoc;
32
33 /**
34  * Generic implementation of <strong>java.security.Principal</strong> that
35  * is used to represent principals authenticated at the protocol handler level.
36  *
37  * @author Remy Maucherat
38  * @version $Revision: 1.2 $ $Date: 2005/12/08 01:28:34 $
39  */

40
41 public class CoyotePrincipal
42     implements Principal JavaDoc {
43
44
45     // ----------------------------------------------------------- Constructors
46

47
48     public CoyotePrincipal(String JavaDoc name) {
49
50         this.name = name;
51
52     }
53
54
55     // ------------------------------------------------------------- Properties
56

57
58     /**
59      * The username of the user represented by this Principal.
60      */

61     protected String JavaDoc name = null;
62
63     public String JavaDoc getName() {
64         return (this.name);
65     }
66
67
68     // --------------------------------------------------------- Public Methods
69

70
71     /**
72      * Return a String representation of this object, which exposes only
73      * information that should be public.
74      */

75     public String JavaDoc toString() {
76
77         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("CoyotePrincipal[");
78         sb.append(this.name);
79         sb.append("]");
80         return (sb.toString());
81
82     }
83
84
85 }
86
Popular Tags