Interface UserQueryProvider.Streams

    • Method Detail

      • getUsersCount

        default int getUsersCount​(RealmModel realm,
                                  String search)
        Description copied from interface: UserQueryProvider
        Returns the number of users that would be returned by a call to searchForUserStream
        Specified by:
        getUsersCount in interface UserQueryProvider
        Parameters:
        realm - the realm
        search - case insensitive list of strings separated by whitespaces.
        Returns:
        number of users that match the search
      • getUsersCount

        default int getUsersCount​(RealmModel realm,
                                  String search,
                                  Set<String> groupIds)
        Description copied from interface: UserQueryProvider
        Returns the number of users that would be returned by a call to searchForUserStream and are members of at least one of the groups given by the groupIds set.
        Specified by:
        getUsersCount in interface UserQueryProvider
        Parameters:
        realm - the realm
        search - case insensitive list of strings separated by whitespaces.
        groupIds - set of groups IDs, the returned user needs to belong to at least one of them
        Returns:
        number of users that match the search and given groups
      • getUsersCount

        default int getUsersCount​(RealmModel realm,
                                  Map<String,​String> params)
        Description copied from interface: UserQueryProvider
        Returns the number of users that match the given filter parameters.
        Specified by:
        getUsersCount in interface UserQueryProvider
        Parameters:
        realm - the realm
        params - filter parameters
        Returns:
        number of users that match the given filters
      • getUsersCount

        default int getUsersCount​(RealmModel realm,
                                  Map<String,​String> params,
                                  Set<String> groupIds)
        Description copied from interface: UserQueryProvider
        Returns the number of users that match the given filter parameters and is in at least one of the given groups.
        Specified by:
        getUsersCount in interface UserQueryProvider
        Parameters:
        realm - the realm
        params - filter parameters
        groupIds - set if groups to check for
        Returns:
        number of users that match the given filters and groups
      • getUsersStream

        Stream<UserModel> getUsersStream​(RealmModel realm,
                                         Integer firstResult,
                                         Integer 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 or null.
        maxResults - maximum number of results to return. Ignored if negative or null.
        Returns:
        a non-null Stream of users.
      • searchForUser

        default List<UserModel> searchForUser​(String search,
                                              RealmModel realm)
        Description copied from interface: UserQueryProvider
        Searches for users whose username, email, first name or last name contain any of the strings in search separated by whitespace.

        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
        Parameters:
        search - case insensitive list of string separated by whitespaces.
        realm - realm to search within
        Returns:
        list of users that satisfies the given search condition
      • searchForUserStream

        default Stream<UserModel> searchForUserStream​(RealmModel realm,
                                                      String search)
        Description copied from interface: UserQueryProvider
        Searches for users whose username, email, first name or last name contain any of the strings in search separated by whitespace.

        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:
        realm - a reference to the realm.
        search - case insensitive list of string separated by whitespaces.
        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
        Searches for users whose username, email, first name or last name contain any of the strings in search separated by whitespace. The resulting user list should be paginated with respect to parameters firstResult and maxResults

        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
        Parameters:
        search - case insensitive list of string separated by whitespaces.
        realm - a reference to the realm
        firstResult - first result to return. Ignored if negative or zero.
        maxResults - maximum number of results to return. Ignored if negative.
        Returns:
        paginated list of users from the realm that satisfies given search
      • searchForUserStream

        Stream<UserModel> searchForUserStream​(RealmModel realm,
                                              String search,
                                              Integer firstResult,
                                              Integer maxResults)
        Description copied from interface: UserQueryProvider
        Searches for users whose username, email, first name or last name contain any of the strings in search separated by whitespace.

        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:
        realm - a reference to the realm.
        search - case insensitive list of string separated by whitespaces.
        firstResult - first result to return. Ignored if negative, zero, or null.
        maxResults - maximum number of results to return. Ignored if negative or null.
        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 a map of parameters.

        Valid parameters are:

        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
        Parameters:
        params - a map containing the search parameters
        realm - a reference to the realm
        Returns:
        list of users that satisfies given search conditions
      • searchForUserStream

        default Stream<UserModel> searchForUserStream​(RealmModel realm,
                                                      Map<String,​String> params)
        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:

        This method is used by the REST API when querying users.
        Specified by:
        searchForUserStream in interface UserQueryProvider
        Parameters:
        realm - a reference to the realm.
        params - a map containing the search parameters.
        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:

        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
        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.
      • searchForUserStream

        Stream<UserModel> searchForUserStream​(RealmModel realm,
                                              Map<String,​String> params,
                                              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:

        Any other parameters will be treated as custom user attributes. This method is used by the REST API when querying users.
        Specified by:
        searchForUserStream in interface UserQueryProvider
        Parameters:
        realm - a reference to the realm.
        params - a map containing the search parameters.
        firstResult - first result to return. Ignored if negative, zero, or null.
        maxResults - maximum number of results to return. Ignored if negative or null.
        Returns:
        a non-null Stream of users that match the search criteria.
      • getGroupMembers

        default List<UserModel> getGroupMembers​(RealmModel realm,
                                                GroupModel group,
                                                int firstResult,
                                                int maxResults)
        Description copied from interface: UserQueryProvider
        Gets paginated list of users that belong to a specific group.
        Specified by:
        getGroupMembers in interface UserQueryProvider
        Parameters:
        realm - a reference to the realm
        group - a reference to the group
        firstResult - first result to return. Ignored if negative or zero.
        maxResults - maximum number of results to return. Ignored if negative.
        Returns:
        paginated list of members of the given group
      • 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.
        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, zero, or null.
        maxResults - maximum number of results to return. Ignored if negative or null.
        Returns:
        a non-null Stream of users that belong to the group.
      • 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.
        Specified by:
        searchForUserByUserAttribute in interface UserQueryProvider
        Parameters:
        attrName - a name of the attribute that will be searched
        attrValue - a value of the attribute that will be searched
        realm - a reference to the realm
        Returns:
        list of users with the given attribute name and value