com.opensymphony.user
Class UserManager

java.lang.Object
  extended bycom.opensymphony.user.UserManager
All Implemented Interfaces:
java.io.Serializable

public final class UserManager
extends java.lang.Object
implements java.io.Serializable

The UserManager is the entry point to user-management. UserManager is a singleton and retrieved with getInstance();

Author:
Joe Walnes, Mike Cannon-Brookes
See Also:
Serialized Form

Nested Class Summary
 class UserManager.Accessor
          UserManager.Accessor is a gateway that can be passed from the UserManager to any other object that allows priveleged callbacks.
 
Constructor Summary
UserManager()
          Don't use this constructor most of the time.
UserManager(java.lang.String filename)
           
 
Method Summary
 void addProvider(UserProvider provider)
          Add a new UserProvider to UserManager.
 Group createGroup(java.lang.String name)
          Create a new Group with given name.
 User createUser(java.lang.String name)
          Create a new User with given name.
 void flushCaches()
          This method will flush all of the provider caches (if they are caching).
 java.util.Collection getAccessProviders()
          Get the current AccessProviders
 Authenticator getAuthenticator()
          Get the current authenticator
 java.util.Collection getCredentialsProviders()
          Get the current CredentialsProviders
 Group getGroup(java.lang.String name)
          Return Group with given name.
 java.util.List getGroups()
          Return all known Groups from all AccessProviders that allow listing.
static UserManager getInstance()
          Entry-point to Singleton instance
 java.util.Collection getProfileProviders()
          Get the current ProfileProviders
 User getUser(java.lang.String name)
          Return user with given name.
 java.util.List getUsers()
          Return all known Users from all CredentialProviders that allow listing.
 void setAuthenticator(Authenticator authenticator)
          Set a new authenticator TODO: Should this be removed? Is it needed?
static void setInstance(UserManager userManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManager

public UserManager()
Don't use this constructor most of the time. To use OSUser as a singleton, use getInstance() .


UserManager

public UserManager(java.lang.String filename)
Method Detail

setInstance

public static void setInstance(UserManager userManager)

getInstance

public static UserManager getInstance()
Entry-point to Singleton instance


getAccessProviders

public java.util.Collection getAccessProviders()
Get the current AccessProviders


setAuthenticator

public void setAuthenticator(Authenticator authenticator)
Set a new authenticator TODO: Should this be removed? Is it needed?


getAuthenticator

public Authenticator getAuthenticator()
Get the current authenticator


getCredentialsProviders

public java.util.Collection getCredentialsProviders()
Get the current CredentialsProviders


getGroup

public Group getGroup(java.lang.String name)
               throws EntityNotFoundException
Return Group with given name. If Group is not found, an EntityNotFoundException is thrown.

Throws:
EntityNotFoundException

getGroups

public java.util.List getGroups()
Return all known Groups from all AccessProviders that allow listing.


getProfileProviders

public java.util.Collection getProfileProviders()
Get the current ProfileProviders


getUser

public User getUser(java.lang.String name)
             throws EntityNotFoundException
Return user with given name. If User is not found, an EntityNotFoundException is thrown.

Throws:
EntityNotFoundException

getUsers

public java.util.List getUsers()
Return all known Users from all CredentialProviders that allow listing.


addProvider

public void addProvider(UserProvider provider)
Add a new UserProvider to UserManager.


createGroup

public Group createGroup(java.lang.String name)
                  throws DuplicateEntityException,
                         ImmutableException
Create a new Group with given name.

createUser

public User createUser(java.lang.String name)
                throws DuplicateEntityException,
                       ImmutableException
Create a new User with given name.

flushCaches

public void flushCaches()
This method will flush all of the provider caches (if they are caching).


See www.opensymphony.com for more information.