Source Code Cross Referenced for AbstractUser.java in  » Sevlet-Container » tomcat-catalina » org » apache » catalina » users » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » tomcat catalina » org.apache.catalina.users 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002,2004 The Apache Software Foundation.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.apache.catalina.users;
018:
019:        import java.util.Iterator;
020:        import org.apache.catalina.Group;
021:        import org.apache.catalina.Role;
022:        import org.apache.catalina.User;
023:
024:        /**
025:         * <p>Convenience base class for {@link User} implementations.</p>
026:         *
027:         * @author Craig R. McClanahan
028:         * @version $Revision: 1.2 $ $Date: 2004/02/27 14:58:50 $
029:         * @since 4.1
030:         */
031:
032:        public abstract class AbstractUser implements  User {
033:
034:            // ----------------------------------------------------- Instance Variables
035:
036:            /**
037:             * The full name of this user.
038:             */
039:            protected String fullName = null;
040:
041:            /**
042:             * The logon password of this user.
043:             */
044:            protected String password = null;
045:
046:            /**
047:             * The logon username of this user.
048:             */
049:            protected String username = null;
050:
051:            // ------------------------------------------------------------- Properties
052:
053:            /**
054:             * Return the full name of this user.
055:             */
056:            public String getFullName() {
057:
058:                return (this .fullName);
059:
060:            }
061:
062:            /**
063:             * Set the full name of this user.
064:             *
065:             * @param fullName The new full name
066:             */
067:            public void setFullName(String fullName) {
068:
069:                this .fullName = fullName;
070:
071:            }
072:
073:            /**
074:             * Return the set of {@link Group}s to which this user belongs.
075:             */
076:            public abstract Iterator getGroups();
077:
078:            /**
079:             * Return the logon password of this user, optionally prefixed with the
080:             * identifier of an encoding scheme surrounded by curly braces, such as
081:             * <code>{md5}xxxxx</code>.
082:             */
083:            public String getPassword() {
084:
085:                return (this .password);
086:
087:            }
088:
089:            /**
090:             * Set the logon password of this user, optionally prefixed with the
091:             * identifier of an encoding scheme surrounded by curly braces, such as
092:             * <code>{md5}xxxxx</code>.
093:             *
094:             * @param password The new logon password
095:             */
096:            public void setPassword(String password) {
097:
098:                this .password = password;
099:
100:            }
101:
102:            /**
103:             * Return the set of {@link Role}s assigned specifically to this user.
104:             */
105:            public abstract Iterator getRoles();
106:
107:            /**
108:             * Return the logon username of this user, which must be unique
109:             * within the scope of a {@link UserDatabase}.
110:             */
111:            public String getUsername() {
112:
113:                return (this .username);
114:
115:            }
116:
117:            /**
118:             * Set the logon username of this user, which must be unique within
119:             * the scope of a {@link UserDatabase}.
120:             *
121:             * @param username The new logon username
122:             */
123:            public void setUsername(String username) {
124:
125:                this .username = username;
126:
127:            }
128:
129:            // --------------------------------------------------------- Public Methods
130:
131:            /**
132:             * Add a new {@link Group} to those this user belongs to.
133:             *
134:             * @param group The new group
135:             */
136:            public abstract void addGroup(Group group);
137:
138:            /**
139:             * Add a new {@link Role} to those assigned specifically to this user.
140:             *
141:             * @param role The new role
142:             */
143:            public abstract void addRole(Role role);
144:
145:            /**
146:             * Is this user in the specified {@link Group}?
147:             *
148:             * @param group The group to check
149:             */
150:            public abstract boolean isInGroup(Group group);
151:
152:            /**
153:             * Is this user specifically assigned the specified {@link Role}?  This
154:             * method does <strong>NOT</strong> check for roles inherited based on
155:             * {@link Group} membership.
156:             *
157:             * @param role The role to check
158:             */
159:            public abstract boolean isInRole(Role role);
160:
161:            /**
162:             * Remove a {@link Group} from those this user belongs to.
163:             *
164:             * @param group The old group
165:             */
166:            public abstract void removeGroup(Group group);
167:
168:            /**
169:             * Remove all {@link Group}s from those this user belongs to.
170:             */
171:            public abstract void removeGroups();
172:
173:            /**
174:             * Remove a {@link Role} from those assigned to this user.
175:             *
176:             * @param role The old role
177:             */
178:            public abstract void removeRole(Role role);
179:
180:            /**
181:             * Remove all {@link Role}s from those assigned to this user.
182:             */
183:            public abstract void removeRoles();
184:
185:            // ------------------------------------------------------ Principal Methods
186:
187:            /**
188:             * Make the principal name the same as the group name.
189:             */
190:            public String getName() {
191:
192:                return (getUsername());
193:
194:            }
195:
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.