Package org.jivesoftware.openfire.user
Class MappedUserProvider
java.lang.Object
org.jivesoftware.openfire.user.UserMultiProvider
org.jivesoftware.openfire.user.MappedUserProvider
- All Implemented Interfaces:
UserProvider
A
UserProvider that delegates to a user-specific UserProvider.
This class related to, but is distinct from HybridUserProvider. The Hybrid variant of the provider iterates
over providers, operating on the first applicable instance. This Mapped variant, however, maps each user to exactly
one provider.
To use this provider, use the following system property definition:
provider.user.className = org.jivesoftware.openfire.user.MappedUserProvider
UserProviderMapper must be configured using the mappedUserProvider.mapper.className
system property. It is of importance to note that most UserProviderMapper implementations will require additional
configuration.- Author:
- Guus der Kinderen, guus@goodbytes.nl
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final UserProviderMapperUsed to determine what provider is to be used to operate on a particular user.static final StringName of the property of which the value is expected to be the classname of the UserProviderMapper instance to be used by instances of this class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateUser(String username, String password, String name, String email) Creates a new user.voiddeleteUser(String username) Delets a user.getUserProvider(String username) Loads the specified user by username.voidsetCreationDate(String username, Date creationDate) Sets the date the user was created.voidSets the user's email address.voidsetModificationDate(String username, Date modificationDate) Sets the date the user was last modified.voidSets the user's name.Methods inherited from class org.jivesoftware.openfire.user.UserMultiProvider
findUsers, findUsers, getSearchFields, getUserCount, getUsernames, getUsers, getUsers, instantiate, isEmailRequired, isNameRequired, isReadOnly
-
Field Details
-
PROPERTY_MAPPER_CLASSNAME
Name of the property of which the value is expected to be the classname of the UserProviderMapper instance to be used by instances of this class.- See Also:
-
mapper
Used to determine what provider is to be used to operate on a particular user.
-
-
Constructor Details
-
MappedUserProvider
public MappedUserProvider()
-
-
Method Details
-
getUserProviders
-
getUserProvider
-
loadUser
Description copied from interface:UserProviderLoads the specified user by username.- Parameters:
username- the username- Returns:
- the User.
- Throws:
UserNotFoundException- if the User could not be loaded.
-
createUser
public User createUser(String username, String password, String name, String email) throws UserAlreadyExistsException Description copied from interface:UserProviderCreates a new user. This method should throw an UnsupportedOperationException if this operation is not supporte by the backend user store.- Parameters:
username- the username.password- the plain-text password.name- the user's name, which can benull, unless isNameRequired is set to true.email- the user's email address, which can benull, unless isEmailRequired is set to true.- Returns:
- a new User.
- Throws:
UserAlreadyExistsException- if the username is already in use.
-
deleteUser
Description copied from interface:UserProviderDelets a user. This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.- Parameters:
username- the username to delete.
-
setName
Description copied from interface:UserProviderSets the user's name. This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.- Parameters:
username- the username.name- the name.- Throws:
UserNotFoundException- if the user could not be found.
-
setEmail
Description copied from interface:UserProviderSets the user's email address. This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.- Parameters:
username- the username.email- the email address.- Throws:
UserNotFoundException- if the user could not be found.
-
setCreationDate
Description copied from interface:UserProviderSets the date the user was created. This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.- Parameters:
username- the username.creationDate- the date the user was created.- Throws:
UserNotFoundException- if the user could not be found.
-
setModificationDate
public void setModificationDate(String username, Date modificationDate) throws UserNotFoundException Description copied from interface:UserProviderSets the date the user was last modified. This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.- Parameters:
username- the username.modificationDate- the date the user was last modified.- Throws:
UserNotFoundException- if the user could not be found.
-