org.keycloak.models.cache

## Class UserAdapter

- java.lang.Object
- - org.keycloak.models.cache.UserAdapter

- All Implemented Interfaces:
    UserModel

      public class UserAdapter
      extends Object
      implements UserModel

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.UserModel

      `UserModel.RequiredAction`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CachedUser` | `cached`
    `protected KeycloakSession` | `keycloakSession`
    `protected RealmModel` | `realm`
    `protected UserModel` | `updated`
    `protected CacheUserProvider` | `userProviderCache`

    - ### Fields inherited from interface org.keycloak.models.UserModel

      `EMAIL, FIRST_NAME, LAST_NAME, USERNAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserAdapter(CachedUser cached, CacheUserProvider userProvider, KeycloakSession keycloakSession, RealmModel realm)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRequiredAction(UserModel.RequiredAction action)`
    `void` | `deleteRoleMapping(RoleModel role)`
    `Set<RoleModel>` | `getApplicationRoleMappings(ApplicationModel app)`
    `String` | `getAttribute(String name)`
    `Map<String,String>` | `getAttributes()`
    `List<UserCredentialValueModel>` | `getCredentialsDirectly()`
    `protected void` | `getDelegateForUpdate()`
    `String` | `getEmail()`
    `String` | `getFederationLink()`
    `String` | `getFirstName()`
    `String` | `getId()`
    `String` | `getLastName()`
    `Set<RoleModel>` | `getRealmRoleMappings()`
    `Set<UserModel.RequiredAction>` | `getRequiredActions()`
    `Set<RoleModel>` | `getRoleMappings()`
    `String` | `getUsername()`
    `void` | `grantRole(RoleModel role)`
    `boolean` | `hasRole(RoleModel role)`
    `boolean` | `isEmailVerified()`
    `boolean` | `isEnabled()`
    `boolean` | `isTotp()`
    `void` | `removeAttribute(String name)`
    `void` | `removeRequiredAction(UserModel.RequiredAction action)`
    `void` | `setAttribute(String name, String value)`
    `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` | `setTotp(boolean totp)`
    `void` | `setUsername(String username)`
    `void` | `updateCredential(UserCredentialModel cred)`
    `void` | `updateCredentialDirectly(UserCredentialValueModel cred)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### updated

          protected UserModel updated

    - #### cached

          protected CachedUser cached

    - #### userProviderCache

          protected CacheUserProvider userProviderCache

    - #### keycloakSession

          protected KeycloakSession keycloakSession

    - #### realm

          protected RealmModel realm

  - ### Constructor Detail

    - #### UserAdapter

          public UserAdapter(CachedUser cached,
                     CacheUserProvider userProvider,
                     KeycloakSession keycloakSession,
                     RealmModel realm)

  - ### Method Detail

    - #### getDelegateForUpdate

          protected void getDelegateForUpdate()

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `UserModel`

    - #### getUsername

          public String getUsername()

      Specified by:
        `getUsername` in interface `UserModel`

    - #### setUsername

          public void setUsername(String username)

      Specified by:
        `setUsername` in interface `UserModel`

    - #### isEnabled

          public boolean isEnabled()

      Specified by:
        `isEnabled` in interface `UserModel`

    - #### isTotp

          public boolean isTotp()

      Specified by:
        `isTotp` in interface `UserModel`

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Specified by:
        `setEnabled` in interface `UserModel`

    - #### setAttribute

          public void setAttribute(String name,
                          String value)

      Specified by:
        `setAttribute` in interface `UserModel`

    - #### removeAttribute

          public void removeAttribute(String name)

      Specified by:
        `removeAttribute` in interface `UserModel`

    - #### getAttribute

          public String getAttribute(String name)

      Specified by:
        `getAttribute` in interface `UserModel`

    - #### getAttributes

          public Map<String,String> getAttributes()

      Specified by:
        `getAttributes` in interface `UserModel`

    - #### getRequiredActions

          public Set<UserModel.RequiredAction> getRequiredActions()

      Specified by:
        `getRequiredActions` in interface `UserModel`

    - #### addRequiredAction

          public void addRequiredAction(UserModel.RequiredAction action)

      Specified by:
        `addRequiredAction` in interface `UserModel`

    - #### removeRequiredAction

          public void removeRequiredAction(UserModel.RequiredAction action)

      Specified by:
        `removeRequiredAction` in interface `UserModel`

    - #### getFirstName

          public String getFirstName()

      Specified by:
        `getFirstName` in interface `UserModel`

    - #### setFirstName

          public void setFirstName(String firstName)

      Specified by:
        `setFirstName` in interface `UserModel`

    - #### getLastName

          public String getLastName()

      Specified by:
        `getLastName` in interface `UserModel`

    - #### setLastName

          public void setLastName(String lastName)

      Specified by:
        `setLastName` in interface `UserModel`

    - #### getEmail

          public String getEmail()

      Specified by:
        `getEmail` in interface `UserModel`

    - #### setEmail

          public void setEmail(String email)

      Specified by:
        `setEmail` in interface `UserModel`

    - #### isEmailVerified

          public boolean isEmailVerified()

      Specified by:
        `isEmailVerified` in interface `UserModel`

    - #### setEmailVerified

          public void setEmailVerified(boolean verified)

      Specified by:
        `setEmailVerified` in interface `UserModel`

    - #### setTotp

          public void setTotp(boolean totp)

      Specified by:
        `setTotp` in interface `UserModel`

    - #### updateCredential

          public void updateCredential(UserCredentialModel cred)

      Specified by:
        `updateCredential` in interface `UserModel`

    - #### getCredentialsDirectly

          public List<UserCredentialValueModel> getCredentialsDirectly()

      Specified by:
        `getCredentialsDirectly` in interface `UserModel`

    - #### updateCredentialDirectly

          public void updateCredentialDirectly(UserCredentialValueModel cred)

      Specified by:
        `updateCredentialDirectly` in interface `UserModel`

    - #### getFederationLink

          public String getFederationLink()

      Specified by:
        `getFederationLink` in interface `UserModel`

    - #### setFederationLink

          public void setFederationLink(String link)

      Specified by:
        `setFederationLink` in interface `UserModel`

    - #### getRealmRoleMappings

          public Set<RoleModel> getRealmRoleMappings()

      Specified by:
        `getRealmRoleMappings` in interface `UserModel`

    - #### getApplicationRoleMappings

          public Set<RoleModel> getApplicationRoleMappings(ApplicationModel app)

      Specified by:
        `getApplicationRoleMappings` in interface `UserModel`

    - #### hasRole

          public boolean hasRole(RoleModel role)

      Specified by:
        `hasRole` in interface `UserModel`

    - #### grantRole

          public void grantRole(RoleModel role)

      Specified by:
        `grantRole` in interface `UserModel`

    - #### getRoleMappings

          public Set<RoleModel> getRoleMappings()

      Specified by:
        `getRoleMappings` in interface `UserModel`

    - #### deleteRoleMapping

          public void deleteRoleMapping(RoleModel role)

      Specified by:
        `deleteRoleMapping` in interface `UserModel`

Copyright © 2015. All Rights Reserved.