Class CacheManager

java.lang.Object
org.reprogle.honeypot.common.storagemanager.CacheManager

public class CacheManager extends Object
A rudimentary caching utility to lessen dependency on databases used by Honeypot
  • Method Details

    • getCache

      public static List<HoneypotBlockObject> getCache()
      Gets the entire cache list for further processing if necessary
      Returns:
      The List of HoneypotBlockObject in the cache
    • addToCache

      public static void addToCache(HoneypotBlockObject block)
      Adds a HoneypotBlockObject to the cache
      Parameters:
      block - The honeypot to add to cache
    • removeFromCache

      public static boolean removeFromCache(HoneypotBlockObject block)
      Removes a block from the cache. Returns an optional boolean if the Honeypot existed and was deleted or not
      Parameters:
      block - The HoneypotBlockObject to remove
      Returns:
      True if the removal was successful, false if not (Likely due to it not existing)
    • isInCache

      public static HoneypotBlockObject isInCache(HoneypotBlockObject block)
      Determines if the Honeypot is in the cache or not
      Parameters:
      block - The Honeypot to check if it's in cache
      Returns:
      The HoneypotBlockObject if it's successfully found, null if not
    • clearCache

      public static void clearCache()
      Wipe the cache