Package org.apache.wss4j.common.cache
Class EHCacheReplayCache
- java.lang.Object
-
- org.apache.wss4j.common.cache.EHCacheReplayCache
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ReplayCache
public class EHCacheReplayCache extends Object implements ReplayCache
An in-memory EHCache implementation of the ReplayCache interface, that overflows to disk. The default TTL is 60 minutes and the max TTL is 12 hours.
-
-
Constructor Summary
Constructors Constructor Description EHCacheReplayCache(String key)
EHCacheReplayCache(String key, Path diskstorePath)
EHCacheReplayCache(String key, Path diskstorePath, long diskSize, long heapEntries, boolean persistent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(String identifier)
Add the given identifier to the cache.void
add(String identifier, Instant expiry)
Add the given identifier to the cache to be cached for the given timevoid
close()
boolean
contains(String identifier)
Return true if the given identifier is contained in the cachevoid
initComplete()
void
postShutdown()
void
preShutdown()
-
-
-
Constructor Detail
-
EHCacheReplayCache
public EHCacheReplayCache(String key) throws WSSecurityException
- Throws:
WSSecurityException
-
EHCacheReplayCache
public EHCacheReplayCache(String key, Path diskstorePath) throws WSSecurityException
- Throws:
WSSecurityException
-
EHCacheReplayCache
public EHCacheReplayCache(String key, Path diskstorePath, long diskSize, long heapEntries, boolean persistent) throws WSSecurityException
- Throws:
WSSecurityException
-
-
Method Detail
-
add
public void add(String identifier)
Add the given identifier to the cache. It will be cached for a default amount of time.- Specified by:
add
in interfaceReplayCache
- Parameters:
identifier
- The identifier to be added
-
add
public void add(String identifier, Instant expiry)
Add the given identifier to the cache to be cached for the given time- Specified by:
add
in interfaceReplayCache
- 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:
contains
in interfaceReplayCache
- Parameters:
identifier
- The identifier to check
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
initComplete
public void initComplete()
-
preShutdown
public void preShutdown()
-
postShutdown
public void postShutdown()
-
-