org.keycloak.models

## Interface UserModel

- All Superinterfaces:
    RoleMapperModel
  All Known Implementing Classes:
    AbstractUserAdapter, AbstractUserAdapterFederatedStorage, GroupLDAPFederationMapper.LDAPGroupMappingsUserDelegate, MSADUserAccountControlMapper.MSADUserModelDelegate, ReadOnlyKerberosUserModelDelegate, ReadonlyLDAPUserModelDelegate, RoleLDAPFederationMapper.LDAPRoleMappingsUserDelegate, TxAwareLDAPUserModelDelegate, UnsyncedLDAPUserModelDelegate, UserAdapter, UserAdapter, UserAdapter, UserDataAdapter, UserModelDelegate, WritableLDAPUserModelDelegate

      public interface UserModel
      extends RoleMapperModel

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `UserModel.RequiredAction`
    `static interface` | `UserModel.UserRemovedEvent`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EMAIL`
    `static String` | `FIRST_NAME`
    `static String` | `LAST_NAME`
    `static String` | `LOCALE`
    `static String` | `USERNAME`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRequiredAction(String action)`
    `void` | `addRequiredAction(UserModel.RequiredAction action)`
    `List<String>` | `getAttribute(String name)`
    `Map<String,List<String>>` | `getAttributes()`
    `Long` | `getCreatedTimestamp()` Get timestamp of user creation.
    `List<UserCredentialValueModel>` | `getCredentialsDirectly()`
    `String` | `getEmail()`
    `String` | `getFederationLink()`
    `String` | `getFirstAttribute(String name)`
    `String` | `getFirstName()`
    `Set<GroupModel>` | `getGroups()`
    `String` | `getId()`
    `String` | `getLastName()`
    `Set<String>` | `getRequiredActions()`
    `String` | `getServiceAccountClientLink()`
    `String` | `getUsername()`
    `boolean` | `isEmailVerified()`
    `boolean` | `isEnabled()`
    `boolean` | `isMemberOf(GroupModel group)`
    `boolean` | `isOtpEnabled()`
    `void` | `joinGroup(GroupModel group)`
    `void` | `leaveGroup(GroupModel group)`
    `void` | `removeAttribute(String name)`
    `void` | `removeRequiredAction(String action)`
    `void` | `removeRequiredAction(UserModel.RequiredAction action)`
    `void` | `setAttribute(String name, List<String> values)`
    `void` | `setCreatedTimestamp(Long timestamp)`
    `void` | `setEmail(String email)`
    `void` | `setEmailVerified(boolean verified)`
    `void` | `setEnabled(boolean enabled)`
    `void` | `setFederationLink(String link)`
    `void` | `setFirstName(String firstName)`
    `void` | `setLastName(String lastName)`
    `void` | `setOtpEnabled(boolean totp)`
    `void` | `setServiceAccountClientLink(String clientInternalId)`
    `void` | `setSingleAttribute(String name, String value)` Set single value of specified attribute.
    `void` | `setUsername(String username)`
    `void` | `updateCredential(UserCredentialModel cred)`
    `void` | `updateCredentialDirectly(UserCredentialValueModel cred)`

    - ### Methods inherited from interface org.keycloak.models.RoleMapperModel

      `deleteRoleMapping, getClientRoleMappings, getRealmRoleMappings, getRoleMappings, grantRole, hasRole`

- - ### Field Detail

    - #### USERNAME

          static final String USERNAME

      See Also:
        Constant Field Values

    - #### LAST_NAME

          static final String LAST_NAME

      See Also:
        Constant Field Values

    - #### FIRST_NAME

          static final String FIRST_NAME

      See Also:
        Constant Field Values

    - #### EMAIL

          static final String EMAIL

      See Also:
        Constant Field Values

    - #### LOCALE

          static final String LOCALE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getId

          String getId()

    - #### getUsername

          String getUsername()

    - #### setUsername

          void setUsername(String username)

    - #### getCreatedTimestamp

          Long getCreatedTimestamp()

      Get timestamp of user creation. May be null for old users created before this feature introduction.

    - #### setCreatedTimestamp

          void setCreatedTimestamp(Long timestamp)

    - #### isEnabled

          boolean isEnabled()

    - #### isOtpEnabled

          boolean isOtpEnabled()

    - #### setEnabled

          void setEnabled(boolean enabled)

    - #### setSingleAttribute

          void setSingleAttribute(String name,
                                  String value)

      Set single value of specified attribute. Remove all other existing values
      Parameters:
        `name` -
        `value` -

    - #### setAttribute

          void setAttribute(String name,
                            List<String> values)

    - #### removeAttribute

          void removeAttribute(String name)

    - #### getFirstAttribute

          String 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

    - #### getAttribute

          List<String> getAttribute(String name)

      Parameters:
        `name` -
      Returns:
        list of all attribute values or empty list if there are not any values. Never return null

    - #### getAttributes

          Map<String,List<String>> getAttributes()

    - #### getRequiredActions

          Set<String> getRequiredActions()

    - #### addRequiredAction

          void addRequiredAction(String action)

    - #### removeRequiredAction

          void removeRequiredAction(String action)

    - #### addRequiredAction

          void addRequiredAction(UserModel.RequiredAction action)

    - #### removeRequiredAction

          void removeRequiredAction(UserModel.RequiredAction action)

    - #### getFirstName

          String getFirstName()

    - #### setFirstName

          void setFirstName(String firstName)

    - #### getLastName

          String getLastName()

    - #### setLastName

          void setLastName(String lastName)

    - #### getEmail

          String getEmail()

    - #### setEmail

          void setEmail(String email)

    - #### isEmailVerified

          boolean isEmailVerified()

    - #### setEmailVerified

          void setEmailVerified(boolean verified)

    - #### setOtpEnabled

          void setOtpEnabled(boolean totp)

    - #### updateCredential

          void updateCredential(UserCredentialModel cred)

    - #### getCredentialsDirectly

          List<UserCredentialValueModel> getCredentialsDirectly()

    - #### updateCredentialDirectly

          void updateCredentialDirectly(UserCredentialValueModel cred)

    - #### getGroups

          Set<GroupModel> getGroups()

    - #### joinGroup

          void joinGroup(GroupModel group)

    - #### leaveGroup

          void leaveGroup(GroupModel group)

    - #### isMemberOf

          boolean isMemberOf(GroupModel group)

    - #### getFederationLink

          String getFederationLink()

    - #### setFederationLink

          void setFederationLink(String link)

    - #### getServiceAccountClientLink

          String getServiceAccountClientLink()

    - #### setServiceAccountClientLink

          void setServiceAccountClientLink(String clientInternalId)

Copyright © 2016 JBoss by Red Hat. All rights reserved.