Interface CacheKey
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CombinedCacheKey,GroupCacheKey,KeyValueCacheKey,RequestPathCacheKey,ResourcePathCacheKey
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 override
hashCode(),
equals(Object), toString() methods.-
Method Summary
Modifier and TypeMethodDescriptionbooleanThe equals method used to match up request-derived cache keys with keys in the httpcache.default longGets the expiry time for the cache entry access / read.default longGets the expiry time for the cache entry creation.default longGets the expiry time for the cache entry updated.Gets the Hierarchy Resource Path (the resourcePath above jcr:content).getUri()Get URI.inthashCode()The hashCode for the cache key.booleanisInvalidatedBy(CacheKey cacheKey) Determines if the @{param cacheKey} will invalidate this cache key entry.toString()The useful string representation of this cache key.
-
Method Details
-
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
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. -
equals
The equals method used to match up request-derived cache keys with keys in the httpcache.
-