Class UserAdapter
- java.lang.Object
-
- org.keycloak.models.cache.infinispan.UserAdapter
-
- All Implemented Interfaces:
CachedUserModel,CachedUserModel.Streams,RoleMapperModel,RoleMapperModel.Streams,UserModel,UserModel.Streams
public class UserAdapter extends Object implements CachedUserModel.Streams
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.models.cache.CachedUserModel
CachedUserModel.Streams
-
Nested classes/interfaces inherited from interface org.keycloak.models.RoleMapperModel
RoleMapperModel.Streams
-
Nested classes/interfaces inherited from interface org.keycloak.models.UserModel
UserModel.RequiredAction, UserModel.SearchableFields, UserModel.Streams, UserModel.UserRemovedEvent
-
-
Field Summary
Fields Modifier and Type Field Description protected CachedUsercachedprotected KeycloakSessionkeycloakSessionprotected RealmModelrealmprotected UserModelupdatedprotected UserCacheSessionuserProviderCache-
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
Constructors Constructor Description UserAdapter(CachedUser cached, UserCacheSession userProvider, KeycloakSession keycloakSession, RealmModel realm)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.RoleMapperModel.Streams
getClientRoleMappings, getRealmRoleMappings, getRoleMappings
-
Methods inherited from interface org.keycloak.models.UserModel
getGroups, getGroups, getGroupsCount, getGroupsStream
-
Methods inherited from interface org.keycloak.models.UserModel.Streams
getAttribute, getGroups, getRequiredActions
-
-
-
-
Field Detail
-
cached
protected final CachedUser cached
-
userProviderCache
protected final UserCacheSession userProviderCache
-
keycloakSession
protected final KeycloakSession keycloakSession
-
realm
protected final RealmModel realm
-
updated
protected volatile UserModel updated
-
-
Constructor Detail
-
UserAdapter
public UserAdapter(CachedUser cached, UserCacheSession userProvider, KeycloakSession keycloakSession, RealmModel realm)
-
-
Method Detail
-
getFirstName
public String getFirstName()
- Specified by:
getFirstNamein interfaceUserModel
-
setFirstName
public void setFirstName(String firstName)
- Specified by:
setFirstNamein interfaceUserModel
-
getLastName
public String getLastName()
- Specified by:
getLastNamein interfaceUserModel
-
setLastName
public void setLastName(String lastName)
- Specified by:
setLastNamein interfaceUserModel
-
getDelegateForUpdate
public UserModel getDelegateForUpdate()
- Specified by:
getDelegateForUpdatein interfaceCachedUserModel
-
isMarkedForEviction
public boolean isMarkedForEviction()
- Specified by:
isMarkedForEvictionin interfaceCachedUserModel
-
invalidate
public void invalidate()
- Specified by:
invalidatein interfaceCachedUserModel
-
getCacheTimestamp
public long getCacheTimestamp()
- Specified by:
getCacheTimestampin interfaceCachedUserModel
-
getCachedWith
public ConcurrentHashMap getCachedWith()
- Specified by:
getCachedWithin interfaceCachedUserModel
-
getUsername
public String getUsername()
- Specified by:
getUsernamein interfaceUserModel
-
setUsername
public void setUsername(String username)
- Specified by:
setUsernamein interfaceUserModel
-
getCreatedTimestamp
public Long getCreatedTimestamp()
- Specified by:
getCreatedTimestampin interfaceUserModel
-
setCreatedTimestamp
public void setCreatedTimestamp(Long timestamp)
- Specified by:
setCreatedTimestampin interfaceUserModel
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabledin interfaceUserModel
-
setSingleAttribute
public void setSingleAttribute(String name, String value)
- Specified by:
setSingleAttributein interfaceUserModel
-
setAttribute
public void setAttribute(String name, List<String> values)
- Specified by:
setAttributein interfaceUserModel
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfaceUserModel
-
getFirstAttribute
public String getFirstAttribute(String name)
- Specified by:
getFirstAttributein interfaceUserModel
-
getAttributeStream
public Stream<String> getAttributeStream(String name)
- Specified by:
getAttributeStreamin interfaceUserModel- Specified by:
getAttributeStreamin interfaceUserModel.Streams
-
getAttributes
public Map<String,List<String>> getAttributes()
- Specified by:
getAttributesin interfaceUserModel
-
getRequiredActionsStream
public Stream<String> getRequiredActionsStream()
- Specified by:
getRequiredActionsStreamin interfaceUserModel- Specified by:
getRequiredActionsStreamin interfaceUserModel.Streams
-
addRequiredAction
public void addRequiredAction(UserModel.RequiredAction action)
- Specified by:
addRequiredActionin interfaceUserModel
-
removeRequiredAction
public void removeRequiredAction(UserModel.RequiredAction action)
- Specified by:
removeRequiredActionin interfaceUserModel
-
addRequiredAction
public void addRequiredAction(String action)
- Specified by:
addRequiredActionin interfaceUserModel
-
removeRequiredAction
public void removeRequiredAction(String action)
- Specified by:
removeRequiredActionin interfaceUserModel
-
isEmailVerified
public boolean isEmailVerified()
- Specified by:
isEmailVerifiedin interfaceUserModel
-
setEmailVerified
public void setEmailVerified(boolean verified)
- Specified by:
setEmailVerifiedin interfaceUserModel
-
getFederationLink
public String getFederationLink()
- Specified by:
getFederationLinkin interfaceUserModel
-
setFederationLink
public void setFederationLink(String link)
- Specified by:
setFederationLinkin interfaceUserModel
-
getServiceAccountClientLink
public String getServiceAccountClientLink()
- Specified by:
getServiceAccountClientLinkin interfaceUserModel
-
setServiceAccountClientLink
public void setServiceAccountClientLink(String clientInternalId)
- Specified by:
setServiceAccountClientLinkin interfaceUserModel
-
getRealmRoleMappingsStream
public Stream<RoleModel> getRealmRoleMappingsStream()
- Specified by:
getRealmRoleMappingsStreamin interfaceRoleMapperModel- Specified by:
getRealmRoleMappingsStreamin interfaceRoleMapperModel.Streams
-
getClientRoleMappingsStream
public Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
- Specified by:
getClientRoleMappingsStreamin interfaceRoleMapperModel- Specified by:
getClientRoleMappingsStreamin interfaceRoleMapperModel.Streams
-
hasDirectRole
public boolean hasDirectRole(RoleModel role)
- Specified by:
hasDirectRolein interfaceRoleMapperModel
-
hasRole
public boolean hasRole(RoleModel role)
- Specified by:
hasRolein interfaceRoleMapperModel
-
grantRole
public void grantRole(RoleModel role)
- Specified by:
grantRolein interfaceRoleMapperModel
-
getRoleMappingsStream
public Stream<RoleModel> getRoleMappingsStream()
- Specified by:
getRoleMappingsStreamin interfaceRoleMapperModel- Specified by:
getRoleMappingsStreamin interfaceRoleMapperModel.Streams
-
deleteRoleMapping
public void deleteRoleMapping(RoleModel role)
- Specified by:
deleteRoleMappingin interfaceRoleMapperModel
-
getGroupsStream
public Stream<GroupModel> getGroupsStream()
- Specified by:
getGroupsStreamin interfaceUserModel- Specified by:
getGroupsStreamin interfaceUserModel.Streams
-
getGroupsCountByNameContaining
public long getGroupsCountByNameContaining(String search)
- Specified by:
getGroupsCountByNameContainingin interfaceUserModel
-
joinGroup
public void joinGroup(GroupModel group)
-
leaveGroup
public void leaveGroup(GroupModel group)
- Specified by:
leaveGroupin interfaceUserModel
-
isMemberOf
public boolean isMemberOf(GroupModel group)
- Specified by:
isMemberOfin interfaceUserModel
-
-