Class CacheManager
java.lang.Object
org.reprogle.honeypot.common.storagemanager.CacheManager
A rudimentary caching utility to lessen dependency on databases used by Honeypot
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToCache(HoneypotBlockObject block) Adds aHoneypotBlockObjectto the cachestatic voidWipe the cachestatic List<HoneypotBlockObject>getCache()Gets the entire cache list for further processing if necessarystatic HoneypotBlockObjectisInCache(HoneypotBlockObject block) Determines if the Honeypot is in the cache or notstatic booleanRemoves a block from the cache.
-
Method Details
-
getCache
Gets the entire cache list for further processing if necessary- Returns:
- The List of
HoneypotBlockObjectin the cache
-
addToCache
Adds aHoneypotBlockObjectto the cache- Parameters:
block- The honeypot to add to cache
-
removeFromCache
Removes a block from the cache. Returns an optional boolean if the Honeypot existed and was deleted or not- Parameters:
block- TheHoneypotBlockObjectto remove- Returns:
- True if the removal was successful, false if not (Likely due to it not existing)
-
isInCache
Determines if the Honeypot is in the cache or not- Parameters:
block- The Honeypot to check if it's in cache- Returns:
- The
HoneypotBlockObjectif it's successfully found, null if not
-
clearCache
public static void clearCache()Wipe the cache
-