|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface UserDao
Responsible for the persistence and retrieval of Users, PasswordCredentials and user attributes.
| Method Summary | ||
|---|---|---|
User |
add(User user,
PasswordCredential credential)
Creates a new user with the given details and credentials. |
|
BatchResult<User> |
addAll(java.util.Set<UserTemplateWithCredentialAndAttributes> users)
Bulk add of users using JDBC batch support. |
|
TimestampedUser |
findByName(long directoryId,
java.lang.String userName)
Finds and returns the user with the given name and directory ID. |
|
UserWithAttributes |
findByNameWithAttributes(long directoryId,
java.lang.String userName)
Finds and returns the user with attributes with the given name and directory ID. |
|
PasswordCredential |
getCredential(long directoryId,
java.lang.String userName)
Returns the credential for the given user. |
|
java.util.List<PasswordCredential> |
getCredentialHistory(long directoryId,
java.lang.String userName)
Returns the previous credentials for the given user, starting with the oldest. |
|
void |
remove(User user)
Removes the user. |
|
void |
removeAllUsers(long directoryId,
java.util.Set<java.lang.String> userNames)
Remove all the given users from directory. |
|
void |
removeAttribute(User user,
java.lang.String attributeName)
Removes the attributes for the user with the given name. |
|
User |
rename(User user,
java.lang.String newName)
Changes the user's name to the provided new name. |
|
|
search(long directoryId,
EntityQuery<T> query)
Returns users matching the search query in the given directory, ordered by name. |
|
void |
storeAttributes(User user,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
Adds or updates a user's attributes with the new Map of attribute values. |
|
User |
update(User user)
Updates all the user properties of the user with the same directory and case-insensitive name. |
|
void |
updateCredential(User user,
PasswordCredential credential,
int maxCredentialHistory)
Updates the credential (password) of the user with the same directory and case-insensitive name. |
|
| Method Detail |
|---|
TimestampedUser findByName(long directoryId,
java.lang.String userName)
throws UserNotFoundException
UserNotFoundException - if the user could not be found
UserWithAttributes findByNameWithAttributes(long directoryId,
java.lang.String userName)
throws UserNotFoundException
UserNotFoundException - if the user could not be found
PasswordCredential getCredential(long directoryId,
java.lang.String userName)
throws UserNotFoundException
UserNotFoundException - if the user could not be found
java.util.List<PasswordCredential> getCredentialHistory(long directoryId,
java.lang.String userName)
throws UserNotFoundException
UserNotFoundException - if the user could not be found
User add(User user,
PasswordCredential credential)
throws UserAlreadyExistsException,
java.lang.IllegalArgumentException,
DirectoryNotFoundException
user - the user to createcredential - the encrypted password for the user, which may be null if the user's password is not yet available
UserAlreadyExistsException - if a user with the same directory and name (case-insensitive) already exists
java.lang.IllegalArgumentException - if the user name, directory or any details are null, or if the credential is not encrypted
DirectoryNotFoundException
void storeAttributes(User user,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
throws UserNotFoundException
user - the user to store attributes forattributes - new or updated attributes (attributes that don't need changing should not appear in this Map).
UserNotFoundException - user with supplied username does not exist.
User update(User user)
throws UserNotFoundException,
java.lang.IllegalArgumentException
user - the user details, which should have the same name as the user to modify
UserNotFoundException - if there is no user with the same name (case-insensitive) and directory as the user provided
java.lang.IllegalArgumentException - if the user name, directory or any details are null
void updateCredential(User user,
PasswordCredential credential,
int maxCredentialHistory)
throws UserNotFoundException,
java.lang.IllegalArgumentException
user - the user whose password will be modified
UserNotFoundException - if there is no user with the same name (case-insensitive) and directory as the user provided
java.lang.IllegalArgumentException - if the credential is null or not encrypted
User rename(User user,
java.lang.String newName)
throws UserNotFoundException,
UserAlreadyExistsException,
java.lang.IllegalArgumentException
user - the user to renamenewName - the new name of the user
UserNotFoundException - if the user cannot be found
UserAlreadyExistsException - if the new name is already used
java.lang.IllegalArgumentException - if the new name is null
void removeAttribute(User user,
java.lang.String attributeName)
throws UserNotFoundException
user - the user whose attribute will be removedattributeName - the name of the attribute to be removed
UserNotFoundException - if the user cannot be found
void remove(User user)
throws UserNotFoundException
user - the user to remove
UserNotFoundException - if the user does not exist
<T> java.util.List<T> search(long directoryId,
EntityQuery<T> query)
T - the type of objects to return, which is normally either User or StringdirectoryId - the ID of the directory to searchquery - the search query
BatchResult<User> addAll(java.util.Set<UserTemplateWithCredentialAndAttributes> users)
users - to be added
void removeAllUsers(long directoryId,
java.util.Set<java.lang.String> userNames)
directoryId - the ID of the directory to remove users fromuserNames - set of users to be removed
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||