org.keycloak.storage

## Class UserStorageManager

- java.lang.Object
- - org.keycloak.storage.AbstractStorageManager<UserStorageProvider,UserStorageProviderModel>
  - - org.keycloak.storage.UserStorageManager

- All Implemented Interfaces:
    OnUserCache, UserProvider, UserProvider.Streams, Provider, OnCreateComponent, OnUpdateComponent, UserBulkUpdateProvider, UserLookupProvider, UserQueryProvider, UserQueryProvider.Streams, UserRegistrationProvider

      public class UserStorageManager
      extends AbstractStorageManager<UserStorageProvider,UserStorageProviderModel>
      implements UserProvider.Streams, OnUserCache, OnCreateComponent, OnUpdateComponent

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

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

      `UserProvider.Streams`

  - ### Field Summary

    - ### Fields inherited from class org.keycloak.storage.AbstractStorageManager

      `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserStorageManager(KeycloakSession session)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConsent(RealmModel realm, String userId, UserConsentModel consent)`
    `void` | `addFederatedIdentity(RealmModel realm, UserModel user, FederatedIdentityModel socialLink)`
    `UserModel` | `addUser(RealmModel realm, String username)` `UserRegistrationProvider` methods implementations start here
    `UserModel` | `addUser(RealmModel realm, String id, String username, boolean addDefaultRoles, boolean addDefaultRequiredActions)` `UserStorageProvider` methods implementation end here `UserProvider` methods implementations start here -> no StorageProviders involved
    `void` | `close()` `UserProvider` methods implementations end here
    `protected void` | `deleteInvalidUser(RealmModel realm, UserModel user)`
    `UserConsentModel` | `getConsentByClient(RealmModel realm, String userId, String clientInternalId)`
    `Stream<UserConsentModel>` | `getConsentsStream(RealmModel realm, String userId)` Obtains the consents associated with the user identified by the specified `userId`.
    `Stream<FederatedIdentityModel>` | `getFederatedIdentitiesStream(UserModel user, RealmModel realm)` Obtains the federated identities of the specified user.
    `FederatedIdentityModel` | `getFederatedIdentity(UserModel user, String socialProvider, RealmModel realm)`
    `Stream<UserModel>` | `getGroupMembersStream(RealmModel realm, GroupModel group)` `UserLookupProvider` methods implementations end here `UserQueryProvider` methods implementation start here
    `Stream<UserModel>` | `getGroupMembersStream(RealmModel realm, GroupModel group, Integer firstResult, Integer maxResults)` Obtains users that belong to a specific group.
    `int` | `getNotBeforeOfUser(RealmModel realm, UserModel user)`
    `Stream<UserModel>` | `getRoleMembersStream(RealmModel realm, RoleModel role)` Obtains users that have the specified role.
    `Stream<UserModel>` | `getRoleMembersStream(RealmModel realm, RoleModel role, Integer firstResult, Integer maxResults)` Searches for users that have the specified role.
    `UserModel` | `getServiceAccount(ClientModel client)`
    `UserModel` | `getUserByEmail(String email, RealmModel realm)`
    `UserModel` | `getUserByFederatedIdentity(FederatedIdentityModel socialLink, RealmModel realm)`
    `UserModel` | `getUserById(String id, RealmModel realm)` `UserRegistrationProvider` methods implementations end here `UserLookupProvider` methods implementations start here
    `UserModel` | `getUserByUsername(String username, RealmModel realm)`
    `int` | `getUsersCount(Map<String,String> params, RealmModel realm)` Returns the number of users that match the given filter parameters.
    `int` | `getUsersCount(Map<String,String> params, RealmModel realm, Set<String> groupIds)` Returns the number of users that match the given filter parameters and is in at least one of the given groups.
    `int` | `getUsersCount(RealmModel realm)` Returns the number of users, without consider any service account.
    `int` | `getUsersCount(RealmModel realm, boolean includeServiceAccount)` Returns the number of users.
    `int` | `getUsersCount(RealmModel realm, Set<String> groupIds)` Returns the number of users that are in at least one of the groups given.
    `int` | `getUsersCount(String search, RealmModel realm)` Returns the number of users that match the given criteria.
    `int` | `getUsersCount(String search, RealmModel realm, Set<String> groupIds)` Returns the number of users that match the given criteria and are in at least one of the groups given.
    `Stream<UserModel>` | `getUsersStream(RealmModel realm)` Searches all users in the realm.
    `Stream<UserModel>` | `getUsersStream(RealmModel realm, boolean includeServiceAccounts)` Obtains the users associated with the specified realm.
    `Stream<UserModel>` | `getUsersStream(RealmModel realm, Integer firstResult, Integer maxResults, boolean includeServiceAccounts)` Obtains the users associated with the specified realm.
    `Stream<UserModel>` | `getUsersStream(RealmModel realm, int firstResult, int maxResults)` Searches all users in the realm, starting from the `firstResult` and containing at most `maxResults`.
    `void` | `grantToAllUsers(RealmModel realm, RoleModel role)` `UserQueryProvider` methods implementation end here `UserBulkUpdateProvider` methods implementation start here
    `protected Stream<UserModel>` | `importValidation(RealmModel realm, Stream<UserModel> users)`
    `protected UserModel` | `importValidation(RealmModel realm, UserModel user)` Allows a UserStorageProvider to proxy and/or synchronize an imported user.
    `protected UserProvider` | `localStorage()`
    `void` | `onCache(RealmModel realm, CachedUserModel user, UserModel delegate)`
    `void` | `onCreate(KeycloakSession session, RealmModel realm, ComponentModel model)`
    `void` | `onUpdate(KeycloakSession session, RealmModel realm, ComponentModel oldModel, ComponentModel newModel)`
    `void` | `preRemove(ClientScopeModel clientScope)`
    `void` | `preRemove(ProtocolMapperModel protocolMapper)`
    `void` | `preRemove(RealmModel realm)` `UserBulkUpdateProvider` methods implementation end here `UserStorageProvider` methods implementations start here -> no StorageProviders involved
    `void` | `preRemove(RealmModel realm, ClientModel client)`
    `void` | `preRemove(RealmModel realm, ComponentModel component)`
    `void` | `preRemove(RealmModel realm, GroupModel group)`
    `void` | `preRemove(RealmModel realm, IdentityProviderModel provider)`
    `void` | `preRemove(RealmModel realm, RoleModel role)`
    `protected Stream<UserModel>` | `query(org.keycloak.storage.UserStorageManager.PaginatedQuery pagedQuery, RealmModel realm, int firstResult, int maxResults)`
    `boolean` | `removeFederatedIdentity(RealmModel realm, UserModel user, String socialProvider)`
    `void` | `removeImportedUsers(RealmModel realm, String storageProviderId)` Removes any imported users from a specific User Storage Provider.
    `boolean` | `removeUser(RealmModel realm, UserModel user)` Called if user originated from this provider.
    `boolean` | `revokeConsentForClient(RealmModel realm, String userId, String clientInternalId)`
    `Stream<UserModel>` | `searchForUserByUserAttributeStream(String attrName, String attrValue, RealmModel realm)` Searches for users that have a specific attribute with a specific value.
    `Stream<UserModel>` | `searchForUserStream(Map<String,String> attributes, RealmModel realm)` Searches for user by parameter.
    `Stream<UserModel>` | `searchForUserStream(Map<String,String> attributes, RealmModel realm, Integer firstResult, Integer maxResults)` Searches for user by parameter.
    `Stream<UserModel>` | `searchForUserStream(String search, RealmModel realm)` Searches for users with username, email or first + last name that is like search string.
    `Stream<UserModel>` | `searchForUserStream(String search, RealmModel realm, Integer firstResult, Integer maxResults)` Searches for users with username, email or first + last name that is like search string.
    `void` | `setNotBeforeForUser(RealmModel realm, UserModel user, int notBefore)`
    `void` | `unlinkUsers(RealmModel realm, String storageProviderId)` Set federation link to null to imported users of a specific User Storage Provider
    `void` | `updateConsent(RealmModel realm, String userId, UserConsentModel consent)`
    `void` | `updateFederatedIdentity(RealmModel realm, UserModel federatedUser, FederatedIdentityModel federatedIdentityModel)`

    - ### Methods inherited from class org.keycloak.storage.AbstractStorageManager

      `consumeEnabledStorageProvidersWithTimeout, flatMapEnabledStorageProvidersWithTimeout, getEnabledStorageProviders, getStorageProviderFactory, getStorageProviderInstance, getStorageProviderInstance, getStorageProviderInstance, getStorageProviderInstance, getStorageProviderModel, getStorageProviderModels, getStorageProviderTimeout, mapEnabledStorageProvidersWithTimeout`

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

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

    - ### Methods inherited from interface org.keycloak.models.UserProvider.Streams

      `getConsents, getFederatedIdentities, getUsers, getUsers`

    - ### Methods inherited from interface org.keycloak.storage.user.UserQueryProvider.Streams

      `getGroupMembers, getGroupMembers, getUsers, getUsers, searchForUser, searchForUser, searchForUser, searchForUser, searchForUserByUserAttribute`

    - ### Methods inherited from interface org.keycloak.storage.user.UserQueryProvider

      `countUsersInGroups, getRoleMembers, getRoleMembers`

