Package org.keycloak.storage.group
Interface GroupLookupProvider
-
- All Known Subinterfaces:
CacheRealmProvider,GroupProvider,GroupStorageProvider,RealmProvider
- All Known Implementing Classes:
GroupStorageManager,JpaRealmProvider,MapGroupProvider,MapRealmProvider,RealmCacheSession
public interface GroupLookupProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description GroupModelgetGroupById(RealmModel realm, String id)Returns a group from the given realm with the corresponding idStream<GroupModel>searchForGroupByNameStream(RealmModel realm, String search, Boolean exact, Integer firstResult, Integer maxResults)Returns the group hierarchy with the given string in name for the given realm.default Stream<GroupModel>searchForGroupByNameStream(RealmModel realm, String search, Integer firstResult, Integer maxResults)Deprecated.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.
-
-
-
Method Detail
-
getGroupById
GroupModel getGroupById(RealmModel realm, String id)
Returns a group from the given realm with the corresponding id- Parameters:
realm- Realm.id- Id.- Returns:
- GroupModel with the corresponding id.
-
searchForGroupByNameStream
@Deprecated default Stream<GroupModel> searchForGroupByNameStream(RealmModel realm, String search, Integer firstResult, Integer maxResults)
Deprecated.Returns the group hierarchy with the given string in name for the given realm. For a matching group node the parent group is fetched by id (with all children) and added to the result stream. This is done until the group node does not have a parent (root group)- 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 root groups that have the given string in their name themself or a group in their child-collection has.
The returned hierarchy contains siblings that do not necessarily have a matching name. 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 the group hierarchy with the given string in name for the given realm. For a matching group node the parent group is fetched by id (with all children) and added to the result stream. This is done until the group node does not have a parent (root group)- Parameters:
realm- Realm.search- Case sensitive searched string.exact- Boolean which defines wheather 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 root groups that have the given string in their name themself or a group in their child-collection has.
The returned hierarchy contains siblings that do not necessarily have a matching name. Never returns
null.
-
-