org.keycloak.models.cache

## Class MemoryUserCache

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

- All Implemented Interfaces:
    UserCache

      public class MemoryUserCache
      extends Object
      implements UserCache

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `MemoryUserCache.RealmUsers`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `enabled`
    `protected int` | `maxUserCacheSize`
    `protected ConcurrentHashMap<String,MemoryUserCache.RealmUsers>` | `realmUsers`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MemoryUserCache()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCachedUser(String realmId, CachedUser user)`
    `void` | `clear()`
    `CachedUser` | `getCachedUser(String realmId, String id)`
    `CachedUser` | `getCachedUserByEmail(String realmId, String email)`
    `CachedUser` | `getCachedUserByUsername(String realmId, String name)`
    `int` | `getMaxUserCacheSize()`
    `void` | `invalidateCachedUser(String realmId, CachedUser user)`
    `void` | `invalidateCachedUserById(String realmId, String id)`
    `void` | `invalidateRealmUsers(String realmId)`
    `boolean` | `isEnabled()`
    `void` | `setEnabled(boolean enabled)`
    `void` | `setMaxUserCacheSize(int maxUserCacheSize)`

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

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

- - ### Field Detail

    - #### maxUserCacheSize

          protected int maxUserCacheSize

    - #### enabled

          protected volatile boolean enabled

    - #### realmUsers

          protected ConcurrentHashMap<String,MemoryUserCache.RealmUsers> realmUsers

  - ### Constructor Detail

    - #### MemoryUserCache

          public MemoryUserCache()

  - ### Method Detail

    - #### getMaxUserCacheSize

          public int getMaxUserCacheSize()

    - #### setMaxUserCacheSize

          public void setMaxUserCacheSize(int maxUserCacheSize)

    - #### isEnabled

          public boolean isEnabled()

      Specified by:
        `isEnabled` in interface `UserCache`

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Specified by:
        `setEnabled` in interface `UserCache`

    - #### getCachedUser

          public CachedUser getCachedUser(String realmId,
                                 String id)

      Specified by:
        `getCachedUser` in interface `UserCache`

    - #### invalidateCachedUser

          public void invalidateCachedUser(String realmId,
                                  CachedUser user)

      Specified by:
        `invalidateCachedUser` in interface `UserCache`

    - #### invalidateCachedUserById

          public void invalidateCachedUserById(String realmId,
                                      String id)

      Specified by:
        `invalidateCachedUserById` in interface `UserCache`

    - #### addCachedUser

          public void addCachedUser(String realmId,
                           CachedUser user)

      Specified by:
        `addCachedUser` in interface `UserCache`

    - #### getCachedUserByUsername

          public CachedUser getCachedUserByUsername(String realmId,
                                           String name)

      Specified by:
        `getCachedUserByUsername` in interface `UserCache`

    - #### getCachedUserByEmail

          public CachedUser getCachedUserByEmail(String realmId,
                                        String email)

      Specified by:
        `getCachedUserByEmail` in interface `UserCache`

    - #### invalidateRealmUsers

          public void invalidateRealmUsers(String realmId)

      Specified by:
        `invalidateRealmUsers` in interface `UserCache`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `UserCache`

Copyright © 2014. All Rights Reserved.