Interface Cache

All Known Implementing Classes:
FileCacheImpl, PassThroughCache

public interface Cache
Represents a file cache.
Since:
2.13
  • Method Details

    • cache

      boolean cache(String bucket, String key, OutputStream out, Cache.StreamProvider provider)
      Stream the contents identified by the key to the destination stream. Should the contents not exist in the cache a new entry should be created if the implementation is a caching implementation.
      Parameters:
      bucket - bucket to group keys
      key - can not be null
      out - where to write the cached item to
      provider - provides the underlying item on a cache-miss
      Returns:
      if it was a cache-hit
    • cacheTwo

      boolean cacheTwo(String bucket, String key, OutputStream out1, OutputStream out2, Cache.TwoStreamProvider provider)
      Stream two contents identified by the key to the destination stream. Should the contents not exist in the cache a new entry should be created if the implementation is a caching implementation.
      Parameters:
      bucket - bucket to group keys
      key - can not be null
      out1 - where to write the first cached item to
      out2 - where to write the second cached item to
      provider - provides the underlying item on a cache-miss
      Returns:
      if it was a cache-hit
      Since:
      3.3
    • clear

      void clear()
      Remove all entries in the cache.