Java Doc for UserDatabase.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » auth » user » 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 » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.auth.user 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.ecyrd.jspwiki.auth.user.UserDatabase

All known Subclasses:   com.ecyrd.jspwiki.auth.user.AbstractUserDatabase,
UserDatabase
public interface UserDatabase (Code)
Defines an interface for loading, persisting and storing users.
author:
   Janne Jalkanen
author:
   Andrew Jaquith
since:
   2.3




Method Summary
public  voidcommit()
     No-op method that in previous versions of JSPWiki was intended to atomically commit changes to the user database.
public  voiddeleteByLoginName(String loginName)
     Looks up and deletes the first UserProfile in the user database that matches a profile having a given login name.
public  UserProfilefind(String index)
     Looks up and returns the first UserProfile in the user database that whose login name, full name, or wiki name matches the supplied string.
public  UserProfilefindByEmail(String index)
     Looks up and returns the first UserProfile in the user database that matches a profile having a given e-mail address.
public  UserProfilefindByFullName(String index)
     Looks up and returns the first UserProfile in the user database that matches a profile having a given full name.
public  UserProfilefindByLoginName(String index)
     Looks up and returns the first UserProfile in the user database that matches a profile having a given login name.
public  UserProfilefindByWikiName(String index)
     Looks up and returns the first UserProfile in the user database that matches a profile having a given wiki name.
public  Principal[]getPrincipals(String identifier)
    

Looks up the Principals representing a user from the user database.

public  Principal[]getWikiNames()
     Returns all WikiNames that are stored in the UserDatabase as an array of Principal objects.
public  voidinitialize(WikiEngine engine, Properties props)
     Initializes the user database based on values from a Properties object.
public  booleanisSharedWithContainer()
     Returns true if this user database shares user/password data with the web container; false otherwise.
public  UserProfilenewProfile()
     Factory method that instantiates a new user profile.
public  voidrename(String loginName, String newName)
    

Renames a UserProfile in the user database by changing the profile's login name.

public  voidsave(UserProfile profile)
    

Saves a UserProfile to the user database, overwriting the existing profile if it exists.

public  booleanvalidatePassword(String loginName, String password)
     Determines whether a supplied user password is valid, given a login name and password.



Method Detail
commit
public void commit() throws WikiSecurityException(Code)
No-op method that in previous versions of JSPWiki was intended to atomically commit changes to the user database. Now, the UserDatabase.rename(String,String) , UserDatabase.save(UserProfile) and UserDatabase.deleteByLoginName(String) methods are atomic themselves.
throws:
  WikiSecurityException -



deleteByLoginName
public void deleteByLoginName(String loginName) throws NoSuchPrincipalException, WikiSecurityException(Code)
Looks up and deletes the first UserProfile in the user database that matches a profile having a given login name. If the user database does not contain a user with a matching attribute, throws a NoSuchPrincipalException . This method is intended to be atomic; results cannot be partially committed. If the commit fails, it should roll back its state appropriately. Implementing classes that persist to the file system may wish to make this method synchronized.
Parameters:
  loginName - the login name of the user profile that shall be deleted



find
public UserProfile find(String index) throws NoSuchPrincipalException(Code)
Looks up and returns the first UserProfile in the user database that whose login name, full name, or wiki name matches the supplied string. This method provides a "forgiving" search algorithm for resolving Principal names when the exact profile attribute that supplied the name is unknown.
Parameters:
  index - the login name, full name, or wiki name



findByEmail
public UserProfile findByEmail(String index) throws NoSuchPrincipalException(Code)
Looks up and returns the first UserProfile in the user database that matches a profile having a given e-mail address. If the user database does not contain a user with a matching attribute, throws a NoSuchPrincipalException .
Parameters:
  index - the e-mail address of the desired user profile the user profile



findByFullName
public UserProfile findByFullName(String index) throws NoSuchPrincipalException(Code)
Looks up and returns the first UserProfile in the user database that matches a profile having a given full name. If the user database does not contain a user with a matching attribute, throws a NoSuchPrincipalException .
Parameters:
  index - the fill name of the desired user profile the user profile



findByLoginName
public UserProfile findByLoginName(String index) throws NoSuchPrincipalException(Code)
Looks up and returns the first UserProfile in the user database that matches a profile having a given login name. If the user database does not contain a user with a matching attribute, throws a NoSuchPrincipalException .
Parameters:
  index - the login name of the desired user profile the user profile



