org.apache.jetspeed.security
Interface UserManager

All Superinterfaces:
PrincipalTypeManager, java.io.Serializable

public interface UserManager
extends PrincipalTypeManager

Describes the interface for managing users and provides access to the User.

Version:
$Id: UserManager.java 925710 2010-03-21 01:12:50Z taylor $

Method Summary
 User addUser(java.lang.String userName)
           Add a new user
 User addUser(java.lang.String userName, boolean mapped)
           Add a new user and optionally map/replicate it to an external storage manager (if configured).
 java.lang.String getAnonymousUser()
           
 PasswordCredential getPasswordCredential(User user)
          Returns the current PasswordCredential for a User or a new one if the doesn't have one yet
 javax.security.auth.Subject getSubject(AuthenticatedUser user)
           Get a Subject for an (possibly externally) authenticated user with (optionally) provided credentials.
 javax.security.auth.Subject getSubject(User user)
           Get a Subject for an user.
 User getUser(java.lang.String userName)
           Get a Userfor a given user name.
 java.util.List<java.lang.String> getUserNames(java.lang.String nameFilter)
           Retrieves a a detached and modifiable List user names, finding users matching the corresponding user name filter.
 java.util.List<User> getUsers(java.lang.String nameFilter)
           Retrieves a detached and modifiable User list matching the corresponding user name filter.
 UserResultList getUsersExtended(JetspeedPrincipalQueryContext queryContext)
           Retrieves a detached and modifiable User list matching the corresponding query context.
 java.util.List<User> getUsersInGroup(java.lang.String groupName)
          Retrieves a a detached and modifiable User list of all the users in a specific group.
 java.util.List<User> getUsersInRole(java.lang.String roleName)
           Retrieves a a detached and modifiable User list of all the users in a specific role.
 java.util.List<User> lookupUsers(java.lang.String attributeName, java.lang.String attributeValue)
          Retrieves a a detached and modifiable User list of all the users having a specific value for a specific attribute
 User newTransientUser(java.lang.String name)
           
 User newUser(java.lang.String name)
           
 User newUser(java.lang.String name, boolean mapped)
           
 void removeUser(java.lang.String userName)
           Remove a user.
 void storePasswordCredential(PasswordCredential credential)
           
 void updateUser(User user)
          Updates a user and all its attributes
 boolean userExists(java.lang.String userName)
           Whether or not a user exists.
 
Methods inherited from interface org.apache.jetspeed.security.PrincipalTypeManager
getPrincipalManager, getPrincipalType
 

Method Detail

getAnonymousUser

java.lang.String getAnonymousUser()
Returns:
the name of the anonymous user

newUser

User newUser(java.lang.String name)

newUser

User newUser(java.lang.String name,
             boolean mapped)

newTransientUser

User newTransientUser(java.lang.String name)

addUser

User addUser(java.lang.String userName)
             throws SecurityException

Add a new user

If an external security storage manager is used, the user will be mapped/replicated to it as well.

Parameters:
userName - The user name.
Returns:
the new User
Throws:
Throws - a security exception.
SecurityException

addUser

User addUser(java.lang.String userName,
             boolean mapped)
             throws SecurityException

Add a new user and optionally map/replicate it to an external storage manager (if configured).

Parameters:
userName - The user name.
mapped - if the new User should be mapped/replicated to an external security storage manager (if used) or not.
Returns:
the new User
Throws:
Throws - a security exception.
SecurityException

removeUser

void removeUser(java.lang.String userName)
                throws SecurityException

Remove a user. If there user attributes associated with this user, they will be removed as well.

Permissionfor this user will be removed as well.

Parameters:
userName - The user name.
Throws:
Throws - a security exception.
SecurityException

userExists

boolean userExists(java.lang.String userName)

Whether or not a user exists.

Parameters:
userName - The user name.
Returns:
Whether or not a user exists.

getUser

User getUser(java.lang.String userName)
             throws SecurityException

Get a Userfor a given user name.

Parameters:
userName - The user name.
Returns:
The User.
Throws:
Throws - a security exception if the user cannot be found.
SecurityException

getSubject

javax.security.auth.Subject getSubject(User user)
                                       throws SecurityException

Get a Subject for an user.

The Subject credentials (.e.g. PasswordCredential) will be retrieved by the Jetspeed security provider itself (if configured).

If an external authentication provider is used supplying custom credentials the method getSubject(AuthenticatedUser) should be used instead.

Parameters:
user - The user.
Returns:
The Subject.
Throws:
Throws - a security exception if the user cannot be found
SecurityException

getSubject

javax.security.auth.Subject getSubject(AuthenticatedUser user)
                                       throws SecurityException

Get a Subject for an (possibly externally) authenticated user with (optionally) provided credentials.

Parameters:
user - The authenticated user.
Returns:
The Subject.
Throws:
Throws - a security exception if the user cannot be found
SecurityException

getUsers

java.util.List<User> getUsers(java.lang.String nameFilter)
                              throws SecurityException

Retrieves a detached and modifiable User list matching the corresponding user name filter.

Parameters:
nameFilter - The filter used to retrieve matching users.
Returns:
a list of User.
Throws:
SecurityException

getUsersExtended

UserResultList getUsersExtended(JetspeedPrincipalQueryContext queryContext)
                                throws SecurityException

Retrieves a detached and modifiable User list matching the corresponding query context. It returns a UserResultList, containing the actual result list an the total number of results from the query.

Parameters:
queryContext - The (@see JetspeedPrincipalQueryContext) for this query.
Returns:
Throws:
SecurityException

getUserNames

java.util.List<java.lang.String> getUserNames(java.lang.String nameFilter)
                                              throws SecurityException

Retrieves a a detached and modifiable List user names, finding users matching the corresponding user name filter.

Parameters:
nameFilter - The filter used to retrieve matching users.
Returns:
A list of user names
Throws:
SecurityException

getUsersInRole

java.util.List<User> getUsersInRole(java.lang.String roleName)
                                    throws SecurityException

Retrieves a a detached and modifiable User list of all the users in a specific role.

Parameters:
roleName - The role name
Returns:
A List of User.
Throws:
Throws - a security exception if the role does not exist.
SecurityException

getUsersInGroup

java.util.List<User> getUsersInGroup(java.lang.String groupName)
                                     throws SecurityException

Retrieves a a detached and modifiable User list of all the users in a specific group.

Parameters:
groupName - The group name
Returns:
A list of User.
Throws:
Throws - security exception if the group does not exist.
SecurityException

updateUser

void updateUser(User user)
                throws SecurityException
Updates a user and all its attributes

Parameters:
user -
Throws:
SecurityException

lookupUsers

java.util.List<User> lookupUsers(java.lang.String attributeName,
                                 java.lang.String attributeValue)
                                 throws SecurityException

Retrieves a a detached and modifiable User list of all the users having a specific value for a specific attribute

Parameters:
attributeName -
attributeValue -
Returns:
a List of users
Throws:
SecurityException

getPasswordCredential

PasswordCredential getPasswordCredential(User user)
                                         throws SecurityException
Returns the current PasswordCredential for a User or a new one if the doesn't have one yet

Parameters:
user - the user
Returns:
null if the UserManager doesn't support PasswordCredentials
Throws:
SecurityException

storePasswordCredential

void storePasswordCredential(PasswordCredential credential)
                             throws SecurityException
Throws:
SecurityException


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.