Package org.keycloak.storage.adapter
Class AbstractUserAdapter.Streams
java.lang.Object
org.keycloak.models.UserModelDefaultMethods
org.keycloak.storage.adapter.AbstractUserAdapter
org.keycloak.storage.adapter.AbstractUserAdapter.Streams
- All Implemented Interfaces:
RoleMapperModel
,UserModel
- Enclosing class:
- AbstractUserAdapter
public abstract static class AbstractUserAdapter.Streams
extends AbstractUserAdapter
implements UserModel
The
AbstractUserAdapter.Streams
interface makes all collection-based methods in AbstractUserAdapter
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.-
Nested Class Summary
Nested classes/interfaces inherited from class org.keycloak.storage.adapter.AbstractUserAdapter
AbstractUserAdapter.Streams
Nested classes/interfaces inherited from interface org.keycloak.models.UserModel
UserModel.RequiredAction, UserModel.SearchableFields, UserModel.UserRemovedEvent
-
Field Summary
Fields inherited from class org.keycloak.storage.adapter.AbstractUserAdapter
created, realm, session, storageId, storageProviderModel
Fields inherited from interface org.keycloak.models.UserModel
COMPARE_BY_USERNAME, DISABLED_REASON, EMAIL, EMAIL_VERIFIED, ENABLED, EXACT, FIRST_NAME, GROUPS, IDP_ALIAS, IDP_USER_ID, INCLUDE_SERVICE_ACCOUNT, LAST_NAME, LOCALE, SEARCH, USERNAME
-
Constructor Summary
ConstructorDescriptionStreams
(KeycloakSession session, RealmModel realm, ComponentModel storageProviderModel) -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String name) getAttributeStream
(String name) Obtains all values associated with the specified attribute name.Returns stream of client roles that are directly set to this object for the given client.Obtains the groups associated with the user.Returns stream of realm roles that are directly set to this object.Obtains the names of required actions associated with the user.Returns stream of all role (both realm all client) that are directly set to this object.boolean
Returnstrue
if this object is directly or indirectly assigned the given role,false
otherwise.boolean
isMemberOf
(GroupModel group) Methods inherited from class org.keycloak.storage.adapter.AbstractUserAdapter
addRequiredAction, addRequiredAction, appendDefaultGroups, appendDefaultRolesToRoleMappings, deleteRoleMapping, equals, getAttributes, getCreatedTimestamp, getEmail, getFederationLink, getFirstAttribute, getFirstName, getGroupsInternal, getId, getLastName, getRoleMappingsInternal, getServiceAccountClientLink, grantRole, hashCode, isEmailVerified, isEnabled, joinGroup, leaveGroup, removeAttribute, removeRequiredAction, removeRequiredAction, setAttribute, setCreatedTimestamp, setEmail, setEmailVerified, setEnabled, setFederationLink, setFirstName, setLastName, setServiceAccountClientLink, setSingleAttribute, setUsername
Methods inherited from class org.keycloak.models.UserModelDefaultMethods
toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.keycloak.models.RoleMapperModel
deleteRoleMapping, grantRole, hasDirectRole
Methods inherited from interface org.keycloak.models.UserModel
addRequiredAction, addRequiredAction, credentialManager, getAttributes, getCreatedTimestamp, getEmail, getFederationLink, getFirstAttribute, getFirstName, getGroupsCount, getGroupsCountByNameContaining, getGroupsStream, getId, getLastName, getServiceAccountClientLink, getUsername, isEmailVerified, isEnabled, joinGroup, leaveGroup, removeAttribute, removeRequiredAction, removeRequiredAction, setAttribute, setCreatedTimestamp, setEmail, setEmailVerified, setEnabled, setFederationLink, setFirstName, setLastName, setServiceAccountClientLink, setSingleAttribute, setUsername
-
Constructor Details
-
Streams
-
-
Method Details
-
getRequiredActions
- Overrides:
getRequiredActions
in classAbstractUserAdapter
-
getRequiredActionsStream
Description copied from interface:UserModel
Obtains the names of required actions associated with the user.- Specified by:
getRequiredActionsStream
in interfaceUserModel
- Overrides:
getRequiredActionsStream
in classAbstractUserAdapter
- Returns:
- a non-null
Stream
of required action names.
-
getAttribute
- Overrides:
getAttribute
in classAbstractUserAdapter
-
getAttributeStream
Description copied from interface:UserModel
Obtains all values associated with the specified attribute name.- Specified by:
getAttributeStream
in interfaceUserModel
- Overrides:
getAttributeStream
in classAbstractUserAdapter
- Parameters:
name
- the name of the attribute.- Returns:
- a non-null
Stream
of attribute values.
-
getGroups
- Overrides:
getGroups
in classAbstractUserAdapter
-
getGroupsStream
Description copied from interface:UserModel
Obtains the groups associated with the user.- Specified by:
getGroupsStream
in interfaceUserModel
- Overrides:
getGroupsStream
in classAbstractUserAdapter
- Returns:
- a non-null
Stream
of groups.
-
isMemberOf
- Specified by:
isMemberOf
in interfaceUserModel
- Overrides:
isMemberOf
in classAbstractUserAdapter
-
getRealmRoleMappings
- Overrides:
getRealmRoleMappings
in classAbstractUserAdapter
-
getRealmRoleMappingsStream
Description copied from interface:RoleMapperModel
Returns stream of realm roles that are directly set to this object.- Specified by:
getRealmRoleMappingsStream
in interfaceRoleMapperModel
- Overrides:
getRealmRoleMappingsStream
in classAbstractUserAdapter
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getClientRoleMappings
- Overrides:
getClientRoleMappings
in classAbstractUserAdapter
-
getClientRoleMappingsStream
Description copied from interface:RoleMapperModel
Returns stream of client roles that are directly set to this object for the given client.- Specified by:
getClientRoleMappingsStream
in interfaceRoleMapperModel
- Overrides:
getClientRoleMappingsStream
in classAbstractUserAdapter
- Parameters:
app
-ClientModel
Client to get the roles for.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getRoleMappings
- Overrides:
getRoleMappings
in classAbstractUserAdapter
-
getRoleMappingsStream
Description copied from interface:RoleMapperModel
Returns stream of all role (both realm all client) that are directly set to this object.- Specified by:
getRoleMappingsStream
in interfaceRoleMapperModel
- Overrides:
getRoleMappingsStream
in classAbstractUserAdapter
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
hasRole
Description copied from interface:RoleMapperModel
Returnstrue
if this object is directly or indirectly assigned the given role,false
otherwise.For example,
true
is returned for hasRole(R) if:- R is directly assigned to this object
- R is indirectly assigned to this object via composites
- R is not assigned to this object but this object belongs to a group G which is assigned the role R
- R is not assigned to this object but this object belongs to a group G, and G belongs to group H which is assigned the role R
- Specified by:
hasRole
in interfaceRoleMapperModel
- Overrides:
hasRole
in classAbstractUserAdapter
- Returns:
- see description
- See Also:
-