Package org.keycloak.storage.group
Interface GroupLookupProvider
- All Known Subinterfaces:
CacheRealmProvider,GroupProvider,GroupStorageProvider
- All Known Implementing Classes:
GroupStorageManager,JpaRealmProvider,RealmCacheSession
public interface GroupLookupProvider
-
Method Summary
Modifier and TypeMethodDescriptiongetGroupById(RealmModel realm, String id) Returns a group from the given realm with the corresponding iddefault GroupModelgetGroupByName(RealmModel realm, GroupModel parent, String name) Returns a group from the given realm with the corresponding name and parentsearchForGroupByNameStream(RealmModel realm, String search, Boolean exact, Integer firstResult, Integer maxResults) Returns groups with the given string in their name for the given realm.default Stream<GroupModel>searchForGroupByNameStream(RealmModel realm, String search, Integer firstResult, Integer maxResults) Deprecated.searchGroupsByAttributes(RealmModel realm, Map<String, String> attributes, Integer firstResult, Integer maxResults) Returns the groups filtered by attribute names and attribute values for the given realm.
-
Method Details
-
getGroupById
Returns a group from the given realm with the corresponding id- Parameters:
realm- Realm.id- Id.- Returns:
- GroupModel with the corresponding id.
-
getGroupByName
Returns a group from the given realm with the corresponding name and parent- Parameters:
realm- Realm.parent- parent Group. Ifnulltop level groups are searchedname- name.- Returns:
- GroupModel with the corresponding name.
-
searchForGroupByNameStream
@Deprecated default Stream<GroupModel> searchForGroupByNameStream(RealmModel realm, String search, Integer firstResult, Integer maxResults) Deprecated.Returns groups with the given string in their name for the given realm.- Parameters:
realm- Realm.search- Case sensitive searched string.firstResult- First result to return. Ignored if negative ornull.maxResults- Maximum number of results to return. Ignored if negative ornull.- Returns:
- Stream of groups that match the search string at any level in the group hierarchy. Never returns
null.
-
searchGroupsByAttributes
Stream<GroupModel> searchGroupsByAttributes(RealmModel realm, Map<String, String> attributes, Integer firstResult, Integer maxResults) Returns the groups filtered by attribute names and attribute values for the given realm.- Parameters:
realm- Realm.attributes- name-value pairs that are compared to group attributes.firstResult- First result to return. Ignored if negative ornull.maxResults- Maximum number of results to return. Ignored if negative ornull.- Returns:
- Stream of groups with attributes matching all searched attributes. Never returns
null.
-
searchForGroupByNameStream
Stream<GroupModel> searchForGroupByNameStream(RealmModel realm, String search, Boolean exact, Integer firstResult, Integer maxResults) Returns groups with the given string in their name for the given realm. Groups are searched at any level in the hierarchy (top-level and nested subgroups).- Parameters:
realm- Realm.search- Case sensitive searched string.exact- Boolean which defines whether search param should be matched exactly.firstResult- First result to return. Ignored if negative ornull.maxResults- Maximum number of results to return. Ignored if negative ornull.- Returns:
- Stream of groups that match the search string at any level in the group hierarchy. Never returns
null.
-
searchForGroupByNameStream(RealmModel, String, Boolean, Integer, Integer)instead.