public class UserAdapter extends Object implements UserModel.Streams, JpaModel<UserEntity>
UserModel.RequiredAction, UserModel.SearchableFields, UserModel.Streams, UserModel.UserRemovedEvent
Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManager |
em |
protected RealmModel |
realm |
protected UserEntity |
user |
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 |
---|
UserAdapter(KeycloakSession session,
RealmModel realm,
javax.persistence.EntityManager em,
UserEntity user) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getAttribute, getGroups, getRequiredActions
addRequiredAction, getGroups, getGroups, removeRequiredAction
getClientRoleMappings, getRealmRoleMappings, getRoleMappings
protected UserEntity user
protected javax.persistence.EntityManager em
protected RealmModel realm
public UserAdapter(KeycloakSession session, RealmModel realm, javax.persistence.EntityManager em, UserEntity user)
public UserEntity getEntity()
getEntity
in interface JpaModel<UserEntity>
public String getUsername()
getUsername
in interface UserModel
public void setUsername(String username)
setUsername
in interface UserModel
public Long getCreatedTimestamp()
getCreatedTimestamp
in interface UserModel
public void setCreatedTimestamp(Long timestamp)
setCreatedTimestamp
in interface UserModel
public void setEnabled(boolean enabled)
setEnabled
in interface UserModel
public void setSingleAttribute(String name, String value)
setSingleAttribute
in interface UserModel
public void setAttribute(String name, List<String> values)
setAttribute
in interface UserModel
public void removeAttribute(String name)
removeAttribute
in interface UserModel
public String getFirstAttribute(String name)
getFirstAttribute
in interface UserModel
public Stream<String> getAttributeStream(String name)
getAttributeStream
in interface UserModel
getAttributeStream
in interface UserModel.Streams
public Map<String,List<String>> getAttributes()
getAttributes
in interface UserModel
public Stream<String> getRequiredActionsStream()
getRequiredActionsStream
in interface UserModel
getRequiredActionsStream
in interface UserModel.Streams
public void addRequiredAction(String actionName)
addRequiredAction
in interface UserModel
public void removeRequiredAction(String actionName)
removeRequiredAction
in interface UserModel
public String getFirstName()
getFirstName
in interface UserModel
public void setFirstName(String firstName)
setFirstName
in interface UserModel
public String getLastName()
getLastName
in interface UserModel
public void setLastName(String lastName)
setLastName
in interface UserModel
public boolean isEmailVerified()
isEmailVerified
in interface UserModel
public void setEmailVerified(boolean verified)
setEmailVerified
in interface UserModel
public Stream<GroupModel> getGroupsStream()
getGroupsStream
in interface UserModel
getGroupsStream
in interface UserModel.Streams
public Stream<GroupModel> getGroupsStream(String search, Integer first, Integer max)
getGroupsStream
in interface UserModel
public long getGroupsCount()
getGroupsCount
in interface UserModel
public long getGroupsCountByNameContaining(String search)
getGroupsCountByNameContaining
in interface UserModel
public void joinGroup(GroupModel group)
protected void joinGroupImpl(GroupModel group)
public void leaveGroup(GroupModel group)
leaveGroup
in interface UserModel
public boolean isMemberOf(GroupModel group)
isMemberOf
in interface UserModel
protected javax.persistence.TypedQuery<UserGroupMembershipEntity> getUserGroupMappingQuery(GroupModel group)
public boolean hasRole(RoleModel role)
hasRole
in interface RoleMapperModel
protected javax.persistence.TypedQuery<UserRoleMappingEntity> getUserRoleMappingEntityTypedQuery(RoleModel role)
public void grantRole(RoleModel role)
grantRole
in interface RoleMapperModel
public void grantRoleImpl(RoleModel role)
public Stream<RoleModel> getRealmRoleMappingsStream()
getRealmRoleMappingsStream
in interface RoleMapperModel
getRealmRoleMappingsStream
in interface RoleMapperModel.Streams
public Stream<RoleModel> getRoleMappingsStream()
getRoleMappingsStream
in interface RoleMapperModel
getRoleMappingsStream
in interface RoleMapperModel.Streams
public void deleteRoleMapping(RoleModel role)
deleteRoleMapping
in interface RoleMapperModel
public Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
getClientRoleMappingsStream
in interface RoleMapperModel
getClientRoleMappingsStream
in interface RoleMapperModel.Streams
public String getFederationLink()
getFederationLink
in interface UserModel
public void setFederationLink(String link)
setFederationLink
in interface UserModel
public String getServiceAccountClientLink()
getServiceAccountClientLink
in interface UserModel
public void setServiceAccountClientLink(String clientInternalId)
setServiceAccountClientLink
in interface UserModel
Copyright © 2021 JBoss by Red Hat. All rights reserved.