Package org.apache.wss4j.common.cache
Class MemoryReplayCache
java.lang.Object
org.apache.wss4j.common.cache.MemoryReplayCache
- All Implemented Interfaces:
Closeable,AutoCloseable,ReplayCache
A simple in-memory HashSet based cache to prevent against replay attacks. The default TTL is 5 minutes
and the max TTL is 60 minutes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the given identifier to the cache.voidAdd the given identifier to the cache to be cached for the given timevoidclose()booleanReturn true if the given identifier is contained in the cacheprotected void
-
Field Details
-
DEFAULT_TTL
public static final long DEFAULT_TTL- See Also:
-
MAX_TTL
public static final long MAX_TTL- See Also:
-
-
Constructor Details
-
MemoryReplayCache
public MemoryReplayCache()
-
-
Method Details
-
add
Add the given identifier to the cache. It will be cached for a default amount of time.- Specified by:
addin interfaceReplayCache- Parameters:
identifier- The identifier to be added
-
add
Add the given identifier to the cache to be cached for the given time- Specified by:
addin interfaceReplayCache- Parameters:
identifier- The identifier to be addedexpiry- A custom expiry time for the identifier
-
contains
Return true if the given identifier is contained in the cache- Specified by:
containsin interfaceReplayCache- Parameters:
identifier- The identifier to check
-
processTokenExpiry
protected void processTokenExpiry() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-