org.keycloak.storage.user

## Interface UserQueryProvider.Streams

- All Superinterfaces:
    UserQueryProvider
  All Known Subinterfaces:
    UserCache.Streams, UserProvider.Streams
  All Known Implementing Classes:
    JpaUserProvider, LDAPStorageProvider, MapUserProvider, UserCacheSession, UserStorageManager
  Enclosing interface:
    UserQueryProvider

      public static interface UserQueryProvider.Streams
      extends UserQueryProvider

  The `UserQueryProvider.Streams` interface makes all collection-based methods in `UserQueryProvider` default by providing implementations that delegate to the `Stream`-based variants instead of the other way around.

  It allows for implementations to focus on the `Stream`-based approach for processing sets of data and benefit from the potential memory and performance optimizations of that approach.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.storage.user.UserQueryProvider

      `UserQueryProvider.Streams`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default List<UserModel>` | `getGroupMembers(RealmModel realm, GroupModel group)` Get users that belong to a specific group.
    `default List<UserModel>` | `getGroupMembers(RealmModel realm, GroupModel group, int firstResult, int maxResults)` Get users that belong to a specific group.
    `Stream<UserModel>` | `getGroupMembersStream(RealmModel realm, GroupModel group)` Obtains users that belong to a specific group.
    `Stream<UserModel>` | `getGroupMembersStream(RealmModel realm, GroupModel group, Integer firstResult, Integer maxResults)` Obtains users that belong to a specific group.
    `default List<UserModel>` | `getUsers(RealmModel realm)`
    `default List<UserModel>` | `getUsers(RealmModel realm, int firstResult, int maxResults)`
    `Stream<UserModel>` | `getUsersStream(RealmModel realm)` Searches all users in the realm.
    `Stream<UserModel>` | `getUsersStream(RealmModel realm, int firstResult, int maxResults)` Searches all users in the realm, starting from the `firstResult` and containing at most `maxResults`.
    `default List<UserModel>` | `searchForUser(Map<String,String> params, RealmModel realm)` Search for user by parameter.
    `default List<UserModel>` | `searchForUser(Map<String,String> params, RealmModel realm, int firstResult, int maxResults)` Search for user by parameter.
    `default List<UserModel>` | `searchForUser(String search, RealmModel realm)` Search for users with username, email or first + last name that is like search string.
    `default List<UserModel>` | `searchForUser(String search, RealmModel realm, int firstResult, int maxResults)` Search for users with username, email or first + last name that is like search string.
    `default List<UserModel>` | `searchForUserByUserAttribute(String attrName, String attrValue, RealmModel realm)` Search for users that have a specific attribute with a specific value.
    `Stream<UserModel>` | `searchForUserByUserAttributeStream(String attrName, String attrValue, RealmModel realm)` Searches for users that have a specific attribute with a specific value.
    `Stream<UserModel>` | `searchForUserStream(Map<String,String> params, RealmModel realm)` Searches for user by parameter.
    `Stream<UserModel>` | `searchForUserStream(Map<String,String> params, RealmModel realm, Integer firstResult, Integer maxResults)` Searches for user by parameter.
    `Stream<UserModel>` | `searchForUserStream(String search, RealmModel realm)` Searches for users with username, email or first + last name that is like search string.
    `Stream<UserModel>` | `searchForUserStream(String search, RealmModel realm, Integer firstResult, Integer maxResults)` Searches for users with username, email or first + last name that is like search string.

    - ### Methods inherited from interface org.keycloak.storage.user.UserQueryProvider

      `countUsersInGroups, getRoleMembers, getRoleMembers, getRoleMembersStream, getRoleMembersStream, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount`

- - ### Method Detail

    - #### getUsers

          default List<UserModel> getUsers(RealmModel realm)

      Specified by:
        `getUsers` in interface `UserQueryProvider`

    - #### getUsersStream

          Stream<UserModel> getUsersStream(RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Searches all users in the realm.
      Specified by:
        `getUsersStream` in interface `UserQueryProvider`
      Parameters:
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of users.

    - #### getUsers

          default List<UserModel> getUsers(RealmModel realm,
                                           int firstResult,
                                           int maxResults)

      Specified by:
        `getUsers` in interface `UserQueryProvider`

    - #### getUsersStream

          Stream<UserModel> getUsersStream(RealmModel realm,
                                           int firstResult,
                                           int maxResults)

      Description copied from interface: `UserQueryProvider`
      Searches all users in the realm, starting from the `firstResult` and containing at most `maxResults`.
      Specified by:
        `getUsersStream` in interface `UserQueryProvider`
      Parameters:
        `realm` - a reference to the realm.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users.

    - #### searchForUser

          default List<UserModel> searchForUser(String search,
                                                RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Search for users with username, email or first + last name that is like search string. If possible, implementations should treat the parameter values as partial match patterns i.e. in RDMBS terms use LIKE. This method is used by the admin console search box
      Specified by:
        `searchForUser` in interface `UserQueryProvider`
      Returns:

    - #### searchForUserStream

          Stream<UserModel> searchForUserStream(String search,
                                                RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Searches for users with username, email or first + last name that is like search string. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE).

      This method is used by the admin console search box
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider`
      Parameters:
        `search` - case sensitive search string.
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of users that match the search string.

    - #### searchForUser

          default List<UserModel> searchForUser(String search,
                                                RealmModel realm,
                                                int firstResult,
                                                int maxResults)

      Description copied from interface: `UserQueryProvider`
      Search for users with username, email or first + last name that is like search string. If possible, implementations should treat the parameter values as partial match patterns i.e. in RDMBS terms use LIKE. This method is used by the admin console search box
      Specified by:
        `searchForUser` in interface `UserQueryProvider`
      Returns:

    - #### searchForUserStream

          Stream<UserModel> searchForUserStream(String search,
                                                RealmModel realm,
                                                Integer firstResult,
                                                Integer maxResults)

      Description copied from interface: `UserQueryProvider`
      Searches for users with username, email or first + last name that is like search string. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE).

      This method is used by the admin console search box
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider`
      Parameters:
        `search` - case sensitive search string.
        `realm` - a reference to the realm.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users that match the search criteria.

    - #### searchForUser

          default List<UserModel> searchForUser(Map<String,String> params,
                                                RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Search for user by parameter. Valid parameters are: "first" - first name "last" - last name "email" - email "username" - username If possible, implementations should treat the parameter values as partial match patterns i.e. in RDMBS terms use LIKE. This method is used by the REST API when querying users.
      Specified by:
        `searchForUser` in interface `UserQueryProvider`
      Returns:

    - #### searchForUserStream

          Stream<UserModel> searchForUserStream(Map<String,String> params,
                                                RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Searches for user by parameter. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE). Valid parameters are:
      - first - first name
      - last - last name
      - email - email
      - username - username
      - enabled - if user is enabled (true/false)
      This method is used by the REST API when querying users.
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider`
      Parameters:
        `params` - a map containing the search parameters.
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of users that match the search parameters.

    - #### searchForUser

          default List<UserModel> searchForUser(Map<String,String> params,
                                                RealmModel realm,
                                                int firstResult,
                                                int maxResults)

      Description copied from interface: `UserQueryProvider`
      Search for user by parameter. Valid parameters are: "first" - first name "last" - last name "email" - email "username" - username "enabled" - is user enabled (true/false) If possible, implementations should treat the parameter values as patterns i.e. in RDMBS terms use LIKE. This method is used by the REST API when querying users.
      Specified by:
        `searchForUser` in interface `UserQueryProvider`
      Returns:

    - #### searchForUserStream

          Stream<UserModel> searchForUserStream(Map<String,String> params,
                                                RealmModel realm,
                                                Integer firstResult,
                                                Integer maxResults)

      Description copied from interface: `UserQueryProvider`
      Searches for user by parameter. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE). Valid parameters are:
      - first - first name
      - last - last name
      - email - email
      - username - username
      - enabled - if user is enabled (true/false)
      This method is used by the REST API when querying users.
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider`
      Parameters:
        `params` - a map containing the search parameters.
        `realm` - a reference to the realm.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users that match the search criteria.

    - #### getGroupMembers

          default List<UserModel> getGroupMembers(RealmModel realm,
                                                  GroupModel group)

      Description copied from interface: `UserQueryProvider`
      Get users that belong to a specific group. Implementations do not have to search in UserFederatedStorageProvider as this is done automatically.
      Specified by:
        `getGroupMembers` in interface `UserQueryProvider`
      Returns:
      See Also:
        `UserFederatedStorageProvider`

    - #### getGroupMembersStream

          Stream<UserModel> getGroupMembersStream(RealmModel realm,
                                                  GroupModel group)

      Description copied from interface: `UserQueryProvider`
      Obtains users that belong to a specific group. Implementations do not have to search in `UserFederatedStorageProvider` as this is done automatically.
      Specified by:
        `getGroupMembersStream` in interface `UserQueryProvider`
      Parameters:
        `realm` - a reference to the realm.
        `group` - a reference to the group.
      Returns:
        a non-null `Stream` of users that belong to the group.
      See Also:
        `UserFederatedStorageProvider`

    - #### getGroupMembers

          default List<UserModel> getGroupMembers(RealmModel realm,
                                                  GroupModel group,
                                                  int firstResult,
                                                  int maxResults)

      Description copied from interface: `UserQueryProvider`
      Get users that belong to a specific group. Implementations do not have to search in UserFederatedStorageProvider as this is done automatically.
      Specified by:
        `getGroupMembers` in interface `UserQueryProvider`
      Returns:
      See Also:
        `UserFederatedStorageProvider`

    - #### getGroupMembersStream

          Stream<UserModel> getGroupMembersStream(RealmModel realm,
                                                  GroupModel group,
                                                  Integer firstResult,
                                                  Integer maxResults)

      Description copied from interface: `UserQueryProvider`
      Obtains users that belong to a specific group. Implementations do not have to search in `UserFederatedStorageProvider` as this is done automatically.
      Specified by:
        `getGroupMembersStream` in interface `UserQueryProvider`
      Parameters:
        `realm` - a reference to the realm.
        `group` - a reference to the group.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users that belong to the group.
      See Also:
        `UserFederatedStorageProvider`

    - #### searchForUserByUserAttribute

          default List<UserModel> searchForUserByUserAttribute(String attrName,
                                                               String attrValue,
                                                               RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Search for users that have a specific attribute with a specific value. Implementations do not have to search in UserFederatedStorageProvider as this is done automatically.
      Specified by:
        `searchForUserByUserAttribute` in interface `UserQueryProvider`
      Returns:
      See Also:
        `UserFederatedStorageProvider`

    - #### searchForUserByUserAttributeStream

          Stream<UserModel> searchForUserByUserAttributeStream(String attrName,
                                                               String attrValue,
                                                               RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Searches for users that have a specific attribute with a specific value. Implementations do not have to search in `UserFederatedStorageProvider` as this is done automatically.
      Specified by:
        `searchForUserByUserAttributeStream` in interface `UserQueryProvider`
      Parameters:
        `attrName` - the attribute name.
        `attrValue` - the attribute value.
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of users that match the search criteria.
      See Also:
        `UserFederatedStorageProvider`

Copyright © 2020 JBoss by Red Hat. All rights reserved.