Package org.keycloak.models
Interface UserModel
- 
- All Superinterfaces:
- RoleMapperModel
 - All Known Subinterfaces:
- CachedUserModel,- CachedUserModel.Streams,- UserModel.Streams
 - All Known Implementing Classes:
- AbstractUserAdapter,- AbstractUserAdapter.Streams,- AbstractUserAdapterFederatedStorage,- AbstractUserAdapterFederatedStorage.Streams,- AbstractUserModel,- GroupLDAPStorageMapper.LDAPGroupMappingsUserDelegate,- InMemoryUserAdapter,- LDAPWritesOnlyUserModelDelegate,- MapUserAdapter,- MSADLDSUserAccountControlStorageMapper.MSADUserModelDelegate,- MSADUserAccountControlStorageMapper.MSADUserModelDelegate,- ReadOnlyKerberosUserModelDelegate,- ReadonlyLDAPUserModelDelegate,- ReadonlySSSDUserModelDelegate,- ReadOnlyUserModelDelegate,- RoleLDAPStorageMapper.LDAPRoleMappingsUserDelegate,- TxAwareLDAPUserModelDelegate,- UpdateOnlyChangeUserModelDelegate,- UserAdapter,- UserAdapter,- UserModelDefaultMethods,- UserModelDefaultMethods.Streams,- UserModelDelegate
 
 public interface UserModel extends RoleMapperModel - Version:
- $Revision: 1 $
- Author:
- Bill Burke
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classUserModel.RequiredActionstatic classUserModel.SearchableFieldsstatic interfaceUserModel.StreamsDeprecated.This interface is no longer necessary, collection-based methods were removed from the parent interface and therefore the parent interface can be used directlystatic interfaceUserModel.UserRemovedEvent
 - 
Field SummaryFields Modifier and Type Field Description static Comparator<UserModel>COMPARE_BY_USERNAMEstatic StringDISABLED_REASONstatic StringEMAILstatic StringEMAIL_VERIFIEDstatic StringENABLEDstatic StringEXACTstatic StringFIRST_NAMEstatic StringGROUPSstatic StringIDP_ALIASstatic StringIDP_USER_IDstatic StringINCLUDE_SERVICE_ACCOUNTstatic StringLAST_NAMEstatic StringLOCALEstatic StringSEARCHstatic StringUSERNAME
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddRequiredAction(String action)default voidaddRequiredAction(UserModel.RequiredAction action)SubjectCredentialManagercredentialManager()Instance of a user credential manager to validate and update the credentials of this user.Map<String,List<String>>getAttributes()Stream<String>getAttributeStream(String name)Obtains all values associated with the specified attribute name.LonggetCreatedTimestamp()Get timestamp of user creation.StringgetEmail()StringgetFederationLink()StringgetFirstAttribute(String name)StringgetFirstName()default longgetGroupsCount()default longgetGroupsCountByNameContaining(String search)Stream<GroupModel>getGroupsStream()Obtains the groups associated with the user.default Stream<GroupModel>getGroupsStream(String search, Integer first, Integer max)Returns a paginated stream of groups within this realm with search in the nameStringgetId()StringgetLastName()Stream<String>getRequiredActionsStream()Obtains the names of required actions associated with the user.StringgetServiceAccountClientLink()StringgetUsername()booleanisEmailVerified()booleanisEnabled()booleanisMemberOf(GroupModel group)voidjoinGroup(GroupModel group)voidleaveGroup(GroupModel group)voidremoveAttribute(String name)voidremoveRequiredAction(String action)default voidremoveRequiredAction(UserModel.RequiredAction action)voidsetAttribute(String name, List<String> values)voidsetCreatedTimestamp(Long timestamp)voidsetEmail(String email)Sets email for this user.voidsetEmailVerified(boolean verified)voidsetEnabled(boolean enabled)voidsetFederationLink(String link)voidsetFirstName(String firstName)voidsetLastName(String lastName)voidsetServiceAccountClientLink(String clientInternalId)voidsetSingleAttribute(String name, String value)Set single value of specified attribute.voidsetUsername(String username)Sets username for this user.- 
Methods inherited from interface org.keycloak.models.RoleMapperModeldeleteRoleMapping, getClientRoleMappingsStream, getRealmRoleMappingsStream, getRoleMappingsStream, grantRole, hasDirectRole, hasRole
 
- 
 
- 
- 
- 
Field Detail- 
USERNAMEstatic final String USERNAME - See Also:
- Constant Field Values
 
 - 
FIRST_NAMEstatic final String FIRST_NAME - See Also:
- Constant Field Values
 
 - 
LAST_NAMEstatic final String LAST_NAME - See Also:
- Constant Field Values
 
 - 
EMAILstatic final String EMAIL - See Also:
- Constant Field Values
 
 - 
