public abstract static class AbstractUserAdapter.Streams extends AbstractUserAdapter implements UserModel.Streams
AbstractUserAdapter.Streams
class extends the AbstractUserAdapter
abstract class and implements
the UserModel.Streams
interface, allowing subclasses to focus on the implementation of the Stream
-based
query methods and providing default implementations for the collections-based variants that delegate to their
Stream
counterparts.AbstractUserAdapter.Streams
UserModel.RequiredAction, UserModel.SearchableFields, UserModel.Streams, UserModel.UserRemovedEvent
created, realm, session, storageId, storageProviderModel
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 and Description |
---|
Streams(KeycloakSession session,
RealmModel realm,
ComponentModel storageProviderModel) |
Modifier and Type | Method and 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)
Returns set of client roles that are directly set to this object for the given client.
|
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()
Returns set of realm roles that are directly set to this object.
|
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()
Returns set of all role (both realm all client) that are directly set to this object.
|
Stream<RoleModel> |
getRoleMappingsStream()
Returns stream of all role (both realm all client) that are directly set to this object.
|
boolean |
hasRole(RoleModel role)
Returns
true if this object is directly or indirectly assigned the given role, false otherwise. |
boolean |
isMemberOf(GroupModel group) |
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
toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addRequiredAction, addRequiredAction, getAttributes, getCreatedTimestamp, getEmail, getFederationLink, getFirstAttribute, getFirstName, getGroups, getGroups, 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
deleteRoleMapping, grantRole
public Streams(KeycloakSession session, RealmModel realm, ComponentModel storageProviderModel)
public Set<String> getRequiredActions()
getRequiredActions
in interface UserModel
getRequiredActions
in interface UserModel.Streams
getRequiredActions
in class AbstractUserAdapter
public Stream<String> getRequiredActionsStream()
UserModel
getRequiredActionsStream
in interface UserModel
getRequiredActionsStream
in interface UserModel.Streams
Stream
of required action names.public List<String> getAttribute(String name)
getAttribute
in interface UserModel
getAttribute
in interface UserModel.Streams
getAttribute
in class AbstractUserAdapter
public Stream<String> getAttributeStream(String name)
UserModel
getAttributeStream
in interface UserModel
getAttributeStream
in interface UserModel.Streams
name
- the name of the attribute.Stream
of attribute values.public Set<GroupModel> getGroups()
getGroups
in interface UserModel
getGroups
in interface UserModel.Streams
getGroups
in class AbstractUserAdapter
public Stream<GroupModel> getGroupsStream()
UserModel
getGroupsStream
in interface UserModel
getGroupsStream
in interface UserModel.Streams
Stream
of groups.public boolean isMemberOf(GroupModel group)
isMemberOf
in interface UserModel
isMemberOf
in class AbstractUserAdapter
public Set<RoleModel> getRealmRoleMappings()
RoleMapperModel
getRealmRoleMappings
in interface RoleMapperModel
getRealmRoleMappings
in interface RoleMapperModel.Streams
getRealmRoleMappings
in class AbstractUserAdapter
public Stream<RoleModel> getRealmRoleMappingsStream()
RoleMapperModel
getRealmRoleMappingsStream
in interface RoleMapperModel
getRealmRoleMappingsStream
in interface RoleMapperModel.Streams
RoleModel
. Never returns null
.public Set<RoleModel> getClientRoleMappings(ClientModel app)
RoleMapperModel
getClientRoleMappings
in interface RoleMapperModel
getClientRoleMappings
in interface RoleMapperModel.Streams
getClientRoleMappings
in class AbstractUserAdapter
app
- Client to get the roles forpublic Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
RoleMapperModel
getClientRoleMappingsStream
in interface RoleMapperModel
getClientRoleMappingsStream
in interface RoleMapperModel.Streams
app
- ClientModel
Client to get the roles for.RoleModel
. Never returns null
.public Set<RoleModel> getRoleMappings()
RoleMapperModel
getRoleMappings
in interface RoleMapperModel
getRoleMappings
in interface RoleMapperModel.Streams
getRoleMappings
in class AbstractUserAdapter
public Stream<RoleModel> getRoleMappingsStream()
RoleMapperModel
getRoleMappingsStream
in interface RoleMapperModel
getRoleMappingsStream
in interface RoleMapperModel.Streams
RoleModel
. Never returns null
.public boolean hasRole(RoleModel role)
RoleMapperModel
true
if this object is directly or indirectly assigned the given role, false
otherwise.
For example, true
is returned for hasRole(R) if:
hasRole
in interface RoleMapperModel
hasRole
in class AbstractUserAdapter
Copyright © 2021 JBoss by Red Hat. All rights reserved.