Package org.keycloak.storage.user
Interface UserCountMethodsProvider
- All Known Subinterfaces:
UserCache
,UserProvider
,UserQueryProvider
- All Known Implementing Classes:
JpaUserProvider
,UserCacheSession
,UserStorageManager
public interface UserCountMethodsProvider
This is an optional capability interface that is intended to be implemented by
UserStorageProvider
that supports count queries.
By implementing this interface, count queries could be leveraged when querying users with some offset (firstResult
).
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.-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.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, String search) Deprecated.default int
getUsersCount
(RealmModel realm, String search, Set<String> groupIds) Deprecated.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.
-
Method Details
-
getUsersCount
Returns the number of users, without consider any service account.- Parameters:
realm
- the realm- Returns:
- the number of users
-
getUsersCount
Returns the number of users that are in at least one of the groups given.- Parameters:
realm
- the realmgroupIds
- set of groups IDs, the returned user needs to belong to at least one of them- Returns:
- the number of users that are in at least one of the groups
-
getUsersCount
Deprecated.Returns the number of users that would be returned by a call tosearchForUserStream
- Parameters:
realm
- the realmsearch
- case insensitive list of strings separated by whitespaces.- Returns:
- number of users that match the search
-
getUsersCount
Deprecated.Returns the number of users that would be returned by a call tosearchForUserStream
and are members of at least one of the groups given by thegroupIds
set.- Parameters:
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- Returns:
- number of users that match the search and given groups
-
getUsersCount
Returns the number of users that match the given filter parameters.- Parameters:
realm
- the realmparams
- filter parameters- Returns:
- number of users that match the given filters
-
getUsersCount
Returns the number of users that match the given filter parameters and is in at least one of the given groups.- Parameters:
params
- filter parametersrealm
- the realmgroupIds
- set if groups to check for- Returns:
- number of users that match the given filters and groups
-
countUsersInGroups
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.- Parameters:
users
- list of users to checkgroupIds
- id of groups that should be checked for- Returns:
- number of users that are in at least one of the groups
-
getUsersCount
Returns the number of users.- Parameters:
realm
- the realmincludeServiceAccount
- if true, the number of users will also include service accounts. Otherwise, only the number of users.- Returns:
- the number of users
-
getUsersCount(RealmModel, Map)
with anparams
map containingUserModel.SEARCH
instead.