Class JCacheTokenReplayCache
- java.lang.Object
-
- org.apache.cxf.rs.security.saml.sso.jcache.JCacheTokenReplayCache
-
- All Implemented Interfaces:
Closeable,AutoCloseable,TokenReplayCache<String>
public class JCacheTokenReplayCache extends Object implements TokenReplayCache<String>
An in-memory JCache based implementation of the TokenReplayCache interface. The default TTL is 60 minutes and the max TTL is 12 hours.
-
-
Constructor Summary
Constructors Constructor Description JCacheTokenReplayCache()JCacheTokenReplayCache(String configFile)JCacheTokenReplayCache(String configFile, org.apache.cxf.Bus bus)JCacheTokenReplayCache(org.apache.cxf.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
-
JCacheTokenReplayCache
public JCacheTokenReplayCache() throws URISyntaxException- Throws:
URISyntaxException
-
JCacheTokenReplayCache
public JCacheTokenReplayCache(org.apache.cxf.Bus bus) throws URISyntaxException- Throws:
URISyntaxException
-
JCacheTokenReplayCache
public JCacheTokenReplayCache(String configFile) throws URISyntaxException
- Throws:
URISyntaxException
-
JCacheTokenReplayCache
public JCacheTokenReplayCache(String configFile, org.apache.cxf.Bus bus) throws URISyntaxException
- Throws:
URISyntaxException
-
-
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>
-
-