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 SummaryFieldsModifier 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 SummaryConstructors
- 
Method SummaryModifier 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_EXPIRATIONThe default replay cache expiration time - 5 minutes.
- 
replayCacheExpirationTime to keep elements in the replay cache - default isDEFAULT_REPLAY_CACHE_EXPIRATION.
 
- 
- 
Constructor Details- 
AbstractMessageReplayCheckerpublic AbstractMessageReplayChecker()
 
- 
- 
Method Details- 
checkReplay- Specified by:
- checkReplayin interface- MessageReplayChecker
- Throws:
- MessageReplayException
 
- 
existsInCachePredicate 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, and- falseotherwise
 
- 
addToCacheAdds theidobject to the cache where it will be stored until it expires.- Parameters:
- id- the ID
 
- 
checkReplay- Specified by:
- checkReplayin interface- MessageReplayChecker
- Throws:
- MessageReplayException
- IllegalArgumentException
 
- 
setReplayCacheExpirationAssigns the time each stored ID should be kept in the cache. The default isDEFAULT_REPLAY_CACHE_EXPIRATION.- Parameters:
- replayCacheExpiration- duration
 
 
-