Package org.hippoecm.hst.core.container
Interface PageCacheKey
-
- All Superinterfaces:
Serializable
public interface PageCacheKey extends Serializable
APageCacheKey
represents a key that can be used to qualify/categorize some request. DifferentValve
s can contribute to thisPageCacheKey
throughsetAttribute(java.lang.String, java.io.Serializable)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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 Detail
-
setAttribute
void setAttribute(String subKey, Serializable keyFragment) throws IllegalStateException
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
-
-