Class MaxAgePolicy
- java.lang.Object
- 
- edu.uiuc.ncsa.security.core.cache.MaxAgePolicy
 
- 
- All Implemented Interfaces:
- RetentionPolicy<Identifier,CachedObject>
 
 public class MaxAgePolicy extends Object implements RetentionPolicy<Identifier,CachedObject> A retention policy that removes objects that have been in the cache for too long.Created by Jeff Gaynor 
 on Nov 12, 2010 at 10:21:04 AM
- 
- 
Constructor SummaryConstructors Constructor Description MaxAgePolicy(Cache cache, long maximumAge)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapplies()If this applies to the current cache.CachegetMap()The cache to which this policy is applied.longgetMaximumAge()booleanretain(Identifier key, CachedObject cachedObject)voidsetMap(Cache map)voidsetMaximumAge(long maximumAge)
 
- 
- 
- 
Constructor Detail- 
MaxAgePolicypublic MaxAgePolicy(Cache cache, long maximumAge) 
 
- 
 - 
Method Detail- 
getMaximumAgepublic long getMaximumAge() 
 - 
setMaximumAgepublic void setMaximumAge(long maximumAge) 
 - 
setMappublic void setMap(Cache map) 
 - 
getMappublic Cache getMap() Description copied from interface:RetentionPolicyThe cache to which this policy is applied.- Specified by:
- getMapin interface- RetentionPolicy<Identifier,CachedObject>
- Returns:
 
 - 
retainpublic boolean retain(Identifier key, CachedObject cachedObject) - Specified by:
- retainin interface- RetentionPolicy<Identifier,CachedObject>
 
 - 
appliespublic boolean applies() Description copied from interface:RetentionPolicyIf 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:
- appliesin interface- RetentionPolicy<Identifier,CachedObject>
- Returns:
 
 
- 
 
-