public static interface UserQueryProvider.Streams extends UserQueryProvider
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.UserQueryProvider.Streams
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)
Gets paginated list of users that belong to a specific group.
|
default 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) |
default int |
getUsersCount(Map<String,String> params,
RealmModel realm) |
default int |
getUsersCount(Map<String,String> params,
RealmModel realm,
Set<String> groupIds) |
default int |
getUsersCount(RealmModel realm,
Map<String,String> params)
Returns the number of users that match the given filter parameters.
|
default int |
getUsersCount(RealmModel realm,
Map<String,String> params,
Set<String> groupIds)
Returns the number of users that match the given filter parameters and is in
at least one of the given groups.
|
default int |
getUsersCount(RealmModel realm,
String search)
Returns the number of users that would be returned by a call to
searchForUserStream |
default int |
getUsersCount(RealmModel realm,
String search,
Set<String> groupIds)
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. |
default int |
getUsersCount(String search,
RealmModel realm) |
default int |
getUsersCount(String search,
RealmModel realm,
Set<String> groupIds) |
default Stream<UserModel> |
getUsersStream(RealmModel realm)
Searches all users in the realm.
|
Stream<UserModel> |
getUsersStream(RealmModel realm,
Integer firstResult,
Integer 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 a map of parameters.
|
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)
Searches for users whose username, email, first name or last name contain any of the strings in
search separated by whitespace. |
default List<UserModel> |
searchForUser(String search,
RealmModel realm,
int firstResult,
int maxResults)
Searches for users whose username, email, first name or last name contain any of the strings in
search separated by whitespace. |
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(RealmModel realm,
String attrName,
String attrValue)
Searches for users that have a specific attribute with a specific value.
|
default Stream<UserModel> |
searchForUserStream(RealmModel realm,
Map<String,String> params)
Searches for user by parameter.
|
Stream<UserModel> |
searchForUserStream(RealmModel realm,
Map<String,String> params,
Integer firstResult,
Integer maxResults)
Searches for user by parameter.
|
default Stream<UserModel> |
searchForUserStream(RealmModel realm,
String search)
Searches for users whose username, email, first name or last name contain any of the strings in
search separated by whitespace. |
Stream<UserModel> |
searchForUserStream(RealmModel realm,
String search,
Integer firstResult,
Integer maxResults)
Searches for users whose username, email, first name or last name contain any of the strings in
search separated by whitespace. |
countUsersInGroups, getRoleMembers, getRoleMembers, getRoleMembersStream, getRoleMembersStream, getUsersCount, getUsersCount, getUsersCount
default int getUsersCount(RealmModel realm, String search)
UserQueryProvider
searchForUserStream
getUsersCount
in interface UserQueryProvider
realm
- the realmsearch
- case insensitive list of strings separated by whitespaces.default int getUsersCount(String search, RealmModel realm)
getUsersCount
in interface UserQueryProvider
default int getUsersCount(RealmModel realm, String search, Set<String> groupIds)
UserQueryProvider
searchForUserStream
and are members of at least one of the groups given by the groupIds
set.getUsersCount
in interface UserQueryProvider
realm
- the realmsearch
- case insensitive list of strings separated by whitespaces.groupIds
- set of groups IDs, the returned user needs to belong to at least one of themdefault int getUsersCount(String search, RealmModel realm, Set<String> groupIds)
getUsersCount
in interface UserQueryProvider
default int getUsersCount(RealmModel realm, Map<String,String> params)
UserQueryProvider
getUsersCount
in interface UserQueryProvider
realm
- the realmparams
- filter parametersdefault int getUsersCount(Map<String,String> params, RealmModel realm)
getUsersCount
in interface UserQueryProvider
default int getUsersCount(RealmModel realm, Map<String,String> params, Set<String> groupIds)
UserQueryProvider
getUsersCount
in interface UserQueryProvider
realm
- the realmparams
- filter parametersgroupIds
- set if groups to check fordefault int getUsersCount(Map<String,String> params, RealmModel realm, Set<String> groupIds)
getUsersCount
in interface UserQueryProvider
default List<UserModel> getUsers(RealmModel realm)
getUsers
in interface UserQueryProvider
default Stream<UserModel> getUsersStream(RealmModel realm)
UserQueryProvider
getUsersStream
in interface UserQueryProvider
realm
- a reference to the realm.Stream
of users.default List<UserModel> getUsers(RealmModel realm, int firstResult, int maxResults)
getUsers
in interface UserQueryProvider
Stream<UserModel> getUsersStream(RealmModel realm, Integer firstResult, Integer maxResults)
UserQueryProvider
firstResult
and containing at most maxResults
.getUsersStream
in interface UserQueryProvider
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
.Stream
of users.default List<UserModel> searchForUser(String search, RealmModel realm)
UserQueryProvider
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 boxsearchForUser
in interface UserQueryProvider
search
- case insensitive list of string separated by whitespaces.realm
- realm to search withindefault Stream<UserModel> searchForUserStream(RealmModel realm, String search)
UserQueryProvider
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 boxsearchForUserStream
in interface UserQueryProvider
realm
- a reference to the realm.search
- case insensitive list of string separated by whitespaces.Stream
of users that match the search string.default List<UserModel> searchForUser(String search, RealmModel realm, int firstResult, int maxResults)
UserQueryProvider
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 boxsearchForUser
in interface UserQueryProvider
search
- case insensitive list of string separated by whitespaces.realm
- a reference to the realmfirstResult
- first result to return. Ignored if negative or zero.maxResults
- maximum number of results to return. Ignored if negative.Stream<UserModel> searchForUserStream(RealmModel realm, String search, Integer firstResult, Integer maxResults)
UserQueryProvider
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 boxsearchForUserStream
in interface UserQueryProvider
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
.Stream
of users that match the search criteria.default List<UserModel> searchForUser(Map<String,String> params, RealmModel realm)
UserQueryProvider
UserModel.FIRST_NAME
- first name (case insensitive string)UserModel.LAST_NAME
- last name (case insensitive string)UserModel.EMAIL
- email (case insensitive string)UserModel.USERNAME
- username (case insensitive string)UserModel.EMAIL_VERIFIED
- search only for users with verified/non-verified email (true/false)UserModel.ENABLED
- search only for enabled/disabled users (true/false)UserModel.IDP_ALIAS
- search only for users that have a federated identity
from idp with the given alias configured (case sensitive string)UserModel.IDP_USER_ID
- search for users with federated identity with
the given userId (case sensitive string)searchForUser
in interface UserQueryProvider
params
- a map containing the search parametersrealm
- a reference to the realmdefault Stream<UserModel> searchForUserStream(RealmModel realm, Map<String,String> params)
UserQueryProvider
UserModel.FIRST_NAME
- first name (case insensitive string)UserModel.LAST_NAME
- last name (case insensitive string)UserModel.EMAIL
- email (case insensitive string)UserModel.USERNAME
- username (case insensitive string)UserModel.EMAIL_VERIFIED
- search only for users with verified/non-verified email (true/false)UserModel.ENABLED
- search only for enabled/disabled users (true/false)UserModel.IDP_ALIAS
- search only for users that have a federated identity
from idp with the given alias configured (case sensitive string)UserModel.IDP_USER_ID
- search for users with federated identity with
the given userId (case sensitive string)searchForUserStream
in interface UserQueryProvider
realm
- a reference to the realm.params
- a map containing the search parameters.Stream
of users that match the search parameters.default List<UserModel> searchForUser(Map<String,String> params, RealmModel realm, int firstResult, int maxResults)
UserQueryProvider
UserModel.FIRST_NAME
- first name (case insensitive string)UserModel.LAST_NAME
- last name (case insensitive string)UserModel.EMAIL
- email (case insensitive string)UserModel.USERNAME
- username (case insensitive string)UserModel.EMAIL_VERIFIED
- search only for users with verified/non-verified email (true/false)UserModel.ENABLED
- search only for enabled/disabled users (true/false)UserModel.IDP_ALIAS
- search only for users that have a federated identity
from idp with the given alias configured (case sensitive string)UserModel.IDP_USER_ID
- search for users with federated identity with
the given userId (case sensitive string)searchForUser
in interface UserQueryProvider
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.Stream
of users that match the search criteria.Stream<UserModel> searchForUserStream(RealmModel realm, Map<String,String> params, Integer firstResult, Integer maxResults)
UserQueryProvider
UserModel.FIRST_NAME
- first name (case insensitive string)UserModel.LAST_NAME
- last name (case insensitive string)UserModel.EMAIL
- email (case insensitive string)UserModel.USERNAME
- username (case insensitive string)UserModel.EMAIL_VERIFIED
- search only for users with verified/non-verified email (true/false)UserModel.ENABLED
- search only for enabled/disabled users (true/false)UserModel.IDP_ALIAS
- search only for users that have a federated identity
from idp with the given alias configured (case sensitive string)UserModel.IDP_USER_ID
- search for users with federated identity with
the given userId (case sensitive string)searchForUserStream
in interface UserQueryProvider
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
.Stream
of users that match the search criteria.default List<UserModel> getGroupMembers(RealmModel realm, GroupModel group)
UserQueryProvider
getGroupMembers
in interface UserQueryProvider
realm
- a reference to the realmgroup
- a reference to the groupdefault Stream<UserModel> getGroupMembersStream(RealmModel realm, GroupModel group)
UserQueryProvider
getGroupMembersStream
in interface UserQueryProvider
realm
- a reference to the realm.group
- a reference to the group.Stream
of users that belong to the group.default List<UserModel> getGroupMembers(RealmModel realm, GroupModel group, int firstResult, int maxResults)
UserQueryProvider
getGroupMembers
in interface UserQueryProvider
realm
- a reference to the realmgroup
- a reference to the groupfirstResult
- first result to return. Ignored if negative or zero.maxResults
- maximum number of results to return. Ignored if negative.Stream<UserModel> getGroupMembersStream(RealmModel realm, GroupModel group, Integer firstResult, Integer maxResults)
UserQueryProvider
getGroupMembersStream
in interface UserQueryProvider
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
.Stream
of users that belong to the group.default List<UserModel> searchForUserByUserAttribute(String attrName, String attrValue, RealmModel realm)
UserQueryProvider
searchForUserByUserAttribute
in interface UserQueryProvider
attrName
- a name of the attribute that will be searchedattrValue
- a value of the attribute that will be searchedrealm
- a reference to the realmStream<UserModel> searchForUserByUserAttributeStream(RealmModel realm, String attrName, String attrValue)
UserQueryProvider
searchForUserByUserAttributeStream
in interface UserQueryProvider
realm
- a reference to the realm.attrName
- the attribute name.attrValue
- the attribute value.Stream
of users that match the search criteria.Copyright © 2021 JBoss by Red Hat. All rights reserved.