01: /*
02: * Copyright 1999-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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;
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 implements Principal {
30:
31: // ----------------------------------------------------------- Constructors
32:
33: public CoyotePrincipal(String name) {
34:
35: this .name = name;
36:
37: }
38:
39: // ------------------------------------------------------------- Properties
40:
41: /**
42: * The username of the user represented by this Principal.
43: */
44: protected String name = null;
45:
46: public String getName() {
47: return (this .name);
48: }
49:
50: // --------------------------------------------------------- Public Methods
51:
52: /**
53: * Return a String representation of this object, which exposes only
54: * information that should be public.
55: */
56: public String toString() {
57:
58: StringBuffer sb = new StringBuffer("CoyotePrincipal[");
59: sb.append(this .name);
60: sb.append("]");
61: return (sb.toString());
62:
63: }
64:
65: }
|