org.keycloak.examples.federation.properties

## Class WritableUserModelProxy

- java.lang.Object
- - org.keycloak.models.utils.UserModelDelegate
  - - org.keycloak.examples.federation.properties.WritableUserModelProxy

- All Implemented Interfaces:
    UserModel

      public class WritableUserModelProxy
      extends UserModelDelegate

  Proxy that will synchronize password updates to the properties file.
  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 FilePropertiesFederationProvider` | `provider`

    - ### Fields inherited from class org.keycloak.models.utils.UserModelDelegate

      `delegate`

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

      `EMAIL, FIRST_NAME, LAST_NAME, USERNAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WritableUserModelProxy(UserModel delegate, FilePropertiesFederationProvider provider)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setUsername(String username)` Updates the properties file if the username changes.
    `void` | `updateCredential(UserCredentialModel cred)`
    `void` | `updateCredentialDirectly(UserCredentialValueModel cred)`

    - ### Methods inherited from class org.keycloak.models.utils.UserModelDelegate

      `addRequiredAction, deleteRoleMapping, getApplicationRoleMappings, getAttribute, getAttributes, getCredentialsDirectly, getEmail, getFederationLink, getFirstName, getId, getLastName, getRealmRoleMappings, getRequiredActions, getRoleMappings, getUsername, grantRole, hasRole, isEmailVerified, isEnabled, isTotp, removeAttribute, removeRequiredAction, setAttribute, setEmail, setEmailVerified, setEnabled, setFederationLink, setFirstName, setLastName, setTotp`

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

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

- - ### Field Detail

    - #### provider

          protected FilePropertiesFederationProvider provider

  - ### Constructor Detail

    - #### WritableUserModelProxy

          public WritableUserModelProxy(UserModel delegate,
                                FilePropertiesFederationProvider provider)

  - ### Method Detail

    - #### setUsername

          public void setUsername(String username)

      Updates the properties file if the username changes. If you have a more complex user storage, you can override other methods on UserModel to synchronize updates back to your external storage.
      Specified by:
        `setUsername` in interface `UserModel`
      Overrides:
        `setUsername` in class `UserModelDelegate`
      Parameters:
        `username` -

    - #### updateCredentialDirectly

          public void updateCredentialDirectly(UserCredentialValueModel cred)

      Specified by:
        `updateCredentialDirectly` in interface `UserModel`
      Overrides:
        `updateCredentialDirectly` in class `UserModelDelegate`

    - #### updateCredential

          public void updateCredential(UserCredentialModel cred)

      Specified by:
        `updateCredential` in interface `UserModel`
      Overrides:
        `updateCredential` in class `UserModelDelegate`

Copyright © 2015. All Rights Reserved.