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
Fields Modifier and Type Field Description static long
DEFAULT_TTL
The default time to live in seconds (60 minutes)static long
MAX_TTL
The max time to live in seconds (12 hours)
-
Constructor Summary
Constructors Constructor Description EHCacheExpiry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Duration
getExpiryForAccess(String s, Supplier<? extends EHCacheValue> supplier)
Duration
getExpiryForCreation(String s, EHCacheValue ehCacheValue)
Duration
getExpiryForUpdate(String s, Supplier<? extends EHCacheValue> supplier, EHCacheValue ehCacheValue)
-
-
-
Field Detail
-
DEFAULT_TTL
public static final long DEFAULT_TTL
The default time to live in seconds (60 minutes)- See Also:
- Constant Field Values
-
MAX_TTL
public static final long MAX_TTL
The max time to live in seconds (12 hours)- See Also:
- Constant Field Values
-
-
Method Detail
-
getExpiryForCreation
public Duration getExpiryForCreation(String s, EHCacheValue ehCacheValue)
- Specified by:
getExpiryForCreation
in interfaceorg.ehcache.expiry.ExpiryPolicy<String,EHCacheValue>
-
getExpiryForAccess
public Duration getExpiryForAccess(String s, Supplier<? extends EHCacheValue> supplier)
- Specified by:
getExpiryForAccess
in interfaceorg.ehcache.expiry.ExpiryPolicy<String,EHCacheValue>
-
getExpiryForUpdate
public Duration getExpiryForUpdate(String s, Supplier<? extends EHCacheValue> supplier, EHCacheValue ehCacheValue)
- Specified by:
getExpiryForUpdate
in interfaceorg.ehcache.expiry.ExpiryPolicy<String,EHCacheValue>
-
-