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 TheStreams(org.keycloak.models.KeycloakSession,org.keycloak.models.RealmModel,org.keycloak.component.ComponentModel)interface makes all collection-based methods inAbstractUserAdapterdefault by providing implementations that delegate to theStream-based variants instead of the other way around. It allows for implementations to focus on theStream-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.AbstractUserAdapterAbstractUserAdapter.Streams
 - 
Nested classes/interfaces inherited from interface org.keycloak.models.UserModelUserModel.RequiredAction, UserModel.SearchableFields, UserModel.Streams, UserModel.UserRemovedEvent
 
- 
 - 
Field Summary- 
Fields inherited from class org.keycloak.storage.adapter.AbstractUserAdaptercreated, realm, session, storageId, storageProviderModel
 - 
Fields inherited from interface org.keycloak.models.UserModelCOMPARE_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 SummaryConstructors Constructor Description Streams(KeycloakSession session, RealmModel realm, ComponentModel storageProviderModel)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getAttribute(String name)Stream<String>getAttributeStream(String name)Obtains all values associated with the specified attribute name.Set<RoleModel>getClientRoleMappings(ClientModel app)Stream<RoleModel>getClientRoleMappingsStream(ClientModel app)Returns stream of client roles that are directly set to this object for the given client.Set<GroupModel>getGroups()Stream<GroupModel>getGroupsStream()Obtains the groups associated with the user.Set<RoleModel>getRealmRoleMappings()Stream<RoleModel>getRealmRoleMappingsStream()Returns stream of realm roles that are directly set to this object.Set<String>getRequiredActions()Stream<String>getRequiredActionsStream()Obtains the names of required actions associated with the user.Set<RoleModel>getRoleMappings()Stream<RoleModel>getRoleMappingsStream()Returns stream of all role (both realm all client) that are directly set to this object.booleanhasRole(RoleModel role)Returnstrueif this object is directly or indirectly assigned the given role,falseotherwise.booleanisMemberOf(GroupModel group)- 
Methods inherited from class org.keycloak.storage.adapter.AbstractUserAdapteraddRequiredAction, 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.UserModelDefaultMethodstoString
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.models.RoleMapperModeldeleteRoleMapping, grantRole, hasDirectRole
 - 
Methods inherited from interface org.keycloak.models.UserModeladdRequiredAction, 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 Detail- 
Streamspublic Streams(KeycloakSession session, RealmModel realm, ComponentModel storageProviderModel) 
 
- 
 - 
Method Detail- 
getRequiredActionspublic Set<String> getRequiredActions() - Overrides:
- getRequiredActionsin class- AbstractUserAdapter
 
 - 
getRequiredActionsStreampublic Stream<String> getRequiredActionsStream() Description copied from interface:UserModelObtains the names of required actions associated with the user.- Specified by:
- getRequiredActionsStreamin interface- UserModel
- Overrides:
- getRequiredActionsStreamin class- AbstractUserAdapter
- Returns:
- a non-null Streamof required action names.
 
 - 
getAttributepublic List<String> getAttribute(String name) - Overrides:
- getAttributein class- AbstractUserAdapter
 
 - 
getAttributeStreampublic Stream<String> getAttributeStream(String name) Description copied from interface:UserModelObtains all values associated with the specified attribute name.- Specified by:
- getAttributeStreamin interface- UserModel
- Overrides:
- getAttributeStreamin class- AbstractUserAdapter
- Parameters:
- name- the name of the attribute.
- Returns:
- a non-null Streamof attribute values.
 
 - 
getGroupspublic Set<GroupModel> getGroups() - Overrides:
- getGroupsin class- AbstractUserAdapter
 
 - 
getGroupsStreampublic Stream<GroupModel> getGroupsStream() Description copied from interface:UserModelObtains the groups associated with the user.- Specified by:
- getGroupsStreamin interface- UserModel
- Overrides:
- getGroupsStreamin class- AbstractUserAdapter
- Returns:
- a non-null Streamof groups.
 
 - 
isMemberOfpublic boolean isMemberOf(GroupModel group) - Specified by:
- isMemberOfin interface- UserModel
- Overrides:
- isMemberOfin class- AbstractUserAdapter
 
 - 
getRealmRoleMappingspublic Set<RoleModel> getRealmRoleMappings() - Overrides:
- getRealmRoleMappingsin class- AbstractUserAdapter
 
 - 
getRealmRoleMappingsStreampublic Stream<RoleModel> getRealmRoleMappingsStream() Description copied from interface:RoleMapperModelReturns stream of realm roles that are directly set to this object.- Specified by:
- getRealmRoleMappingsStreamin interface- RoleMapperModel
- Overrides:
- getRealmRoleMappingsStreamin class- AbstractUserAdapter
- Returns:
- Stream of RoleModel. Never returnsnull.
 
 - 
getClientRoleMappingspublic Set<RoleModel> getClientRoleMappings(ClientModel app) - Overrides:
- getClientRoleMappingsin class- AbstractUserAdapter
 
 - 
getClientRoleMappingsStreampublic Stream<RoleModel> getClientRoleMappingsStream(ClientModel app) Description copied from interface:RoleMapperModelReturns stream of client roles that are directly set to this object for the given client.- Specified by:
- getClientRoleMappingsStreamin interface- RoleMapperModel
- Overrides:
- getClientRoleMappingsStreamin class- AbstractUserAdapter
- Parameters:
- app-- ClientModelClient to get the roles for.
- Returns:
- Stream of RoleModel. Never returnsnull.
 
 - 
getRoleMappingspublic Set<RoleModel> getRoleMappings() - Overrides:
- getRoleMappingsin class- AbstractUserAdapter
 
 - 
getRoleMappingsStreampublic Stream<RoleModel> getRoleMappingsStream() Description copied from interface:RoleMapperModelReturns stream of all role (both realm all client) that are directly set to this object.- Specified by:
- getRoleMappingsStreamin interface- RoleMapperModel
- Overrides:
- getRoleMappingsStreamin class- AbstractUserAdapter
- Returns:
- Stream of RoleModel. Never returnsnull.
 
 - 
hasRolepublic boolean hasRole(RoleModel role) Description copied from interface:RoleMapperModelReturnstrueif this object is directly or indirectly assigned the given role,falseotherwise.For example, trueis 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:
- hasRolein interface- RoleMapperModel
- Overrides:
- hasRolein class- AbstractUserAdapter
- Returns:
- see description
- See Also:
- if you want to check if this object is directly assigned to a role
 
 
- 
 
-