findByWikiName
public UserProfile findByWikiName(String index) throws NoSuchPrincipalException(Code)
Looks up and returns the first UserProfile in the user database that matches a profile having a given wiki name. If the user database does not contain a user with a matching attribute, throws a NoSuchPrincipalException .
Parameters:
  index - the wiki name of the desired user profile the user profile



getPrincipals
public Principal[] getPrincipals(String identifier) throws NoSuchPrincipalException(Code)

Looks up the Principals representing a user from the user database. These are defined as a set of Principals manufactured from the login name, full name, and wiki name. The order of the Principals returned is not significant. If the user database does not contain a user with the supplied identifier, throws a NoSuchPrincipalException .

Note that if an implememtation wishes to mark one of the returned Principals as representing the user's common name, it should instantiate this Principal using com.ecyrd.jspwiki.auth.WikiPrincipal.WikiPrincipal(StringString) with the type parameter set to com.ecyrd.jspwiki.auth.WikiPrincipal.WIKI_NAME . The method com.ecyrd.jspwiki.WikiSession.getUserPrincipal will return this principal as the "primary" principal. Note that this method can also be used to mark a WikiPrincipal as a login name or a wiki name.


Parameters:
  identifier - the name of the user to retrieve; this corresponds tovalue returned by the user profile'sUserProfile.getLoginName method. the array of Principals representing the user's identities



getWikiNames
public Principal[] getWikiNames() throws WikiSecurityException(Code)
Returns all WikiNames that are stored in the UserDatabase as an array of Principal objects. If the database does not contain any profiles, this method will return a zero-length array. the WikiNames



initialize
public void initialize(WikiEngine engine, Properties props) throws NoRequiredPropertyException(Code)
Initializes the user database based on values from a Properties object.



isSharedWithContainer
public boolean isSharedWithContainer()(Code)
Returns true if this user database shares user/password data with the web container; false otherwise. the result



newProfile
public UserProfile newProfile()(Code)
Factory method that instantiates a new user profile. The UserProfile.isNew method of profiles created using this method should return true.



rename
public void rename(String loginName, String newName) throws NoSuchPrincipalException, DuplicateUserException, WikiSecurityException(Code)

Renames a UserProfile in the user database by changing the profile's login name. Because the login name is the profile's unique identifier, implementations should verify that the identifier is "safe" to change before actually changing it. Specifically: the profile with the supplied login name must already exist, and the proposed new name must not be in use by another profile.

This method is intended to be atomic; results cannot be partially committed. If the commit fails, it should roll back its state appropriately. Implementing classes that persist to the file system may wish to make this method synchronized.


Parameters:
  loginName - the existing login name for the profile
Parameters:
  newName - the proposed new login name
throws:
  NoSuchPrincipalException - if the user profile identified byloginName does not exist
throws:
  DuplicateUserException - if another user profile with theproposed new login name already exists
throws:
  WikiSecurityException - if the profile cannot be renamed forany reason, such as an I/O error, database connection failureor lack of support for renames.



save
public void save(UserProfile profile) throws WikiSecurityException(Code)

Saves a UserProfile to the user database, overwriting the existing profile if it exists. The user name under which the profile should be saved is returned by the supplied profile's UserProfile.getLoginName method.

The database implementation is responsible for detecting potential duplicate user profiles; specifically, the login name, wiki name, and full name must be unique. The implementation is not required to check for validity of passwords or e-mail addresses. Special case: if the profile already exists and the password is null, it should retain its previous value, rather than being set to null.

Implementations are required to time-stamp the creation or modification fields of the UserProfile./p>

This method is intended to be atomic; results cannot be partially committed. If the commit fails, it should roll back its state appropriately. Implementing classes that persist to the file system may wish to make this method synchronized.


Parameters:
  profile - the user profile to save
throws:
  WikiSecurityException - if the profile cannot be saved



validatePassword
public boolean validatePassword(String loginName, String password)(Code)
Determines whether a supplied user password is valid, given a login name and password. It is up to the implementing class to determine how the comparison should be made. For example, the password might be hashed before comparing it to the value persisted in the back-end data store.
Parameters:
  loginName - the login name
Parameters:
  password - the password true if the password is valid, falseotherwise



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.