Package org.jivesoftware.openfire.user
Class AuthorizationBasedUserProviderMapper
- java.lang.Object
-
- org.jivesoftware.openfire.user.AuthorizationBasedUserProviderMapper
-
- All Implemented Interfaces:
UserProviderMapper
public class AuthorizationBasedUserProviderMapper extends Object implements UserProviderMapper
AUserProviderMapper
that can be used to draw administrative users from another source than the regular, non- administrative users. This implementation usesAdminManager
to determine if a particular user is an administrative user. When a user is not recognized, it is deemed a regular, non-administrative user. To configure this provider, the both system properties from the example below must be defined. Their value must reference the classname of anUserProvider
.authorizationBasedUserMapper.adminProvider.className = org.jivesoftware.openfire.auth.DefaultUserProvider
authorizationBasedUserMapper.userProvider.className = org.jivesoftware.openfire.auth.NativeUserProvider
- Author:
- Guus der Kinderen, guus@goodbytes.nl
-
-
Field Summary
Fields Modifier and Type Field Description protected UserProvider
adminProvider
Serves the administrative users.static String
PROPERTY_ADMINPROVIDER_CLASSNAME
Name of the property of which the value is expected to be the classname of the UserProvider which will serve the administrative users.static String
PROPERTY_USERPROVIDER_CLASSNAME
Name of the property of which the value is expected to be the classname of the UserProvider which will serve the regular, non-administrative users.protected UserProvider
userProvider
Serves the regular, non-administrative users.
-
Constructor Summary
Constructors Constructor Description AuthorizationBasedUserProviderMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserProvider
getUserProvider(String username)
Finds a suitable UserProvider for the user.Set<UserProvider>
getUserProviders()
Returns all providers that are used by this instance.
-
-
-
Field Detail
-
PROPERTY_ADMINPROVIDER_CLASSNAME
public static final String PROPERTY_ADMINPROVIDER_CLASSNAME
Name of the property of which the value is expected to be the classname of the UserProvider which will serve the administrative users.- See Also:
- Constant Field Values
-
PROPERTY_USERPROVIDER_CLASSNAME
public static final String PROPERTY_USERPROVIDER_CLASSNAME
Name of the property of which the value is expected to be the classname of the UserProvider which will serve the regular, non-administrative users.- See Also:
- Constant Field Values
-
adminProvider
protected final UserProvider adminProvider
Serves the administrative users.
-
userProvider
protected final UserProvider userProvider
Serves the regular, non-administrative users.
-
-
Method Detail
-
getUserProvider
public UserProvider getUserProvider(String username)
Description copied from interface:UserProviderMapper
Finds a suitable UserProvider for the user. Note that the provided username need not reflect a pre-existing user (the instance might be used to determine in which provider a new user is to be created). Implementations are expected to be able to find a UserProvider for any username. If an implementation fails to do so, such a failure is assumed to be the result of a problem in implementation or configuration.- Specified by:
getUserProvider
in interfaceUserProviderMapper
- Parameters:
username
- A user identifier (cannot be null or empty).- Returns:
- A UserProvider for the user (never null).
-
getUserProviders
public Set<UserProvider> getUserProviders()
Description copied from interface:UserProviderMapper
Returns all providers that are used by this instance. The returned collection should have a consistent, predictable iteration order.- Specified by:
getUserProviders
in interfaceUserProviderMapper
- Returns:
- all providers (never null).
-
-