Package org.keycloak.models.jpa
Class UserAdapter
java.lang.Object
org.keycloak.models.jpa.UserAdapter
- All Implemented Interfaces:
JpaModel<UserEntity>
,RoleMapperModel
,UserModel
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.UserModel
UserModel.RequiredAction, UserModel.UserRemovedEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManager
protected RealmModel
protected UserEntity
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
ConstructorDescriptionUserAdapter
(KeycloakSession session, RealmModel realm, jakarta.persistence.EntityManager em, UserEntity user) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequiredAction
(String actionName) void
deleteRoleMapping
(RoleModel role) boolean
getAttributeStream
(String name) getEmail()
getFirstAttribute
(String name) long
long
getGroupsCountByNameContaining
(String search) getGroupsStream
(String search, Integer first, Integer max) getId()
protected jakarta.persistence.TypedQuery<UserGroupMembershipEntity>
protected jakarta.persistence.TypedQuery<UserRoleMappingEntity>
void
void
grantRoleImpl
(RoleModel role) int
hashCode()
boolean
boolean
boolean
boolean
isMemberOf
(GroupModel group) void
joinGroup
(GroupModel group) protected void
joinGroupImpl
(GroupModel group) void
leaveGroup
(GroupModel group) void
removeAttribute
(String name) void
removeRequiredAction
(String actionName) void
setAttribute
(String name, List<String> values) void
setCreatedTimestamp
(Long timestamp) void
void
setEmailVerified
(boolean verified) void
setEnabled
(boolean enabled) void
setFederationLink
(String link) void
setFirstName
(String firstName) void
setLastName
(String lastName) void
setServiceAccountClientLink
(String clientInternalId) void
setSingleAttribute
(String name, String value) void
setUsername
(String username) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.models.RoleMapperModel
hasDirectRole
Methods inherited from interface org.keycloak.models.UserModel
addRequiredAction, removeRequiredAction
-
Field Details
-
user
-
em
protected jakarta.persistence.EntityManager em -
realm
-
-
Constructor Details
-
UserAdapter
public UserAdapter(KeycloakSession session, RealmModel realm, jakarta.persistence.EntityManager em, UserEntity user)
-
-
Method Details
-
getEntity
- Specified by:
getEntity
in interfaceJpaModel<UserEntity>
-
getId
-
getUsername
- Specified by:
getUsername
in interfaceUserModel
-
setUsername
- Specified by:
setUsername
in interfaceUserModel
-
getCreatedTimestamp
- Specified by:
getCreatedTimestamp
in interfaceUserModel
-
setCreatedTimestamp
- Specified by:
setCreatedTimestamp
in interfaceUserModel
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabled
in interfaceUserModel
-
setSingleAttribute
- Specified by:
setSingleAttribute
in interfaceUserModel
-
setAttribute
- Specified by:
setAttribute
in interfaceUserModel
-
removeAttribute
- Specified by:
removeAttribute
in interfaceUserModel
-
getFirstAttribute
- Specified by:
getFirstAttribute
in interfaceUserModel
-
getAttributeStream
- Specified by:
getAttributeStream
in interfaceUserModel
-
getAttributes
- Specified by:
getAttributes
in interfaceUserModel
-
getRequiredActionsStream
- Specified by:
getRequiredActionsStream
in interfaceUserModel
-
addRequiredAction
- Specified by:
addRequiredAction
in interfaceUserModel
-
removeRequiredAction
- Specified by:
removeRequiredAction
in interfaceUserModel
-
getFirstName
- Specified by:
getFirstName
in interfaceUserModel
-
setFirstName
- Specified by:
setFirstName
in interfaceUserModel
-
getLastName
- Specified by:
getLastName
in interfaceUserModel
-
setLastName
- Specified by:
setLastName
in interfaceUserModel
-
getEmail
-
setEmail
-
isEmailVerified
public boolean isEmailVerified()- Specified by:
isEmailVerified
in interfaceUserModel
-
setEmailVerified
public void setEmailVerified(boolean verified) - Specified by:
setEmailVerified
in interfaceUserModel
-
getGroupsStream
- Specified by:
getGroupsStream
in interfaceUserModel
-
getGroupsStream
- Specified by:
getGroupsStream
in interfaceUserModel
-
getGroupsCount
public long getGroupsCount()- Specified by:
getGroupsCount
in interfaceUserModel
-
getGroupsCountByNameContaining
- Specified by:
getGroupsCountByNameContaining
in interfaceUserModel
-
joinGroup
-
joinGroupImpl
-
leaveGroup
- Specified by:
leaveGroup
in interfaceUserModel
-
isMemberOf
- Specified by:
isMemberOf
in interfaceUserModel
-
getUserGroupMappingQuery
protected jakarta.persistence.TypedQuery<UserGroupMembershipEntity> getUserGroupMappingQuery(GroupModel group) -
hasRole
- Specified by:
hasRole
in interfaceRoleMapperModel
-
getUserRoleMappingEntityTypedQuery
protected jakarta.persistence.TypedQuery<UserRoleMappingEntity> getUserRoleMappingEntityTypedQuery(RoleModel role) -
grantRole
- Specified by:
grantRole
in interfaceRoleMapperModel
-
grantRoleImpl
-
getRealmRoleMappingsStream
- Specified by:
getRealmRoleMappingsStream
in interfaceRoleMapperModel
-
getRoleMappingsStream
- Specified by:
getRoleMappingsStream
in interfaceRoleMapperModel
-
deleteRoleMapping
- Specified by:
deleteRoleMapping
in interfaceRoleMapperModel
-
getClientRoleMappingsStream
- Specified by:
getClientRoleMappingsStream
in interfaceRoleMapperModel
-
getFederationLink
- Specified by:
getFederationLink
in interfaceUserModel
-
setFederationLink
- Specified by:
setFederationLink
in interfaceUserModel
-
getServiceAccountClientLink
- Specified by:
getServiceAccountClientLink
in interfaceUserModel
-
setServiceAccountClientLink
- Specified by:
setServiceAccountClientLink
in interfaceUserModel
-
credentialManager
- Specified by:
credentialManager
in interfaceUserModel
-
equals
-
hashCode
public int hashCode()
-