public interface UserQueryProvider
UserStorageProvider
that supports complex user querying. You must
implement this interface if you want to view and manage users from the administration console.
Note that all methods in this interface should limit search only to data available within the storage that is
represented by this provider. They should not lookup other storage providers for additional information.Modifier and Type | Interface and Description |
---|---|
static interface |
UserQueryProvider.Streams
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. |
Modifier and Type | Method and Description |
---|---|
static int |
countUsersInGroups(Stream<UserModel> users,
Set<String> groupIds)
Returns the number of users from the given list of users that are in at
least one of the groups given in the groups set.
|
List<UserModel> |
getGroupMembers(RealmModel realm,
GroupModel group)
Deprecated.
Use
getGroupMembersStream instead. |
List<UserModel> |
getGroupMembers(RealmModel realm,
GroupModel group,
int firstResult,
int maxResults)
Deprecated.
Use
getGroupMembersStream instead. |
default Stream<UserModel> |
getGroupMembersStream(RealmModel realm,
GroupModel group)
Obtains users that belong to a specific group.
|
default Stream<UserModel> |
getGroupMembersStream(RealmModel realm,
GroupModel group,
Integer firstResult,
Integer maxResults)
Obtains users that belong to a specific group.
|
default List<UserModel> |
getRoleMembers(RealmModel realm,
RoleModel role)
Deprecated.
Use
getRoleMembersStream instead. |
default List<UserModel> |
getRoleMembers(RealmModel realm,
RoleModel role,
int firstResult,
int maxResults)
Deprecated.
Use
getRoleMembersStream instead. |
default Stream<UserModel> |
getRoleMembersStream(RealmModel realm,
RoleModel role)
Obtains users that have the specified role.
|
default Stream<UserModel> |
getRoleMembersStream(RealmModel realm,
RoleModel role,
Integer firstResult,
Integer maxResults)
Searches for users that have the specified role.
|
List<UserModel> |
getUsers(RealmModel realm)
Deprecated.
Use
getUsersStream instead. |
List<UserModel> |
getUsers(RealmModel realm,
int firstResult,
int maxResults)
Deprecated.
Use
getUsersStream instead. |
default int |
getUsersCount(Map<String,String> params,
RealmModel realm)
Deprecated.
Use
getUsersCount instead. |
default int |
getUsersCount(Map<String,String> params,
RealmModel realm,
Set<String> groupIds)
Deprecated.
Use
getUsersCount instead. |
default int |
getUsersCount(RealmModel realm)
Returns the number of users, without consider any service account.
|
default int |
getUsersCount(RealmModel realm,
boolean includeServiceAccount)
Returns the number of users.
|
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,
Set<String> groupIds)
Returns the number of users that are in at least one of the groups
given.
|
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)
Deprecated.
Use
getUsersCount |
default int |
getUsersCount(String search,
RealmModel realm,
Set<String> groupIds)
Deprecated.
Use
getUsersCount instead. |
default Stream<UserModel> |
getUsersStream(RealmModel realm)
Searches all users in the realm.
|
default Stream<UserModel> |
getUsersStream(RealmModel realm,
Integer firstResult,
Integer maxResults)
Searches all users in the realm, starting from the
firstResult and containing at most maxResults . |
List<UserModel> |
searchForUser(Map<String,String> params,
RealmModel realm)
Deprecated.
Use
searchForUserStream instead. |
List<UserModel> |
searchForUser(Map<String,String> params,
RealmModel realm,
int firstResult,
int maxResults)
Deprecated.
Use
searchForUserStream instead. |
List<UserModel> |
searchForUser(String search,
RealmModel realm)
Deprecated.
Use
searchForUserStream instead. |
List<UserModel> |
searchForUser(String search,
RealmModel realm,
int firstResult,
int maxResults)
Deprecated.
Use
searchForUserStream instead. |
List<UserModel> |
searchForUserByUserAttribute(String attrName,
String attrValue,
RealmModel realm)
Deprecated.
Use
searchForUserByUserAttributeStream
instead. |
default 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.
|
default 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. |
default 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. |
default int getUsersCount(RealmModel realm)
realm
- the realmdefault int getUsersCount(RealmModel realm, Set<String> groupIds)
realm
- the realmgroupIds
- set of groups IDs, the returned user needs to belong to at least one of themdefault int getUsersCount(RealmModel realm, String search)
searchForUserStream
realm
- the realmsearch
- case insensitive list of strings separated by whitespaces.@Deprecated default int getUsersCount(String search, RealmModel realm)
getUsersCount
default int getUsersCount(RealmModel realm, String search, Set<String> groupIds)
searchForUserStream
and are members of at least one of the groups given by the groupIds
set.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 them@Deprecated default int getUsersCount(String search, RealmModel realm, Set<String> groupIds)
getUsersCount
instead.default int getUsersCount(RealmModel realm, Map<String,String> params)
realm
- the realmparams
- filter parameters@Deprecated default int getUsersCount(Map<String,String> params, RealmModel realm)
getUsersCount
instead.default int getUsersCount(RealmModel realm, Map<String,String> params, Set<String> groupIds)
params
- filter parametersrealm
- the realmgroupIds
- set if groups to check for@Deprecated default int getUsersCount(Map<String,String> params, RealmModel realm, Set<String> groupIds)
getUsersCount
instead.static int countUsersInGroups(Stream<UserModel> users, Set<String> groupIds)
users
- list of users to checkgroupIds
- id of groups that should be checked fordefault int getUsersCount(RealmModel realm, boolean includeServiceAccount)
realm
- the realmincludeServiceAccount
- if true, the number of users will also include service accounts. Otherwise, only the number of users.@Deprecated List<UserModel> getUsers(RealmModel realm)
getUsersStream
instead.default Stream<UserModel> getUsersStream(RealmModel realm)
realm
- a reference to the realm.Stream
of users.@Deprecated List<UserModel> getUsers(RealmModel realm, int firstResult, int maxResults)
getUsersStream
instead.default Stream<UserModel> getUsersStream(RealmModel realm, Integer firstResult, Integer maxResults)
firstResult
and containing at most maxResults
.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.@Deprecated List<UserModel> searchForUser(String search, RealmModel realm)
searchForUserStream
instead.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 boxsearch
- case insensitive list of string separated by whitespaces.realm
- realm to search withindefault Stream<UserModel> searchForUserStream(RealmModel realm, String search)
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 boxrealm
- a reference to the realm.search
- case insensitive list of string separated by whitespaces.Stream
of users that match the search string.@Deprecated List<UserModel> searchForUser(String search, RealmModel realm, int firstResult, int maxResults)
searchForUserStream
instead.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 boxsearch
- 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.default Stream<UserModel> searchForUserStream(RealmModel realm, String search, Integer firstResult, Integer maxResults)
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 boxrealm
- 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.@Deprecated List<UserModel> searchForUser(Map<String,String> params, RealmModel realm)
searchForUserStream
instead.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)params
- a map containing the search parametersrealm
- a reference to the realmdefault Stream<UserModel> searchForUserStream(RealmModel realm, Map<String,String> params)
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)realm
- a reference to the realm.params
- a map containing the search parameters.Stream
of users that match the search parameters.@Deprecated List<UserModel> searchForUser(Map<String,String> params, RealmModel realm, int firstResult, int maxResults)
searchForUserStream
instead.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)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.default Stream<UserModel> searchForUserStream(RealmModel realm, Map<String,String> params, Integer firstResult, Integer maxResults)
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)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.@Deprecated List<UserModel> getGroupMembers(RealmModel realm, GroupModel group)
getGroupMembersStream
instead.realm
- a reference to the realmgroup
- a reference to the groupdefault Stream<UserModel> getGroupMembersStream(RealmModel realm, GroupModel group)
realm
- a reference to the realm.group
- a reference to the group.Stream
of users that belong to the group.@Deprecated List<UserModel> getGroupMembers(RealmModel realm, GroupModel group, int firstResult, int maxResults)
getGroupMembersStream
instead.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.default Stream<UserModel> getGroupMembersStream(RealmModel realm, GroupModel group, Integer firstResult, Integer maxResults)
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.@Deprecated default List<UserModel> getRoleMembers(RealmModel realm, RoleModel role)
getRoleMembersStream
instead.realm
- a reference to the realmrole
- a reference to the roledefault Stream<UserModel> getRoleMembersStream(RealmModel realm, RoleModel role)
realm
- a reference to the realm.role
- a reference to the role.Stream
of users that have the specified role.@Deprecated default List<UserModel> getRoleMembers(RealmModel realm, RoleModel role, int firstResult, int maxResults)
getRoleMembersStream
instead.realm
- a reference to the realmrole
- a reference to the rolefirstResult
- first result to return. Ignored if negative or zero.maxResults
- maximum number of results to return. Ignored if negative.default Stream<UserModel> getRoleMembersStream(RealmModel realm, RoleModel role, Integer firstResult, Integer maxResults)
realm
- a reference to the realm.role
- a reference to the role.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 that have the specified role.@Deprecated List<UserModel> searchForUserByUserAttribute(String attrName, String attrValue, RealmModel realm)
searchForUserByUserAttributeStream
instead.attrName
- a name of the attribute that will be searchedattrValue
- a value of the attribute that will be searchedrealm
- a reference to the realmdefault Stream<UserModel> searchForUserByUserAttributeStream(RealmModel realm, String attrName, String attrValue)
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.