public interface PageCacheKey extends Serializable
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)
.Modifier and Type | Method and Description |
---|---|
void |
seal()
After
seal() is invoked, a call to setAttribute(String, Serializable) will result in
an IllegalStateException |
void |
setAttribute(String subKey,
Serializable keyFragment)
All the combined attributes will make up the final
PageCacheKey . |
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()
and Object.equals(Object)
implementation that is also efficient
as it will be used when storing objects in a cache with key PageCacheKey
.
The subKey
can best be prefixed by namespacing (FQN of class calling the setAttribute) to
avoid collisions. For example
PageCacheKey#setAttribute(MyValve.class.getName() + ".ip", ip-address);
subKey
- the key to which the fragment belongs, not allowed to be null
keyFragment
- the fragment for the subKey, not allowed to be null
IllegalStateException
- is this PageCacheKey
has been sealed via seal()
void seal()
seal()
is invoked, a call to setAttribute(String, Serializable)
will result in
an IllegalStateException
Copyright © 2008–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.