Class ModernUserMap

java.lang.Object
com.google.common.cache.CacheLoader<UUID,User>
com.earth2me.essentials.userstorage.ModernUserMap
All Implemented Interfaces:
IUserMap

public class ModernUserMap extends com.google.common.cache.CacheLoader<UUID,User> implements IUserMap
  • Constructor Details

    • ModernUserMap

      public ModernUserMap(IEssentials ess)
  • Method Details

    • getAllUserUUIDs

      public Set<UUID> getAllUserUUIDs()
      Description copied from interface: IUserMap
      Gets all the UUIDs of every User which has joined.
      Specified by:
      getAllUserUUIDs in interface IUserMap
      Returns:
      the UUIDs of all Users.
    • getCachedCount

      public long getCachedCount()
      Description copied from interface: IUserMap
      Gets the current amount of users loaded into memory.
      Specified by:
      getCachedCount in interface IUserMap
      Returns:
      the amount of users loaded into memory.
    • getUserCount

      public int getUserCount()
      Description copied from interface: IUserMap
      Gets the amount of users stored by Essentials.
      Specified by:
      getUserCount in interface IUserMap
      Returns:
      the amount of users stored by Essentials.
    • getUser

      public User getUser(UUID uuid)
      Specified by:
      getUser in interface IUserMap
    • getUser

      public User getUser(Player base)
      Specified by:
      getUser in interface IUserMap
    • getUser

      public User getUser(String name)
      Specified by:
      getUser in interface IUserMap
    • addCachedNpcName

      public void addCachedNpcName(UUID uuid, String name)
    • load

      public User load(UUID uuid) throws Exception
      Specified by:
      load in class com.google.common.cache.CacheLoader<UUID,User>
      Throws:
      Exception
    • loadUncachedUser

      public User loadUncachedUser(Player base)
      Specified by:
      loadUncachedUser in interface IUserMap
    • loadUncachedUser

      public User loadUncachedUser(UUID uuid)
      Description copied from interface: IUserMap
      Gets a User by the given UUID in the cache, if present, otherwise loads the user without placing them in the cache. Ideally to be used when running operations on all stored users.
      Specified by:
      loadUncachedUser in interface IUserMap
      Parameters:
      uuid - the UUID of the user to get.
      Returns:
      the User with the given UUID, or null if not found.
    • getNameCache

      public Map<String,UUID> getNameCache()
      Description copied from interface: IUserMap
      Gets the name to UUID cache.
      Specified by:
      getNameCache in interface IUserMap
      Returns:
      the name to UUID cache.
    • getSanitizedName

      public String getSanitizedName(String name)
    • blockingSave

      public void blockingSave()
    • invalidate

      public void invalidate(UUID uuid)
    • shutdown

      public void shutdown()