com.evermind.security
Interface UserManager

All Superinterfaces:
Config
All Known Implementing Classes:
AbstractUserManager, DataSourceUserManager, EJBUserManager

public interface UserManager
extends Config

A UserManager is used to organize (add/find/remove users from) a resource.


Method Summary
 void addDefaultGroup(java.lang.String name)
          Adds a group to the set of default groups which all users of this manager are members of.
 Group createGroup(java.lang.String name)
          Creates a new Group.
 User createUser(java.lang.String username, java.lang.String password)
          Creates a new User.
 User getAdminUser()
          Returns the "default" admin user or null if there is none.
 User getAnonymousUser()
          Returns the default anonymous user or null if none exists.
 java.util.Set getDefaultGroups()
          Gets the Set of default groups for this UserManager.
 Group getGroup(java.lang.String name)
          Returns the group with the specified name or null if none exists.
 int getGroupCount()
          Return the number of users contained in this manager.
 java.util.List getGroups(int start, int max)
          Returns a list of Groups (between the specified indexes) contained in this manager.
 UserManager getParent()
          Gets the parent manager of this UserManager if any.
 User getUser(java.lang.String username)
          Returns the user with the specified username or null if none exists.
 User getUser(java.lang.String issuerDN, java.math.BigInteger serial)
          Returns the user associated with this certificate or null if either certificates arent supported or there is no user associated with this certificate.
 User getUser(java.security.cert.X509Certificate certificate)
          Returns the user associated with this certificate or null if either certificates arent supported or there is no user associated with this certificate.
 int getUserCount()
          Return the number of users contained in this manager.
 java.util.List getUsers(int start, int max)
          Returns a list of Users (between the specified indexes) contained in this manager.
 void init(java.util.Properties properties)
          Instantiates this UserManager with the specified settings.
 boolean remove(Group group)
          Removes the specified group from this UserManager.
 boolean remove(User user)
          Removes the specified user from this UserManager.
 void setParent(UserManager parent)
          Sets the parent UserManager if any.
 
Methods inherited from interface com.evermind.util.Config
create, invalidate, isUpdated, store, update
 

Method Detail

init

void init(java.util.Properties properties)
          throws java.lang.InstantiationException
Instantiates this UserManager with the specified settings.

Throws:
java.lang.InstantiationException - if the init() fails.

setParent

void setParent(UserManager parent)
Sets the parent UserManager if any. This method is only called if this ia a nested UserManager.


getParent

UserManager getParent()
Gets the parent manager of this UserManager if any.


getUser

User getUser(java.lang.String username)
Returns the user with the specified username or null if none exists.


getAnonymousUser

User getAnonymousUser()
Returns the default anonymous user or null if none exists.


getGroup

Group getGroup(java.lang.String name)
Returns the group with the specified name or null if none exists.


createUser

User createUser(java.lang.String username,
                java.lang.String password)
                throws java.lang.InstantiationException,
                       UserAlreadyExistsException
Creates a new User. If the user already exists an IllegalArgumentException is thrown.

Throws:
java.lang.InstantiationException - if the user exists.
UserAlreadyExistsException

createGroup

Group createGroup(java.lang.String name)
                  throws java.lang.InstantiationException
Creates a new Group. If the group already exists an IllegalArgumentException is thrown.

Throws:
java.lang.InstantiationException - if the group exists.

getUser

User getUser(java.lang.String issuerDN,
             java.math.BigInteger serial)
Returns the user associated with this certificate or null if either certificates arent supported or there is no user associated with this certificate.


getUser

User getUser(java.security.cert.X509Certificate certificate)
Returns the user associated with this certificate or null if either certificates arent supported or there is no user associated with this certificate.


getAdminUser

User getAdminUser()
Returns the "default" admin user or null if there is none.


remove

boolean remove(User user)
Removes the specified user from this UserManager. Returns true if the operation is successfull.


remove

boolean remove(Group group)
Removes the specified group from this UserManager. Returns true if the operation is successfull.


addDefaultGroup

void addDefaultGroup(java.lang.String name)
Adds a group to the set of default groups which all users of this manager are members of.


getDefaultGroups

java.util.Set getDefaultGroups()
Gets the Set of default groups for this UserManager.


getUserCount

int getUserCount()
Return the number of users contained in this manager. Throws UnsupportedOperationException if not supported.


getGroupCount

int getGroupCount()
Return the number of users contained in this manager. Throws UnsupportedOperationException if not supported.


getUsers

java.util.List getUsers(int start,
                        int max)
Returns a list of Users (between the specified indexes) contained in this manager. Throws UnsupportedOperationException if not supported.


getGroups

java.util.List getGroups(int start,
                         int max)
Returns a list of Groups (between the specified indexes) contained in this manager. Throws UnsupportedOperationException if not supported.