Class EHCacheTokenReplayCache
- java.lang.Object
-
- org.apache.cxf.rs.security.saml.sso.EHCacheTokenReplayCache
-
- All Implemented Interfaces:
Closeable,AutoCloseable,TokenReplayCache<String>
public class EHCacheTokenReplayCache extends Object implements TokenReplayCache<String>
An in-memory EHCache implementation of the TokenReplayCache interface. The default TTL is 60 minutes and the max TTL is 12 hours.
-
-
Constructor Summary
Constructors Constructor Description EHCacheTokenReplayCache()EHCacheTokenReplayCache(String configFile)EHCacheTokenReplayCache(String configFile, Bus bus)EHCacheTokenReplayCache(Bus bus)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleancontains(String identifier)Return true if the given identifier is contained in the cachevoidputId(String identifier)Add the given identifier to the cache.voidputId(String identifier, Instant expiry)Add the given identifier to the cache to be cached for the given time
-
-
-
Field Detail
-
CACHE_KEY
public static final String CACHE_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EHCacheTokenReplayCache
public EHCacheTokenReplayCache() throws IllegalAccessException, InstantiationException, ClassNotFoundException
-
EHCacheTokenReplayCache
public EHCacheTokenReplayCache(Bus bus) throws IllegalAccessException, InstantiationException, ClassNotFoundException
-
EHCacheTokenReplayCache
public EHCacheTokenReplayCache(String configFile) throws IllegalAccessException, InstantiationException, ClassNotFoundException
-
EHCacheTokenReplayCache
public EHCacheTokenReplayCache(String configFile, Bus bus) throws IllegalAccessException, ClassNotFoundException, InstantiationException
-
-
Method Detail
-
putId
public void putId(String identifier)
Add the given identifier to the cache. It will be cached for a default amount of time.- Specified by:
putIdin interfaceTokenReplayCache<String>- Parameters:
identifier- The identifier to be added
-
putId
public void putId(String identifier, Instant expiry)
Add the given identifier to the cache to be cached for the given time- Specified by:
putIdin interfaceTokenReplayCache<String>- Parameters:
identifier- The identifier to be addedexpiry- A custom expiry time for the identifier. Can be null in which case, the default expiry is used.
-
contains
public boolean contains(String identifier)
Return true if the given identifier is contained in the cache- Specified by:
containsin interfaceTokenReplayCache<String>- Parameters:
identifier- The identifier to check
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceTokenReplayCache<String>
-
-