Interface CacheKey
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CombinedCacheKey,GroupCacheKey,KeyValueCacheKey,RequestPathCacheKey,ResourcePathCacheKey
public interface CacheKey extends Serializable
Generic CacheKey interface that allows multiple implementations of CacheKey's via CacheKeyFactories. All CacheKeys are scoped to being get off the Request object. Implementations are expected to overridehashCode(), equals(Object), toString()methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanequals(Object o)The equals method used to match up request-derived cache keys with keys in the httpcache.default longgetExpiryForAccess()Gets the expiry time for the cache entry access / read.default longgetExpiryForCreation()Gets the expiry time for the cache entry creation.default longgetExpiryForUpdate()Gets the expiry time for the cache entry updated.StringgetHierarchyResourcePath()Gets the Hierarchy Resource Path (the resourcePath above jcr:content).StringgetUri()Get URI.inthashCode()The hashCode for the cache key.booleanisInvalidatedBy(CacheKey cacheKey)Determines if the @{param cacheKey} will invalidate this cache key entry.StringtoString()The useful string representation of this cache key.
-
-
-
Method Detail
-
getUri
String getUri()
Get URI.- Returns:
- the universal resource id. This can be a RequestURI or a Resource path based on the context of the key.
-
getHierarchyResourcePath
String getHierarchyResourcePath()
Gets the Hierarchy Resource Path (the resourcePath above jcr:content). This is used for invalidations.- Returns:
- the hierarchy resource path
-
getExpiryForCreation
default long getExpiryForCreation()
Gets the expiry time for the cache entry creation. If set, it will override the default TTL for entries to expire on cache creation. Value is in miliseconds.- Returns:
- the expiry time
-
getExpiryForAccess
default long getExpiryForAccess()
Gets the expiry time for the cache entry access / read. If set, it will refresh the expiry time when an entry is read with given value. Value is in miliseconds.- Returns:
- the expiry time
-
getExpiryForUpdate
default long getExpiryForUpdate()
Gets the expiry time for the cache entry updated. If set, it will refresh the expiry time when an entry is updated with given value. Value is in miliseconds.- Returns:
- the expiry time
-
isInvalidatedBy
boolean isInvalidatedBy(CacheKey cacheKey)
Determines if the @{param cacheKey} will invalidate this cache key entry.- Parameters:
cacheKey-- Returns:
- true if is invalidated by, otherwise false
-
hashCode
int hashCode()
The hashCode for the cache key.
-
toString
String toString()
The useful string representation of this cache key. This should be generally unique as it drives display in the mbean.
-
-