Package org.hippoecm.hst.core.container
Interface PageCacheKey
- All Superinterfaces:
Serializable
A
PageCacheKey
represents a key that can be used to qualify/categorize some request. Different Valve
s can
contribute to this PageCacheKey
through setAttribute(java.lang.String, java.io.Serializable)
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
seal()
Afterseal()
is invoked, a call tosetAttribute(String, Serializable)
will result in anIllegalStateException
void
setAttribute
(String subKey, Serializable keyFragment) All the combined attributes will make up the finalPageCacheKey
.
-
Method Details
-
setAttribute
All the combined attributes will make up the final
PageCacheKey
. Note that the ORDER in which the attributes are set DO influence the final created cachekey. Make sure that your added keyFragment object have a decentObject.hashCode()
andObject.equals(Object)
implementation that is also efficient as it will be used when storing objects in a cache with keyPageCacheKey
.The
subKey
can best be prefixed by namespacing (FQN of class calling the setAttribute) to avoid collisions. For examplePageCacheKey#setAttribute(MyValve.class.getName() + ".ip", ip-address);
- Parameters:
subKey
- the key to which the fragment belongs, not allowed to benull
keyFragment
- the fragment for the subKey, not allowed to benull
- Throws:
IllegalStateException
- is thisPageCacheKey
has been sealed viaseal()
-
seal
void seal()Afterseal()
is invoked, a call tosetAttribute(String, Serializable)
will result in anIllegalStateException
-