Class HybridUserProvider

java.lang.Object
org.jivesoftware.openfire.user.UserMultiProvider
org.jivesoftware.openfire.user.HybridUserProvider
All Implemented Interfaces:
UserProvider

public class HybridUserProvider extends UserMultiProvider
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 Details

  • Constructor Details

    • HybridUserProvider

      public HybridUserProvider()
  • Method Details

    • getUserProviders

      protected List<UserProvider> getUserProviders()
    • getUserProvider

      public 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.
      Parameters:
      username - the username (cannot be null or empty).
      Returns:
      The user provider (never null)
    • loadUser

      public User loadUser(String username) throws UserNotFoundException
      Loads a user from the first provider that contains the user.
      Specified by:
      loadUser in interface UserProvider
      Overrides:
      loadUser in class UserMultiProvider
      Parameters:
      username - the username (cannot be null or empty).
      Returns:
      The user (never null).
      Throws:
      UserNotFoundException - When none of the providers contains the user.