Interface HttpCacheStore
public interface HttpCacheStore
Data store for persisting cache items. Data store implementation could be in-memory, disk or even JCR repository.
Multiple implementation of this cache store can be present at any time and they can work in conjunction.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRepresents the key to find out the type of cache data store.static final Stringstatic final Stringstatic final StringValue representing EHCache type of cache store for the keyKEY_CACHE_STORE_TYPEstatic final StringValue representing disk type of cache store for the keyKEY_CACHE_STORE_TYPEstatic final StringValue representing JCR type of cache store for the keyKEY_CACHE_STORE_TYPEstatic final StringValue representing in-memory type of cache store for the keyKEY_CACHE_STORE_TYPE -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if there is an entry in cache for the given key.Create a temp sink for stashing response stream.getIfPresent(CacheKey key) Get the Cache item given a key.Returns the store type of this store.voidinvalidate(HttpCacheConfig cacheConfig) Invalidate all the cached items applicable for the given cache config.voidinvalidate(CacheKey key) Invalidate the given cache key.voidInvalidate all entries in the cache.voidput(CacheKey key, CacheContent content) Put an item into the cache.longsize()Get the number of entries in the cache.
-
Field Details
-
KEY_CACHE_STORE_TYPE
Represents the key to find out the type of cache data store. Type could be MEM, DISK, JCR, etc.- See Also:
-
VALUE_MEM_CACHE_STORE_TYPE
Value representing in-memory type of cache store for the keyKEY_CACHE_STORE_TYPE- See Also:
-
VALUE_DISK_CACHE_STORE_TYPE
Value representing disk type of cache store for the keyKEY_CACHE_STORE_TYPE- See Also:
-
VALUE_JCR_CACHE_STORE_TYPE
Value representing JCR type of cache store for the keyKEY_CACHE_STORE_TYPE- See Also:
-
VALUE_CAFFEINE_MEMORY_STORE_TYPE
Value representing EHCache type of cache store for the keyKEY_CACHE_STORE_TYPE- See Also:
-
PN_TTL
- See Also:
-
PN_MAXSIZE
- See Also:
-
-
Method Details
-
put
Put an item into the cache.- Parameters:
key- Object holding the key attributes.content- Object holding the content which needs to be cached.- Throws:
HttpCacheDataStreamException- Failure when reading the input stream.
-
contains
Check if there is an entry in cache for the given key.- Parameters:
key-- Returns:
-
getIfPresent
Get the Cache item given a key.- Parameters:
key- bject holding the key attributes.- Returns:
- Object holding the content which needs to be cached. Null if key not present.
-
size
long size()Get the number of entries in the cache.- Returns:
-
invalidate
Invalidate the given cache key.- Parameters:
key-
-
invalidate
Invalidate all the cached items applicable for the given cache config.- Parameters:
cacheConfig-
-
invalidateAll
void invalidateAll()Invalidate all entries in the cache. -
createTempSink
TempSink createTempSink()Create a temp sink for stashing response stream.- Returns:
-
getStoreType
String getStoreType()Returns the store type of this store.- Returns:
-