Class CsrfPreventionFilter.LruCache<T>
java.lang.Object
org.apache.catalina.filters.CsrfPreventionFilter.LruCache<T>
- Type Parameters:
T- The type held by this cache.
- All Implemented Interfaces:
Serializable, CsrfPreventionFilter.NonceCache<T>
- Enclosing class:
CsrfPreventionFilter
protected static class CsrfPreventionFilter.LruCache<T>
extends Object
implements CsrfPreventionFilter.NonceCache<T>
Despite its name, this is a FIFO cache not an LRU cache. Using an older nonce should not delay its removal from
the cache in favour of more recent values.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LruCache
public LruCache(int cacheSize) Construct a new LruCache.- Parameters:
cacheSize- The maximum number of entries in the cache
-
-
Method Details
-
add
Description copied from interface:CsrfPreventionFilter.NonceCacheAdd a nonce to the cache.- Specified by:
addin interfaceCsrfPreventionFilter.NonceCache<T>- Parameters:
key- The nonce to add
-
contains
Description copied from interface:CsrfPreventionFilter.NonceCacheCheck if the cache contains the given nonce.- Specified by:
containsin interfaceCsrfPreventionFilter.NonceCache<T>- Parameters:
key- The nonce to check- Returns:
trueif the nonce is in the cache
-