Package org.microproxy.cache
Interface CacheStore
- All Known Implementing Classes:
DiskCacheStore,MemoryCacheStore
public interface CacheStore
Where
HttpCache keeps responses. Implementations must be safe for concurrent use; MemoryCacheStore and DiskCacheStore are provided.-
Method Summary
Modifier and TypeMethodDescriptionintcount()Returns the number of stored responses (variants).The stored variants forkey(a URL), most recently stored first; empty if none.voidput(CachedResponse response) Storesresponse, replacing the variant of its key with the samevaryvalues.voidRemoves every variant stored forkey.longsize()Returns the totalCachedResponse.weight()of what is stored.
-
Method Details
-
get
The stored variants forkey(a URL), most recently stored first; empty if none.- Parameters:
key- the URL whose variants to retrieve- Returns:
- the stored variants for
key(a URL), most recently stored first; empty if none
-
put
Storesresponse, replacing the variant of its key with the samevaryvalues.- Parameters:
response- the response being handled
-
remove
Removes every variant stored forkey.- Parameters:
key- the URL whose variants to remove
-
size
long size()Returns the totalCachedResponse.weight()of what is stored.- Returns:
- the total
CachedResponse.weight()of what is stored
-
count
int count()Returns the number of stored responses (variants).- Returns:
- the number of stored responses (variants)
-