Package org.apache.wss4j.common.cache
Class EHCacheExpiry
java.lang.Object
org.apache.wss4j.common.cache.EHCacheExpiry
- All Implemented Interfaces:
org.ehcache.expiry.ExpiryPolicy<String,EHCacheValue>
public class EHCacheExpiry
extends Object
implements org.ehcache.expiry.ExpiryPolicy<String,EHCacheValue>
A custom Expiry implementation for EhCache. It uses the supplied expiry which is part of the cache value.
If it doesn't exist, it falls back to the default value (3600 seconds).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe default time to live in seconds (60 minutes)static final longThe max time to live in seconds (12 hours)Fields inherited from interface org.ehcache.expiry.ExpiryPolicy
INFINITE, NO_EXPIRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExpiryForAccess(String s, Supplier<? extends EHCacheValue> supplier) getExpiryForCreation(String s, EHCacheValue ehCacheValue) getExpiryForUpdate(String s, Supplier<? extends EHCacheValue> supplier, EHCacheValue ehCacheValue)
-
Field Details
-
DEFAULT_TTL
public static final long DEFAULT_TTLThe default time to live in seconds (60 minutes)- See Also:
-
MAX_TTL
public static final long MAX_TTLThe max time to live in seconds (12 hours)- See Also:
-
-
Constructor Details
-
EHCacheExpiry
public EHCacheExpiry()
-
-
Method Details
-
getExpiryForCreation
- Specified by:
getExpiryForCreationin interfaceorg.ehcache.expiry.ExpiryPolicy<String,EHCacheValue>
-
getExpiryForAccess
- Specified by:
getExpiryForAccessin interfaceorg.ehcache.expiry.ExpiryPolicy<String,EHCacheValue>
-
getExpiryForUpdate
public Duration getExpiryForUpdate(String s, Supplier<? extends EHCacheValue> supplier, EHCacheValue ehCacheValue) - Specified by:
getExpiryForUpdatein interfaceorg.ehcache.expiry.ExpiryPolicy<String,EHCacheValue>
-