EMAIL_VERIFIEDstatic final String EMAIL_VERIFIED - See Also:
- Constant Field Values
 
 - 
LOCALEstatic final String LOCALE - See Also:
- Constant Field Values
 
 - 
ENABLEDstatic final String ENABLED - See Also:
- Constant Field Values
 
 - 
IDP_ALIASstatic final String IDP_ALIAS - See Also:
- Constant Field Values
 
 - 
IDP_USER_IDstatic final String IDP_USER_ID - See Also:
- Constant Field Values
 
 - 
INCLUDE_SERVICE_ACCOUNTstatic final String INCLUDE_SERVICE_ACCOUNT - See Also:
- Constant Field Values
 
 - 
GROUPSstatic final String GROUPS - See Also:
- Constant Field Values
 
 - 
SEARCHstatic final String SEARCH - See Also:
- Constant Field Values
 
 - 
EXACTstatic final String EXACT - See Also:
- Constant Field Values
 
 - 
DISABLED_REASONstatic final String DISABLED_REASON - See Also:
- Constant Field Values
 
 - 
COMPARE_BY_USERNAMEstatic final Comparator<UserModel> COMPARE_BY_USERNAME 
 
- 
 - 
Method Detail- 
getIdString getId() 
 - 
getUsernameString getUsername() 
 - 
setUsernamevoid setUsername(String username) Sets username for this user. No default method here to allow Abstract subclasses where the username is provided in a different manner- Parameters:
- username- username string
 
 - 
getCreatedTimestampLong getCreatedTimestamp() Get timestamp of user creation. May be null for old users created before this feature introduction.
 - 
setCreatedTimestampvoid setCreatedTimestamp(Long timestamp) 
 - 
isEnabledboolean isEnabled() 
 - 
setEnabledvoid setEnabled(boolean enabled) 
 - 
setSingleAttributevoid setSingleAttribute(String name, String value) Set single value of specified attribute. Remove all other existing values of this attribute- Parameters:
- name-
- value-
 
 - 
removeAttributevoid removeAttribute(String name) 
 - 
getFirstAttributeString getFirstAttribute(String name) - Parameters:
- name-
- Returns:
- null if there is not any value of specified attribute or first value otherwise. Don't throw exception if there are more values of the attribute
 
 - 
getAttributeStreamStream<String> getAttributeStream(String name) Obtains all values associated with the specified attribute name.- Parameters:
- name- the name of the attribute.
- Returns:
- a non-null Streamof attribute values.
 
 - 
getRequiredActionsStreamStream<String> getRequiredActionsStream() Obtains the names of required actions associated with the user.- Returns:
- a non-null Streamof required action names.
 
 - 
addRequiredActionvoid addRequiredAction(String action) 
 - 
removeRequiredActionvoid removeRequiredAction(String action) 
 - 
addRequiredActiondefault void addRequiredAction(UserModel.RequiredAction action) 
 - 
removeRequiredActiondefault void removeRequiredAction(UserModel.RequiredAction action) 
 - 
getFirstNameString getFirstName() 
 - 
setFirstNamevoid setFirstName(String firstName) 
 - 
getLastNameString getLastName() 
 - 
setLastNamevoid setLastName(String lastName) 
 - 
getEmailString getEmail() 
 - 
setEmailvoid setEmail(String email) Sets email for this user.- Parameters:
- email- the email
 
 - 
isEmailVerifiedboolean isEmailVerified() 
 - 
setEmailVerifiedvoid setEmailVerified(boolean verified) 
 - 
getGroupsStreamStream<GroupModel> getGroupsStream() Obtains the groups associated with the user.- Returns:
- a non-null Streamof groups.
 
 - 
getGroupsStreamdefault Stream<GroupModel> getGroupsStream(String search, Integer first, Integer max) Returns a paginated stream of groups within this realm with search in the name- Parameters:
- search- Case insensitive string which will be searched for. Ignored if null.
- first- Index of first group to return. Ignored if negative or- null.
- max- Maximum number of records to return. Ignored if negative or- null.
- Returns:
- Stream of desired groups. Never returns null.
 
 - 
getGroupsCountdefault long getGroupsCount() 
 - 
getGroupsCountByNameContainingdefault long getGroupsCountByNameContaining(String search) 
 - 
joinGroupvoid joinGroup(GroupModel group) 
 - 
leaveGroupvoid leaveGroup(GroupModel group) 
 - 
isMemberOfboolean isMemberOf(GroupModel group) 
 - 
getFederationLinkString getFederationLink() 
 - 
setFederationLinkvoid setFederationLink(String link) 
 - 
getServiceAccountClientLinkString getServiceAccountClientLink() 
 - 
setServiceAccountClientLinkvoid setServiceAccountClientLink(String clientInternalId) 
 - 
credentialManagerSubjectCredentialManager credentialManager() Instance of a user credential manager to validate and update the credentials of this user.
 
- 
 
-