Class AbstractMessageReplayChecker
java.lang.Object
se.swedenconnect.spring.saml.idp.authnrequest.validation.AbstractMessageReplayChecker
- All Implemented Interfaces:
MessageReplayChecker
Abstract base class for
MessageReplayChecker
.- Author:
- Martin Lindström
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Duration
The default replay cache expiration time - 5 minutes.protected Duration
Time to keep elements in the replay cache - default isDEFAULT_REPLAY_CACHE_EXPIRATION
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addToCache
(String id) Adds theid
object to the cache where it will be stored until it expires.void
checkReplay
(String id) void
checkReplay
(org.opensaml.saml.common.SAMLObject object) protected abstract boolean
existsInCache
(String id) Predicate that returnstrue
if theid
object exists in the cache and has not expired.void
setReplayCacheExpiration
(Duration replayCacheExpiration) Assigns the time each stored ID should be kept in the cache.
-
Field Details
-
DEFAULT_REPLAY_CACHE_EXPIRATION
The default replay cache expiration time - 5 minutes. -
replayCacheExpiration
Time to keep elements in the replay cache - default isDEFAULT_REPLAY_CACHE_EXPIRATION
.
-
-
Constructor Details
-
AbstractMessageReplayChecker
public AbstractMessageReplayChecker()
-
-
Method Details
-
checkReplay
- Specified by:
checkReplay
in interfaceMessageReplayChecker
- Throws:
MessageReplayException
-
existsInCache
Predicate that returnstrue
if theid
object exists in the cache and has not expired.- Parameters:
id
- the ID- Returns:
true
if the object exists in the cache and has not expired, andfalse
otherwise
-
addToCache
Adds theid
object to the cache where it will be stored until it expires.- Parameters:
id
- the ID
-
checkReplay
public void checkReplay(org.opensaml.saml.common.SAMLObject object) throws MessageReplayException, IllegalArgumentException - Specified by:
checkReplay
in interfaceMessageReplayChecker
- Throws:
MessageReplayException
IllegalArgumentException
-
setReplayCacheExpiration
Assigns the time each stored ID should be kept in the cache. The default isDEFAULT_REPLAY_CACHE_EXPIRATION
.- Parameters:
replayCacheExpiration
- duration
-