Source Code Cross Referenced for UserManager.java in  » Project-Management » turbine » org » apache » turbine » services » security » 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 » Project Management » turbine » org.apache.turbine.services.security 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.turbine.services.security;
002:
003:        /*
004:         * Copyright 2001-2005 The Apache Software Foundation.
005:         *
006:         * Licensed under the Apache License, Version 2.0 (the "License")
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         *
010:         *     http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */
018:
019:        import java.util.List;
020:
021:        import org.apache.commons.configuration.Configuration;
022:
023:        import org.apache.torque.util.Criteria;
024:
025:        import org.apache.turbine.om.security.User;
026:        import org.apache.turbine.services.InitializationException;
027:        import org.apache.turbine.util.security.DataBackendException;
028:        import org.apache.turbine.util.security.EntityExistsException;
029:        import org.apache.turbine.util.security.PasswordMismatchException;
030:        import org.apache.turbine.util.security.UnknownEntityException;
031:
032:        /**
033:         * An UserManager performs {@link org.apache.turbine.om.security.User} objects
034:         * related tasks on behalf of the
035:         * {@link org.apache.turbine.services.security.BaseSecurityService}.
036:         *
037:         * The responsibilities of this class include loading data of an user from the
038:         * storage and putting them into the
039:         * {@link org.apache.turbine.om.security.User} objects, saving those data
040:         * to the permanent storage, and authenticating users.
041:         *
042:         * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
043:         * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
044:         * @version $Id: UserManager.java 264152 2005-08-29 14:50:22Z henning $
045:         */
046:        public interface UserManager {
047:            /**
048:             * Initializes the UserManager
049:             *
050:             * @param conf A Configuration object to init this Manager
051:             *
052:             * @throws InitializationException When something went wrong.
053:             */
054:            void init(Configuration conf) throws InitializationException;
055:
056:            /**
057:             * Check whether a specified user's account exists.
058:             *
059:             * The login name is used for looking up the account.
060:             *
061:             * @param user The user to be checked.
062:             * @return true if the specified account exists
063:             * @throws DataBackendException if there was an error accessing the data
064:             *         backend.
065:             */
066:            boolean accountExists(User user) throws DataBackendException;
067:
068:            /**
069:             * Check whether a specified user's account exists.
070:             *
071:             * The login name is used for looking up the account.
072:             *
073:             * @param userName The name of the user to be checked.
074:             * @return true if the specified account exists
075:             * @throws DataBackendException if there was an error accessing the data
076:             *         backend.
077:             */
078:            boolean accountExists(String userName) throws DataBackendException;
079:
080:            /**
081:             * Retrieve a user from persistent storage using username as the
082:             * key.
083:             *
084:             * @param username the name of the user.
085:             * @return an User object.
086:             * @throws UnknownEntityException if the user's record does not
087:             *         exist in the database.
088:             * @throws DataBackendException if there is a problem accessing the
089:             *         storage.
090:             */
091:            User retrieve(String username) throws UnknownEntityException,
092:                    DataBackendException;
093:
094:            /**
095:             * Retrieve a user from persistent storage using the primary key
096:             *
097:             * @param key The primary key object
098:             * @return an User object.
099:             * @throws UnknownEntityException if the user's record does not
100:             *         exist in the database.
101:             * @throws DataBackendException if there is a problem accessing the
102:             *         storage.
103:             */
104:            User retrieveById(Object key) throws UnknownEntityException,
105:                    DataBackendException;
106:
107:            /**
108:             * Retrieve a set of users that meet the specified criteria.
109:             *
110:             * As the keys for the criteria, you should use the constants that
111:             * are defined in {@link User} interface, plus the names
112:             * of the custom attributes you added to your user representation
113:             * in the data storage. Use verbatim names of the attributes -
114:             * without table name prefix in case of DB implementation.
115:             *
116:             * @param criteria The criteria of selection.
117:             * @return a List of users meeting the criteria.
118:             * @throws DataBackendException if there is a problem accessing the
119:             *         storage.
120:             * @deprecated Use retrieveList(Criteria crit)
121:             */
122:            User[] retrieve(Criteria criteria) throws DataBackendException;
123:
124:            /**
125:             * Retrieve a list of users that meet the specified criteria.
126:             *
127:             * As the keys for the criteria, you should use the constants that
128:             * are defined in {@link User} interface, plus the names
129:             * of the custom attributes you added to your user representation
130:             * in the data storage. Use verbatim names of the attributes -
131:             * without table name prefix in case of DB implementation.
132:             *
133:             * @param criteria The criteria of selection.
134:             * @return a List of users meeting the criteria.
135:             * @throws DataBackendException if there is a problem accessing the
136:             *         storage.
137:             */
138:            List retrieveList(Criteria criteria) throws DataBackendException;
139:
140:            /**
141:             * Retrieve a user from persistent storage using username as the
142:             * key, and authenticate the user. The implementation may chose
143:             * to authenticate to the server as the user whose data is being
144:             * retrieved.
145:             *
146:             * @param username the name of the user.
147:             * @param password the user supplied password.
148:             * @return an User object.
149:             * @throws PasswordMismatchException if the supplied password was incorrect.
150:             * @throws UnknownEntityException if the user's record does not
151:             *         exist in the database.
152:             * @throws DataBackendException if there is a problem accessing the storage.
153:             */
154:            User retrieve(String username, String password)
155:                    throws PasswordMismatchException, UnknownEntityException,
156:                    DataBackendException;
157:
158:            /**
159:             * Save an User object to persistent storage. User's record is
160:             * required to exist in the storage.
161:             *
162:             * @param user an User object to store.
163:             * @throws UnknownEntityException if the user's record does not
164:             *         exist in the database.
165:             * @throws DataBackendException if there is a problem accessing the storage.
166:             */
167:            void store(User user) throws UnknownEntityException,
168:                    DataBackendException;
169:
170:            /**
171:             * Saves User data when the session is unbound. The user account is required
172:             * to exist in the storage.
173:             *
174:             * LastLogin, AccessCounter, persistent pull tools, and any data stored
175:             * in the permData hashtable that is not mapped to a column will be saved.
176:             *
177:             * @exception UnknownEntityException if the user's account does not
178:             *            exist in the database.
179:             * @exception DataBackendException if there is a problem accessing the
180:             *            storage.
181:             */
182:            void saveOnSessionUnbind(User user) throws UnknownEntityException,
183:                    DataBackendException;
184:
185:            /**
186:             * Authenticate an User with the specified password. If authentication
187:             * is successful the method returns nothing. If there are any problems,
188:             * exception was thrown.
189:             *
190:             * @param user an User object to authenticate.
191:             * @param password the user supplied password.
192:             * @throws PasswordMismatchException if the supplied password was incorrect.
193:             * @throws UnknownEntityException if the user's record does not
194:             *         exist in the database.
195:             * @throws DataBackendException if there is a problem accessing the storage.
196:             */
197:            void authenticate(User user, String password)
198:                    throws PasswordMismatchException, UnknownEntityException,
199:                    DataBackendException;
200:
201:            /**
202:             * Creates new user account with specified attributes.
203:             *
204:             * @param user the object describing account to be created.
205:             * @param initialPassword password for the new user
206:             * @throws DataBackendException if there was an error accessing the data
207:             *         backend.
208:             * @throws EntityExistsException if the user account already exists.
209:             */
210:            void createAccount(User user, String initialPassword)
211:                    throws EntityExistsException, DataBackendException;
212:
213:            /**
214:             * Removes an user account from the system.
215:             *
216:             * @param user the object describing the account to be removed.
217:             * @throws DataBackendException if there was an error accessing the data
218:             *         backend.
219:             * @throws UnknownEntityException if the user account is not present.
220:             */
221:            void removeAccount(User user) throws UnknownEntityException,
222:                    DataBackendException;
223:
224:            /**
225:             * Change the password for an User.
226:             *
227:             * @param user an User to change password for.
228:             * @param oldPassword the current password suplied by the user.
229:             * @param newPassword the current password requested by the user.
230:             * @throws PasswordMismatchException if the supplied password was incorrect.
231:             * @throws UnknownEntityException if the user's record does not
232:             *         exist in the database.
233:             * @throws DataBackendException if there is a problem accessing the storage.
234:             */
235:            void changePassword(User user, String oldPassword,
236:                    String newPassword) throws PasswordMismatchException,
237:                    UnknownEntityException, DataBackendException;
238:
239:            /**
240:             * Forcibly sets new password for an User.
241:             *
242:             * This is supposed by the administrator to change the forgotten or
243:             * compromised passwords. Certain implementatations of this feature
244:             * would require administrative level access to the authenticating
245:             * server / program.
246:             *
247:             * @param user an User to change password for.
248:             * @param password the new password.
249:             * @throws UnknownEntityException if the user's record does not
250:             *            exist in the database.
251:             * @throws DataBackendException if there is a problem accessing the storage.
252:             */
253:            void forcePassword(User user, String password)
254:                    throws UnknownEntityException, DataBackendException;
255:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.