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


java.lang.Object
   com.ecyrd.jspwiki.auth.UserManager

UserManager
final public class UserManager (Code)
Provides a facade for obtaining user information.
author:
   Janne Jalkanen
author:
   Andrew Jaquith
since:
   2.3

Inner Class :public static class DummyUserDatabase extends AbstractUserDatabase
Inner Class :public static class SaveUserProfileTask extends Task
Inner Class :final public class JSONUserModule implements RPCCallable

Field Summary
final protected static  StringFACT_SUBMITTER
    
final protected static  StringPREFS_EMAIL
    
final protected static  StringPREFS_FULL_NAME
    
final protected static  StringPREFS_LOGIN_NAME
    
final protected static  StringSAVED_PROFILE
    
final public static  StringSAVE_APPROVER
     Message key for the "save profile" message.
final protected static  StringSAVE_DECISION_MESSAGE_KEY
    
final protected static  StringSAVE_TASK_MESSAGE_KEY
    

Constructor Summary
public  UserManager()
     Constructs a new UserManager instance.

Method Summary
final public synchronized  voidaddWikiEventListener(WikiEventListener listener)
     Registers a WikiEventListener with this instance.
final protected  voidfireEvent(int type, WikiSession session, Object profile)
     Fires a WikiSecurityEvent of the provided type, Principal and target Object to all registered listeners.
final public  UserDatabasegetUserDatabase()
     Returns the UserDatabase employed by this WikiEngine.
final public  UserProfilegetUserProfile(WikiSession session)
    

Retrieves the com.ecyrd.jspwiki.auth.user.UserProfile for the user in a wiki session.

final public  voidinitialize(WikiEngine engine, Properties props)
     Initializes the engine for its nefarious purposes.
public  Principal[]listWikiNames()
    
final public  UserProfileparseProfile(WikiContext context)
    

Extracts user profile parameters from the HTTP request and populates a UserProfile with them.

final public synchronized  voidremoveWikiEventListener(WikiEventListener listener)
     Un-registers a WikiEventListener with this instance.
final public  voidsetUserProfile(WikiSession session, UserProfile profile)
    

Saves the com.ecyrd.jspwiki.auth.user.UserProfile for the user in a wiki session.

final public  voidvalidateProfile(WikiContext context, UserProfile profile)
     Validates a user profile, and appends any errors to the session errors list.

Field Detail
FACT_SUBMITTER
final protected static String FACT_SUBMITTER(Code)



PREFS_EMAIL
final protected static String PREFS_EMAIL(Code)



PREFS_FULL_NAME
final protected static String PREFS_FULL_NAME(Code)



PREFS_LOGIN_NAME
final protected static String PREFS_LOGIN_NAME(Code)



SAVED_PROFILE
final protected static String SAVED_PROFILE(Code)



SAVE_APPROVER
final public static String SAVE_APPROVER(Code)
Message key for the "save profile" message.



SAVE_DECISION_MESSAGE_KEY
final protected static String SAVE_DECISION_MESSAGE_KEY(Code)



SAVE_TASK_MESSAGE_KEY
final protected static String SAVE_TASK_MESSAGE_KEY(Code)




Constructor Detail
UserManager
public UserManager()(Code)
Constructs a new UserManager instance.




Method Detail
addWikiEventListener
final public synchronized void addWikiEventListener(WikiEventListener listener)(Code)
Registers a WikiEventListener with this instance. This is a convenience method.
Parameters:
  listener - the event listener



fireEvent
final protected void fireEvent(int type, WikiSession session, Object profile)(Code)
Fires a WikiSecurityEvent of the provided type, Principal and target Object to all registered listeners.
See Also:   com.ecyrd.jspwiki.event.WikiSecurityEvent
Parameters:
  type - the event type to be fired
Parameters:
  session - the wiki session supporting the event
Parameters:
  profile - the user profile (or array of user profiles), which may be null



getUserDatabase
final public UserDatabase getUserDatabase()(Code)
Returns the UserDatabase employed by this WikiEngine. The UserDatabase is lazily initialized by this method, if it does not exist yet. If the initialization fails, this method will use the inner class DummyUserDatabase as a default (which is enough to get JSPWiki running). the dummy user database
since:
   2.3



getUserProfile
final public UserProfile getUserProfile(WikiSession session)(Code)

