Class FileResourceCache

java.lang.Object
org.episteme.core.io.cache.FileResourceCache
All Implemented Interfaces:
ResourceCache

public class FileResourceCache extends Object implements ResourceCache
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • getInstance

      public static FileResourceCache getInstance()
    • setTtl

      public void setTtl(long ttlMillis)
      Sets the time-to-live for cached entries.
      Parameters:
      ttlMillis - TTL in milliseconds
    • get

      public Optional<String> get(String key)
      Description copied from interface: ResourceCache
      Retrieves data from the cache.
      Specified by:
      get in interface ResourceCache
      Parameters:
      key - unique identifier (e.g., "pubchem_aspirin")
      Returns:
      Optional containing data if found
    • put

      public void put(String key, String data)
      Description copied from interface: ResourceCache
      Puts data into the cache.
      Specified by:
      put in interface ResourceCache
      Parameters:
      key - unique identifier
      data - data to store
    • clear

      public void clear()
      Description copied from interface: ResourceCache
      Clears the cache.
      Specified by:
      clear in interface ResourceCache