Interface UserProvider


public interface UserProvider
Provides access to users and roles.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The constant indicating that a provider should be consulted for all organizations
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the number of users in the provider
    findUsers(String query, int offset, int limit)
    Return the found user's as an iterator.
    default Iterator<User>
    Find a list of users by their user names Note that the default implementation of this might be slow, as it calls loadUser on every single user.
    Gets the provider name
    Returns the identifier for the organization that is associated with this user provider.
    Gets all known users.
    void
    invalidate(String userName)
    Discards any cached value for given user name.
    loadUser(String userName)
    Loads a user by username, or returns null if this user is not known to this provider.
  • Field Details

    • ALL_ORGANIZATIONS

      static final String ALL_ORGANIZATIONS
      The constant indicating that a provider should be consulted for all organizations
      See Also:
  • Method Details

    • getName

      String getName()
      Gets the provider name
      Returns:
      the provider name
    • getUsers

      Iterator<User> getUsers()
      Gets all known users.
      Returns:
      the users
    • loadUser

      User loadUser(String userName)
      Loads a user by username, or returns null if this user is not known to this provider.
      Parameters:
      userName - the username
      Returns:
      the user
    • countUsers

      long countUsers()
      Returns the number of users in the provider
      Returns:
      the count of users in the provider
    • getOrganization

      String getOrganization()
      Returns the identifier for the organization that is associated with this user provider. If equal to ALL_ORGANIZATIONS, this provider will always be consulted, regardless of the organization.
      Returns:
      the defining organization
    • findUsers

      Iterator<User> findUsers(String query, int offset, int limit)
      Return the found user's as an iterator.
      Parameters:
      query - the query. Use the wildcards "_" to match any single character and "%" to match an arbitrary number of characters (including zero characters).
      offset - the offset
      limit - the limit. 0 means no limit
      Returns:
      an iterator of user's
      Throws:
      IllegalArgumentException - if the query is null
    • findUsers

      default Iterator<User> findUsers(Collection<String> userNames)
      Find a list of users by their user names Note that the default implementation of this might be slow, as it calls loadUser on every single user.
      Parameters:
      userNames - A list of user names
      Returns:
      A list of resolved user objects
    • invalidate

      void invalidate(String userName)
      Discards any cached value for given user name.
      Parameters:
      userName - the user name