Retrieves the com.ecyrd.jspwiki.auth.user.UserProfile for the user in a wiki session. If the user is authenticated, the UserProfile returned will be the one stored in the user database; if one does not exist, a new one will be initialized and returned. If the user is anonymous or asserted, the UserProfile will always be newly initialized to prevent spoofing of identities. If a UserProfile needs to be initialized, its com.ecyrd.jspwiki.auth.user.UserProfile.isNew method will return true, and its login name will will be set automatically if the user is authenticated. Note that this method does not modify the retrieved (or newly created) profile otherwise; other fields in the user profile may be null.

If a new UserProfile was created, but its com.ecyrd.jspwiki.auth.user.UserProfile.isNew method returns false, this method throws an IllegalStateException . This is meant as a quality check for UserDatabase providers; it should only be thrown if the implementation is faulty.


Parameters:
  session - the wiki session, which may not be null the user's profile, which will be newly initialized if the useris anonymous or asserted, or if the user cannot be found in the userdatabase



initialize
final public void initialize(WikiEngine engine, Properties props)(Code)
Initializes the engine for its nefarious purposes.
Parameters:
  engine - the current wiki engine
Parameters:
  props - the wiki engine initialization properties



listWikiNames
public Principal[] listWikiNames() throws WikiSecurityException(Code)



parseProfile
final public UserProfile parseProfile(WikiContext context)(Code)

Extracts user profile parameters from the HTTP request and populates a UserProfile with them. The UserProfile will either be a copy of the user's existing profile (if one can be found), or a new profile (if not). The rules for populating the profile as as follows:

  • If the email or password parameter values differ from those in the existing profile, the passed parameters override the old values.
  • For new profiles, the user-supplied fullname
  • In all cases, the created/last modified timestamps of the user's existing or new profile always override whatever values the user supplied.
  • If container authentication is used, the login name property of the profile is set to the name of com.ecyrd.jspwiki.WikiSession.getLoginPrincipal . Otherwise, the value of the loginname parameter is used.

Parameters:
  context - the current wiki context a new, populated user profile



removeWikiEventListener
final public synchronized void removeWikiEventListener(WikiEventListener listener)(Code)
Un-registers a WikiEventListener with this instance. This is a convenience method.
Parameters:
  listener - the event listener



setUserProfile
final public void setUserProfile(WikiSession session, UserProfile profile) throws DuplicateUserException, WikiException(Code)

Saves the com.ecyrd.jspwiki.auth.user.UserProfile for the user in a wiki session. This method verifies that a user profile to be saved doesn't collide with existing profiles; that is, the login name or full name is already used by another profile. If the profile collides, a DuplicateUserException is thrown. After saving the profile, the user database changes are committed, and the user's credential set is refreshed; if custom authentication is used, this means the user will be automatically be logged in.

When the user's profile is saved succcessfully, this method fires a WikiSecurityEvent.PROFILE_SAVE event with the WikiSession as the source and the UserProfile as target. For existing profiles, if the user's full name changes, this method also fires a "name changed" event ( WikiSecurityEvent.PROFILE_NAME_CHANGED ) with the WikiSession as the source and an array containing the old and new UserProfiles, respectively. The NAME_CHANGED event allows the GroupManager and PageManager can change group memberships and ACLs if needed.

Note that WikiSessions normally attach event listeners to the UserManager, so changes to the profile will automatically cause the correct Principals to be reloaded into the current WikiSession's Subject.


Parameters:
  session - the wiki session, which may not be null
Parameters:
  profile - the user profile, which may not be null
throws:
  DuplicateUserException - if the proposed profile's login name or full name collides with another
throws:
  WikiException - if the save fails for some reason. If the current user does not havepermission to save the profile, this will be a com.ecyrd.jspwiki.auth.WikiSecurityException;if if the user profile must be approved before it can be saved, it will be acom.ecyrd.jspwiki.workflow.DecisionRequiredException. All other WikiExceptionindicate a condition that is not normal is probably due to mis-configuration



validateProfile
final public void validateProfile(WikiContext context, UserProfile profile)(Code)
Validates a user profile, and appends any errors to the session errors list. If the profile is new, the password will be checked to make sure it isn't null. Otherwise, the password is checked for length and that it matches the value of the 'password2' HTTP parameter. Note that we have a special case when container-managed authentication is used and the user is not authenticated; this will always cause validation to fail. Any validation errors are added to the wiki session's messages collection (see WikiSession.getMessages .
Parameters:
  context - the current wiki context
Parameters:
  profile - the supplied UserProfile



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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