Class ValidTimestampPolicy
- java.lang.Object
-
- edu.uiuc.ncsa.security.core.cache.ValidTimestampPolicy
-
- All Implemented Interfaces:
RetentionPolicy
public class ValidTimestampPolicy extends Object implements RetentionPolicy
The given key is overloaded to have the timestamp information. This just looks at that and parses it to make the decision.Created by Jeff Gaynor
on 7/12/11 at 12:26 PM
-
-
Field Summary
Fields Modifier and Type Field Description protected long
maxTimeout
-
Constructor Summary
Constructors Constructor Description ValidTimestampPolicy()
ValidTimestampPolicy(long maxTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
applies()
If this applies to the current cache.Cache
getMap()
This returns null, since the retention decision requires only the key of the entry, not the entire store (cf.boolean
retain(Object key, Object value)
-
-
-
Method Detail
-
applies
public boolean applies()
Description copied from interface:RetentionPolicy
If this applies to the current cache. While this is true, theRetentionPolicy.retain(Object, Object)
method will be applied to each element of the cache. When false, this policy will be skipped.
E.g. for a cache that limits the number of cached items, there is no reason to check every item in the cache directly if the cache size is below a certain threshold.- Specified by:
applies
in interfaceRetentionPolicy
- Returns:
-
retain
public boolean retain(Object key, Object value)
- Specified by:
retain
in interfaceRetentionPolicy
-
getMap
public Cache getMap()
This returns null, since the retention decision requires only the key of the entry, not the entire store (cf. MaxSizePolicy which does have to think about the store size.) No reason to have setters or getters.- Specified by:
getMap
in interfaceRetentionPolicy
- Returns:
-
-