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
FieldsModifier and TypeFieldDescriptionstatic final DurationThe default replay cache expiration time - 5 minutes.protected DurationTime to keep elements in the replay cache - default isDEFAULT_REPLAY_CACHE_EXPIRATION. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddToCache(String id) Adds theidobject to the cache where it will be stored until it expires.voidcheckReplay(String id) voidcheckReplay(SAMLObject object) protected abstract booleanexistsInCache(String id) Predicate that returnstrueif theidobject exists in the cache and has not expired.voidsetReplayCacheExpiration(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:
checkReplayin interfaceMessageReplayChecker- Throws:
MessageReplayException
-
existsInCache
Predicate that returnstrueif theidobject exists in the cache and has not expired.- Parameters:
id- the ID- Returns:
trueif the object exists in the cache and has not expired, andfalseotherwise
-
addToCache
Adds theidobject to the cache where it will be stored until it expires.- Parameters:
id- the ID
-
checkReplay
- Specified by:
checkReplayin interfaceMessageReplayChecker- Throws:
MessageReplayExceptionIllegalArgumentException
-
setReplayCacheExpiration
Assigns the time each stored ID should be kept in the cache. The default isDEFAULT_REPLAY_CACHE_EXPIRATION.- Parameters:
replayCacheExpiration- duration
-