org.keycloak.models.file

## Class FileUserProvider

- java.lang.Object
- - org.keycloak.models.file.FileUserProvider

- All Implemented Interfaces:
    UserProvider, Provider

      public class FileUserProvider
      extends Object
      implements UserProvider

  UserProvider for JSON persistence.
  Author:
    Stan Silvert ssilvert@redhat.com (C) 2015 Red Hat Inc.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileUserProvider(KeycloakSession session, FileConnectionProvider fcProvider)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFederatedIdentity(RealmModel realm, UserModel user, FederatedIdentityModel socialLink)`
    `UserModel` | `addUser(RealmModel realm, String username)`
    `UserAdapter` | `addUser(RealmModel realm, String id, String username, boolean addDefaultRoles)`
    `protected UserAdapter` | `addUserEntity(RealmModel realm, String userId, String username)`
    `void` | `close()`
    `Set<FederatedIdentityModel>` | `getFederatedIdentities(UserModel userModel, RealmModel realm)`
    `FederatedIdentityModel` | `getFederatedIdentity(UserModel user, String socialProvider, RealmModel realm)`
    `UserModel` | `getUserByEmail(String email, RealmModel realm)`
    `UserModel` | `getUserByFederatedIdentity(FederatedIdentityModel socialLink, RealmModel realm)`
    `UserModel` | `getUserById(String userId, RealmModel realm)`
    `UserModel` | `getUserByUsername(String username, RealmModel realm)`
    `List<UserModel>` | `getUsers(RealmModel realm)`
    `List<UserModel>` | `getUsers(RealmModel realm, int firstResult, int maxResults)`
    `int` | `getUsersCount(RealmModel realm)`
    `protected boolean` | `isAMatch(Pattern pattern, String value)`
    `void` | `preRemove(RealmModel realm)`
    `void` | `preRemove(RealmModel realm, RoleModel role)`
    `void` | `preRemove(RealmModel realm, UserFederationProviderModel link)`
    `boolean` | `removeFederatedIdentity(RealmModel realm, UserModel userModel, String socialProvider)`
    `boolean` | `removeUser(RealmModel realm, UserModel user)`
    `List<UserModel>` | `searchForUser(String search, RealmModel realm)`
    `List<UserModel>` | `searchForUser(String search, RealmModel realm, int firstResult, int maxResults)`
    `List<UserModel>` | `searchForUserByAttributes(Map<String,String> attributes, RealmModel realm)`
    `List<UserModel>` | `searchForUserByAttributes(Map<String,String> attributes, RealmModel realm, int firstResult, int maxResults)`
    `protected List<UserModel>` | `sortedSubList(List list, int firstResult, int maxResults)`
    `void` | `updateFederatedIdentity(RealmModel realm, UserModel federatedUser, FederatedIdentityModel federatedIdentityModel)`
    `CredentialValidationOutput` | `validCredentials(RealmModel realm, UserCredentialModel... input)`
    `boolean` | `validCredentials(RealmModel realm, UserModel user, List<UserCredentialModel> input)`
    `boolean` | `validCredentials(RealmModel realm, UserModel user, UserCredentialModel... input)`

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

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

- - ### Constructor Detail

    - #### FileUserProvider

          public FileUserProvider(KeycloakSession session,
                          FileConnectionProvider fcProvider)

  - ### Method Detail

    - #### close

          public void close()

      Specified by:
        `close` in interface `UserProvider`
      Specified by:
        `close` in interface `Provider`

    - #### getUserById

          public UserModel getUserById(String userId,
                              RealmModel realm)

      Specified by:
        `getUserById` in interface `UserProvider`

    - #### getUserByUsername

          public UserModel getUserByUsername(String username,
                                    RealmModel realm)

      Specified by:
        `getUserByUsername` in interface `UserProvider`

    - #### getUserByEmail

          public UserModel getUserByEmail(String email,
                                 RealmModel realm)

      Specified by:
        `getUserByEmail` in interface `UserProvider`

    - #### getUserByFederatedIdentity

          public UserModel getUserByFederatedIdentity(FederatedIdentityModel socialLink,
                                             RealmModel realm)

      Specified by:
        `getUserByFederatedIdentity` in interface `UserProvider`

    - #### getUsers

          public List<UserModel> getUsers(RealmModel realm)

      Specified by:
        `getUsers` in interface `UserProvider`

    - #### getUsersCount

          public int getUsersCount(RealmModel realm)

      Specified by:
        `getUsersCount` in interface `UserProvider`

    - #### getUsers

          public List<UserModel> getUsers(RealmModel realm,
                                 int firstResult,
                                 int maxResults)

      Specified by:
        `getUsers` in interface `UserProvider`

    - #### sortedSubList

          protected List<UserModel> sortedSubList(List list,
                                      int firstResult,
                                      int maxResults)

    - #### searchForUser

          public List<UserModel> searchForUser(String search,
                                      RealmModel realm)

      Specified by:
        `searchForUser` in interface `UserProvider`

    - #### searchForUser

          public List<UserModel> searchForUser(String search,
                                      RealmModel realm,
                                      int firstResult,
                                      int maxResults)

      Specified by:
        `searchForUser` in interface `UserProvider`

    - #### searchForUserByAttributes

          public List<UserModel> searchForUserByAttributes(Map<String,String> attributes,
                                                  RealmModel realm)

      Specified by:
        `searchForUserByAttributes` in interface `UserProvider`

    - #### isAMatch

          protected boolean isAMatch(Pattern pattern,
                         String value)

    - #### searchForUserByAttributes

          public List<UserModel> searchForUserByAttributes(Map<String,String> attributes,
                                                  RealmModel realm,
                                                  int firstResult,
                                                  int maxResults)

      Specified by:
        `searchForUserByAttributes` in interface `UserProvider`

    - #### getFederatedIdentities

          public Set<FederatedIdentityModel> getFederatedIdentities(UserModel userModel,
                                                           RealmModel realm)

      Specified by:
        `getFederatedIdentities` in interface `UserProvider`

    - #### getFederatedIdentity

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

      Specified by:
        `getFederatedIdentity` in interface `UserProvider`

    - #### addUser

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

      Specified by:
        `addUser` in interface `UserProvider`

    - #### addUserEntity

          protected UserAdapter addUserEntity(RealmModel realm,
                                  String userId,
                                  String username)

    - #### removeUser

          public boolean removeUser(RealmModel realm,
                           UserModel user)

      Specified by:
        `removeUser` in interface `UserProvider`

    - #### addFederatedIdentity

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

      Specified by:
        `addFederatedIdentity` in interface `UserProvider`

    - #### removeFederatedIdentity

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

      Specified by:
        `removeFederatedIdentity` in interface `UserProvider`

    - #### addUser

          public UserModel addUser(RealmModel realm,
                          String username)

      Specified by:
        `addUser` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                       UserFederationProviderModel link)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                       RoleModel role)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### validCredentials

          public boolean validCredentials(RealmModel realm,
                                 UserModel user,
                                 List<UserCredentialModel> input)

      Specified by:
        `validCredentials` in interface `UserProvider`

    - #### validCredentials

          public boolean validCredentials(RealmModel realm,
                                 UserModel user,
                                 UserCredentialModel... input)

      Specified by:
        `validCredentials` in interface `UserProvider`

    - #### updateFederatedIdentity

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

      Specified by:
        `updateFederatedIdentity` in interface `UserProvider`

    - #### validCredentials

          public CredentialValidationOutput validCredentials(RealmModel realm,
                                                    UserCredentialModel... input)

      Specified by:
        `validCredentials` in interface `UserProvider`

Copyright © 2015. All rights reserved.