Package org.jivesoftware.openfire.user
Class HybridUserProvider
java.lang.Object
org.jivesoftware.openfire.user.UserMultiProvider
org.jivesoftware.openfire.user.HybridUserProvider
- All Implemented Interfaces:
UserProvider
Delegate UserProvider operations among up to three configurable provider implementation classes.
This class related to, but is distinct from
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.- Author:
- Marc Seeger, Chris Neasbitt, Tom Evans, Guus der Kinderen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SystemProperty<Class>
static final SystemProperty<String>
static final SystemProperty<Class>
static final SystemProperty<String>
static final SystemProperty<Class>
static final SystemProperty<String>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetUserProvider
(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>
Loads a user from the first provider that contains the user.Methods inherited from class org.jivesoftware.openfire.user.UserMultiProvider
createUser, deleteUser, findUsers, findUsers, getSearchFields, getUserCount, getUsernames, getUsers, getUsers, instantiate, instantiate, instantiate, isEmailRequired, isNameRequired, isReadOnly, setCreationDate, setEmail, setModificationDate, setName
-
Field Details
-
PRIMARY_PROVIDER
-
PRIMARY_PROVIDER_CONFIG
-
SECONDARY_PROVIDER
-
SECONDARY_PROVIDER_CONFIG
-
TERTIARY_PROVIDER
-
TERTIARY_PROVIDER_CONFIG
-
-
Constructor Details
-
HybridUserProvider
public HybridUserProvider()
-
-
Method Details
-
getUserProviders
-
getUserProvider
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.- Parameters:
username
- the username (cannot be null or empty).- Returns:
- The user provider (never null)
-
loadUser
Loads a user from the first provider that contains the user.- Specified by:
loadUser
in interfaceUserProvider
- Overrides:
loadUser
in classUserMultiProvider
- Parameters:
username
- the username (cannot be null or empty).- Returns:
- The user (never null).
- Throws:
UserNotFoundException
- When none of the providers contains the user.
-