public interface UserManager extends PrincipalTypeManager
Describes the interface for managing users and provides access to the
User
.
Modifier and Type | Method and Description |
---|---|
User |
addUser(String userName)
Add a new user
|
User |
addUser(String userName,
boolean mapped)
Add a new user and optionally map/replicate it to an external storage manager (if configured).
|
String |
getAnonymousUser() |
PasswordCredential |
getPasswordCredential(User user)
Returns the current PasswordCredential for a User or a new one if the doesn't have one yet
|
Subject |
getSubject(AuthenticatedUser user)
Get a Subject for an (possibly externally) authenticated user with (optionally) provided credentials.
|
Subject |
getSubject(User user)
Get a Subject for an user.
|
User |
getUser(String userName)
Get a
User for a given user name. |
List<String> |
getUserNames(String nameFilter)
Retrieves a a detached and modifiable List user names, finding users matching the corresponding
user name filter.
|
List<User> |
getUsers(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. |
List<User> |
getUsersInGroup(String groupName)
Retrieves a a detached and modifiable
User list of all the users in a specific group. |
List<User> |
getUsersInRole(String roleName)
Retrieves a a detached and modifiable
User list of all the users in a specific role. |
List<User> |
lookupUsers(String attributeName,
String attributeValue)
Retrieves a a detached and modifiable
User list of all the users having a specific value for a specific attribute |
User |
newTransientUser(String name) |
User |
newUser(String name) |
User |
newUser(String name,
boolean mapped) |
void |
removeUser(String userName)
Remove a user.
|
void |
storePasswordCredential(PasswordCredential credential) |
void |
updateUser(User user)
Updates a user and all its attributes
|
boolean |
userExists(String userName)
Whether or not a user exists.
|
getPrincipalManager, getPrincipalType
String getAnonymousUser()
User addUser(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.
userName
- The user name.User
throws
- a security exception.SecurityException
User addUser(String userName, boolean mapped) throws SecurityException
Add a new user and optionally map/replicate it to an external storage manager (if configured).
userName
- The user name.mapped
- if the new User should be mapped/replicated to an external security storage manager (if used) or not.User
throws
- a security exception.SecurityException
void removeUser(String userName) throws SecurityException
Remove a user. If there user attributes associated with this user, they will be removed as well.
Permission
for this user will be removed as well.
userName
- The user name.throws
- a security exception.SecurityException
boolean userExists(String userName)
Whether or not a user exists.
userName
- The user name.User getUser(String userName) throws SecurityException
Get a User
for a given user name.
userName
- The user name.User
.throws
- a security exception if the user cannot be found.SecurityException
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.
user
- The user.throws
- a security exception if the user cannot be foundSecurityException
Subject getSubject(AuthenticatedUser user) throws SecurityException
Get a Subject for an (possibly externally) authenticated user with (optionally) provided credentials.
user
- The authenticated user.throws
- a security exception if the user cannot be foundSecurityException
List<User> getUsers(String nameFilter) throws SecurityException
Retrieves a detached and modifiable User
list matching the corresponding
user name filter.
nameFilter
- The filter used to retrieve matching users.User
.SecurityException
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.
queryContext
- The (@see JetspeedPrincipalQueryContext) for this query.SecurityException
List<String> getUserNames(String nameFilter) throws SecurityException
Retrieves a a detached and modifiable List user names, finding users matching the corresponding user name filter.
nameFilter
- The filter used to retrieve matching users.SecurityException
List<User> getUsersInRole(String roleName) throws SecurityException
Retrieves a a detached and modifiable User
list of all the users in a specific role.
roleName
- The role nameUser
.throws
- a security exception if the role does not exist.SecurityException
List<User> getUsersInGroup(String groupName) throws SecurityException
Retrieves a a detached and modifiable User
list of all the users in a specific group.
groupName
- The group nameUser
.throws
- security exception if the group does not exist.SecurityException
void updateUser(User user) throws SecurityException
user
- SecurityException
List<User> lookupUsers(String attributeName, String attributeValue) throws SecurityException
Retrieves a a detached and modifiable User
list of all the users having a specific value for a specific attribute
attributeName
- attributeValue
- SecurityException
PasswordCredential getPasswordCredential(User user) throws SecurityException
user
- the userSecurityException
void storePasswordCredential(PasswordCredential credential) throws SecurityException
SecurityException
Copyright © 1999–2016 The Apache Software Foundation. All rights reserved.