- - ### Constructor Detail

    - #### UserStorageManager

          public UserStorageManager(KeycloakSession session)

  - ### Method Detail

    - #### localStorage

          protected UserProvider localStorage()

    - #### importValidation

          protected UserModel importValidation(RealmModel realm,
                                               UserModel user)

      Allows a UserStorageProvider to proxy and/or synchronize an imported user.
      Parameters:
        `realm` -
        `user` -
      Returns:

    - #### deleteInvalidUser

          protected void deleteInvalidUser(RealmModel realm,
                                           UserModel user)

    - #### importValidation

          protected Stream<UserModel> importValidation(RealmModel realm,
                                                       Stream<UserModel> users)

    - #### query

          protected Stream<UserModel> query(org.keycloak.storage.UserStorageManager.PaginatedQuery pagedQuery,
                                            RealmModel realm,
                                            int firstResult,
                                            int maxResults)

    - #### addUser

          public UserModel addUser(RealmModel realm,
                                   String username)

      `UserRegistrationProvider` methods implementations start here
      Specified by:
        `addUser` in interface `UserRegistrationProvider`
      Returns:

    - #### removeUser

          public boolean removeUser(RealmModel realm,
                                    UserModel user)

      Description copied from interface: `UserRegistrationProvider`
      Called if user originated from this provider. If a local user is linked to this provider, this method will be called before local storage's removeUser() method is invoked. If you are using an import strategy, and this is a local user linked to this provider, this method will be called before local storage's removeUser() method is invoked. Also, you DO NOT need to remove the imported user. The runtime will handle this for you.
      Specified by:
        `removeUser` in interface `UserRegistrationProvider`
      Returns:

    - #### getUserById

          public UserModel getUserById(String id,
                                       RealmModel realm)

      `UserRegistrationProvider` methods implementations end here `UserLookupProvider` methods implementations start here
      Specified by:
        `getUserById` in interface `UserLookupProvider`

    - #### getUserByUsername

          public UserModel getUserByUsername(String username,
                                             RealmModel realm)

      Specified by:
        `getUserByUsername` in interface `UserLookupProvider`

    - #### getUserByEmail

          public UserModel getUserByEmail(String email,
                                          RealmModel realm)

      Specified by:
        `getUserByEmail` in interface `UserLookupProvider`
      Returns:

    - #### getGroupMembersStream

          public Stream<UserModel> getGroupMembersStream(RealmModel realm,
                                                         GroupModel group)

      `UserLookupProvider` methods implementations end here `UserQueryProvider` methods implementation start here
      Specified by:
        `getGroupMembersStream` in interface `UserQueryProvider`
      Specified by:
        `getGroupMembersStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `realm` - a reference to the realm.
        `group` - a reference to the group.
      Returns:
        a non-null `Stream` of users that belong to the group.
      See Also:
        `UserFederatedStorageProvider`

    - #### getGroupMembersStream

          public Stream<UserModel> getGroupMembersStream(RealmModel realm,
                                                         GroupModel group,
                                                         Integer firstResult,
                                                         Integer maxResults)

      Description copied from interface: `UserQueryProvider`
      Obtains users that belong to a specific group. Implementations do not have to search in `UserFederatedStorageProvider` as this is done automatically.
      Specified by:
        `getGroupMembersStream` in interface `UserQueryProvider`
      Specified by:
        `getGroupMembersStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `realm` - a reference to the realm.
        `group` - a reference to the group.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users that belong to the group.
      See Also:
        `UserFederatedStorageProvider`

    - #### getRoleMembersStream

          public Stream<UserModel> getRoleMembersStream(RealmModel realm,
                                                        RoleModel role)

      Description copied from interface: `UserQueryProvider`
      Obtains users that have the specified role.
      Specified by:
        `getRoleMembersStream` in interface `UserQueryProvider`
      Parameters:
        `realm` - a reference to the realm.
        `role` - a reference to the role.
      Returns:
        a non-null `Stream` of users that have the specified role.

    - #### getRoleMembersStream

          public Stream<UserModel> getRoleMembersStream(RealmModel realm,
                                                        RoleModel role,
                                                        Integer firstResult,
                                                        Integer maxResults)

      Description copied from interface: `UserQueryProvider`
      Searches for users that have the specified role.
      Specified by:
        `getRoleMembersStream` in interface `UserQueryProvider`
      Parameters:
        `realm` - a reference to the realm.
        `role` - a reference to the role.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users that have the specified role.

    - #### getUsersStream

          public Stream<UserModel> getUsersStream(RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Searches all users in the realm.
      Specified by:
        `getUsersStream` in interface `UserQueryProvider`
      Specified by:
        `getUsersStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of users.

    - #### getUsersStream

          public Stream<UserModel> getUsersStream(RealmModel realm,
                                                  int firstResult,
                                                  int maxResults)

      Description copied from interface: `UserQueryProvider`
      Searches all users in the realm, starting from the `firstResult` and containing at most `maxResults`.
      Specified by:
        `getUsersStream` in interface `UserQueryProvider`
      Specified by:
        `getUsersStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `realm` - a reference to the realm.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users.

    - #### getUsersStream

          public Stream<UserModel> getUsersStream(RealmModel realm,
                                                  boolean includeServiceAccounts)

      Description copied from interface: `UserProvider`
      Obtains the users associated with the specified realm.
      Specified by:
        `getUsersStream` in interface `UserProvider`
      Specified by:
        `getUsersStream` in interface `UserProvider.Streams`
      Parameters:
        `realm` - a reference to the realm being used for the search.
        `includeServiceAccounts` - `true` if service accounts should be included in the result; `false` otherwise.
      Returns:
        a non-null `Stream` of users associated withe the realm.

    - #### getUsersStream

          public Stream<UserModel> getUsersStream(RealmModel realm,
                                                  Integer firstResult,
                                                  Integer maxResults,
                                                  boolean includeServiceAccounts)

      Description copied from interface: `UserProvider`
      Obtains the users associated with the specified realm.
      Specified by:
        `getUsersStream` in interface `UserProvider`
      Specified by:
        `getUsersStream` in interface `UserProvider.Streams`
      Parameters:
        `realm` - a reference to the realm being used for the search.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
        `includeServiceAccounts` - `true` if service accounts should be included in the result; `false` otherwise.
      Returns:
        a non-null `Stream` of users associated withe the realm.

    - #### getUsersCount

          public int getUsersCount(RealmModel realm,
                                   boolean includeServiceAccount)

      Description copied from interface: `UserQueryProvider`
      Returns the number of users.
      Specified by:
        `getUsersCount` in interface `UserQueryProvider`
      Parameters:
        `realm` - the realm
        `includeServiceAccount` - if true, the number of users will also include service accounts. Otherwise, only the number of users.
      Returns:
        the number of users

    - #### getUsersCount

          public int getUsersCount(RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Returns the number of users, without consider any service account.
      Specified by:
        `getUsersCount` in interface `UserQueryProvider`
      Parameters:
        `realm` - the realm
      Returns:
        the number of users

    - #### getUsersCount

          public int getUsersCount(RealmModel realm,
                                   Set<String> groupIds)

      Description copied from interface: `UserQueryProvider`
      Returns the number of users that are in at least one of the groups given.
      Specified by:
        `getUsersCount` in interface `UserQueryProvider`
      Parameters:
        `realm` - the realm
        `groupIds` - set of groups id to check for
      Returns:
        the number of users that are in at least one of the groups

    - #### getUsersCount

          public int getUsersCount(String search,
                                   RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Returns the number of users that match the given criteria.
      Specified by:
        `getUsersCount` in interface `UserQueryProvider`
      Parameters:
        `search` - search criteria
        `realm` - the realm
      Returns:
        number of users that match the search

    - #### getUsersCount

          public int getUsersCount(String search,
                                   RealmModel realm,
                                   Set<String> groupIds)

      Description copied from interface: `UserQueryProvider`
      Returns the number of users that match the given criteria and are in at least one of the groups given.
      Specified by:
        `getUsersCount` in interface `UserQueryProvider`
      Parameters:
        `search` - search criteria
        `realm` - the realm
        `groupIds` - set of groups to check for
      Returns:
        number of users that match the search and given groups

    - #### getUsersCount

          public int getUsersCount(Map<String,String> params,
                                   RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Returns the number of users that match the given filter parameters.
      Specified by:
        `getUsersCount` in interface `UserQueryProvider`
      Parameters:
        `params` - filter parameters
        `realm` - the realm
      Returns:
        number of users that match the given filters

    - #### getUsersCount

          public int getUsersCount(Map<String,String> params,
                                   RealmModel realm,
                                   Set<String> groupIds)

      Description copied from interface: `UserQueryProvider`
      Returns the number of users that match the given filter parameters and is in at least one of the given groups.
      Specified by:
        `getUsersCount` in interface `UserQueryProvider`
      Parameters:
        `params` - filter parameters
        `realm` - the realm
        `groupIds` - set if groups to check for
      Returns:
        number of users that match the given filters and groups

    - #### searchForUserStream

          public Stream<UserModel> searchForUserStream(String search,
                                                       RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Searches for users with username, email or first + last name that is like search string. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE).

      This method is used by the admin console search box
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider`
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `search` - case sensitive search string.
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of users that match the search string.

    - #### searchForUserStream

          public Stream<UserModel> searchForUserStream(String search,
                                                       RealmModel realm,
                                                       Integer firstResult,
                                                       Integer maxResults)

      Description copied from interface: `UserQueryProvider`
      Searches for users with username, email or first + last name that is like search string. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE).

      This method is used by the admin console search box
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider`
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `search` - case sensitive search string.
        `realm` - a reference to the realm.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users that match the search criteria.

    - #### searchForUserStream

          public Stream<UserModel> searchForUserStream(Map<String,String> attributes,
                                                       RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Searches for user by parameter. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE). Valid parameters are:
      - first - first name
      - last - last name
      - email - email
      - username - username
      - enabled - if user is enabled (true/false)
      This method is used by the REST API when querying users.
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider`
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `attributes` - a map containing the search parameters.
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of users that match the search parameters.

    - #### searchForUserStream

          public Stream<UserModel> searchForUserStream(Map<String,String> attributes,
                                                       RealmModel realm,
                                                       Integer firstResult,
                                                       Integer maxResults)

      Description copied from interface: `UserQueryProvider`
      Searches for user by parameter. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE). Valid parameters are:
      - first - first name
      - last - last name
      - email - email
      - username - username
      - enabled - if user is enabled (true/false)
      This method is used by the REST API when querying users.
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider`
      Specified by:
        `searchForUserStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `attributes` - a map containing the search parameters.
        `realm` - a reference to the realm.
        `firstResult` - first result to return. Ignored if negative.
        `maxResults` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of users that match the search criteria.

    - #### searchForUserByUserAttributeStream

          public Stream<UserModel> searchForUserByUserAttributeStream(String attrName,
                                                                      String attrValue,
                                                                      RealmModel realm)

      Description copied from interface: `UserQueryProvider`
      Searches for users that have a specific attribute with a specific value. Implementations do not have to search in `UserFederatedStorageProvider` as this is done automatically.
      Specified by:
        `searchForUserByUserAttributeStream` in interface `UserQueryProvider`
      Specified by:
        `searchForUserByUserAttributeStream` in interface `UserQueryProvider.Streams`
      Parameters:
        `attrName` - the attribute name.
        `attrValue` - the attribute value.
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of users that match the search criteria.
      See Also:
        `UserFederatedStorageProvider`

    - #### grantToAllUsers

          public void grantToAllUsers(RealmModel realm,
                                      RoleModel role)

      `UserQueryProvider` methods implementation end here `UserBulkUpdateProvider` methods implementation start here
      Specified by:
        `grantToAllUsers` in interface `UserBulkUpdateProvider`
      Parameters:
        `realm` - Realm
        `role` - Role to be granted

    - #### preRemove

          public void preRemove(RealmModel realm)

      `UserBulkUpdateProvider` methods implementation end here `UserStorageProvider` methods implementations start here -> no StorageProviders involved
      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                GroupModel group)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                RoleModel role)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### addUser

          public UserModel addUser(RealmModel realm,
                                   String id,
                                   String username,
                                   boolean addDefaultRoles,
                                   boolean addDefaultRequiredActions)

      `UserStorageProvider` methods implementation end here `UserProvider` methods implementations start here -> no StorageProviders involved
      Specified by:
        `addUser` in interface `UserProvider`
      Returns:

    - #### addFederatedIdentity

          public void addFederatedIdentity(RealmModel realm,
                                           UserModel user,
                                           FederatedIdentityModel socialLink)

      Specified by:
        `addFederatedIdentity` in interface `UserProvider`

    - #### updateFederatedIdentity

          public void updateFederatedIdentity(RealmModel realm,
                                              UserModel federatedUser,
                                              FederatedIdentityModel federatedIdentityModel)

      Specified by:
        `updateFederatedIdentity` in interface `UserProvider`

    - #### removeFederatedIdentity

          public boolean removeFederatedIdentity(RealmModel realm,
                                                 UserModel user,
                                                 String socialProvider)

      Specified by:
        `removeFederatedIdentity` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                IdentityProviderModel provider)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### addConsent

          public void addConsent(RealmModel realm,
                                 String userId,
                                 UserConsentModel consent)

      Specified by:
        `addConsent` in interface `UserProvider`

    - #### getConsentByClient

          public UserConsentModel getConsentByClient(RealmModel realm,
                                                     String userId,
                                                     String clientInternalId)

      Specified by:
        `getConsentByClient` in interface `UserProvider`

    - #### getConsentsStream

          public Stream<UserConsentModel> getConsentsStream(RealmModel realm,
                                                            String userId)

      Description copied from interface: `UserProvider`
      Obtains the consents associated with the user identified by the specified `userId`.
      Specified by:
        `getConsentsStream` in interface `UserProvider`
      Specified by:
        `getConsentsStream` in interface `UserProvider.Streams`
      Parameters:
        `realm` - a reference to the realm.
        `userId` - the user identifier.
      Returns:
        a non-null `Stream` of consents associated with the user.

    - #### updateConsent

          public void updateConsent(RealmModel realm,
                                    String userId,
                                    UserConsentModel consent)

      Specified by:
        `updateConsent` in interface `UserProvider`

    - #### revokeConsentForClient

          public boolean revokeConsentForClient(RealmModel realm,
                                                String userId,
                                                String clientInternalId)

      Specified by:
        `revokeConsentForClient` in interface `UserProvider`

    - #### setNotBeforeForUser

          public void setNotBeforeForUser(RealmModel realm,
                                          UserModel user,
                                          int notBefore)

      Specified by:
        `setNotBeforeForUser` in interface `UserProvider`

    - #### getNotBeforeOfUser

          public int getNotBeforeOfUser(RealmModel realm,
                                        UserModel user)

      Specified by:
        `getNotBeforeOfUser` in interface `UserProvider`

    - #### getUserByFederatedIdentity

          public UserModel getUserByFederatedIdentity(FederatedIdentityModel socialLink,
                                                      RealmModel realm)

      Specified by:
        `getUserByFederatedIdentity` in interface `UserProvider`

    - #### getServiceAccount

          public UserModel getServiceAccount(ClientModel client)

      Specified by:
        `getServiceAccount` in interface `UserProvider`
      Returns:

    - #### getFederatedIdentitiesStream

          public Stream<FederatedIdentityModel> getFederatedIdentitiesStream(UserModel user,
                                                                             RealmModel realm)

      Description copied from interface: `UserProvider`
      Obtains the federated identities of the specified user.
      Specified by:
        `getFederatedIdentitiesStream` in interface `UserProvider`
      Specified by:
        `getFederatedIdentitiesStream` in interface `UserProvider.Streams`
      Parameters:
        `user` - a reference to the user.
        `realm` - a reference to the realm.
      Returns:
        a non-null `Stream` of federated identities associated with the user.

    - #### getFederatedIdentity

          public FederatedIdentityModel getFederatedIdentity(UserModel user,
                                                             String socialProvider,
                                                             RealmModel realm)

      Specified by:
        `getFederatedIdentity` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                ClientModel client)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(ProtocolMapperModel protocolMapper)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(ClientScopeModel clientScope)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                ComponentModel component)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### removeImportedUsers

          public void removeImportedUsers(RealmModel realm,
                                          String storageProviderId)

      Description copied from interface: `UserProvider`
      Removes any imported users from a specific User Storage Provider.
      Specified by:
        `removeImportedUsers` in interface `UserProvider`

    - #### unlinkUsers

          public void unlinkUsers(RealmModel realm,
                                  String storageProviderId)

      Description copied from interface: `UserProvider`
      Set federation link to null to imported users of a specific User Storage Provider
      Specified by:
        `unlinkUsers` in interface `UserProvider`

    - #### close

          public void close()

      `UserProvider` methods implementations end here
      Specified by:
        `close` in interface `UserProvider`
      Specified by:
        `close` in interface `Provider`

    - #### onCreate

          public void onCreate(KeycloakSession session,
                               RealmModel realm,
                               ComponentModel model)

      Specified by:
        `onCreate` in interface `OnCreateComponent`

    - #### onUpdate

          public void onUpdate(KeycloakSession session,
                               RealmModel realm,
                               ComponentModel oldModel,
                               ComponentModel newModel)

      Specified by:
        `onUpdate` in interface `OnUpdateComponent`

    - #### onCache

          public void onCache(RealmModel realm,
                              CachedUserModel user,
                              UserModel delegate)

      Specified by:
        `onCache` in interface `OnUserCache`

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