public class HybridUserProvider extends UserMultiProvider
MappedUserProvider. The Hybrid variant of the provider iterates
over providers, operating on the first applicable instance. The Mapped variant, however, maps each user to exactly
one provider.| Constructor and Description |
|---|
HybridUserProvider() |
| Modifier and Type | Method and Description |
|---|---|
User |
createUser(String username,
String password,
String name,
String email)
Creates a new user in the first non-read-only provider.
|
void |
deleteUser(String username)
Removes a user from all non-read-only providers.
|
UserProvider |
getUserProvider(String username)
Returns the first provider that contains the user, or the first provider that is not read-only when the user
does not exist in any provider.
|
protected List<UserProvider> |
getUserProviders()
Returns all UserProvider instances that serve as 'backing' providers.
|
User |
loadUser(String username)
Loads a user from the first provider that contains the user.
|
void |
setCreationDate(String username,
Date creationDate)
Changes the creation date of a user in the first provider that contains the user.
|
void |
setEmail(String username,
String email)
Changes the email address of a user in the first provider that contains the user.
|
void |
setModificationDate(String username,
Date modificationDate)
Changes the modification date of a user in the first provider that contains the user.
|
void |
setName(String username,
String name)
Changes the full name of a user in the first provider that contains the user.
|
findUsers, findUsers, getSearchFields, getUserCount, getUsernames, getUsers, getUsers, instantiate, isEmailRequired, isNameRequired, isReadOnlyprotected List<UserProvider> getUserProviders()
UserMultiProviderpublic User createUser(String username, String password, String name, String email) throws UserAlreadyExistsException
username - the username.password - the plain-text password.name - the user's name, which can be null, unless isNameRequired is set to true.email - the user's email address, which can be null, unless isEmailRequired is set to true.UserAlreadyExistsExceptionpublic void deleteUser(String username)
username - the username to delete.public UserProvider getUserProvider(String username)
username - the username (cannot be null or empty).public User loadUser(String username) throws UserNotFoundException
username - the username (cannot be null or empty).UserNotFoundException - When none of the providers contains the user.public void setCreationDate(String username, Date creationDate) throws UserNotFoundException
username - the username.creationDate - the date the user was created.UserNotFoundException - when the user was not found in any provider.UnsupportedOperationException - when the provider is read-only.public void setModificationDate(String username, Date modificationDate) throws UserNotFoundException
username - the username.modificationDate - the date the user was (last) modified.UserNotFoundException - when the user was not found in any provider.UnsupportedOperationException - when the provider is read-only.public void setName(String username, String name) throws UserNotFoundException
username - the username.name - the new full name a user.UserNotFoundException - when the user was not found in any provider.UnsupportedOperationException - when the provider is read-only.public void setEmail(String username, String email) throws UserNotFoundException
username - the username.email - the new email address of a user.UserNotFoundException - when the user was not found in any provider.UnsupportedOperationException - when the provider is read-only.Copyright © 2003-2008 Jive Software.