Interface Cache
- All Known Implementing Classes:
FileCacheImpl,PassThroughCache
public interface Cache
Represents a file cache.
- Since:
- 2.13
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInterface used by the file caching system.static interfaceInterface used by the file caching system. -
Method Summary
Modifier and TypeMethodDescriptionbooleancache(String bucket, String key, OutputStream out, Cache.StreamProvider provider) Stream the contents identified by the key to the destination stream.booleancacheTwo(String bucket, String key, OutputStream out1, OutputStream out2, Cache.TwoStreamProvider provider) Stream two contents identified by the key to the destination stream.voidclear()Remove all entries in the cache.
-
Method Details
-
cache
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 keyskey- can not be nullout- where to write the cached item toprovider- 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 keyskey- can not be nullout1- where to write the first cached item toout2- where to write the second cached item toprovider- 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.
-