Class InMemoryReplayChecker
- java.lang.Object
-
- se.litsec.opensaml.saml2.common.response.InMemoryReplayChecker
-
- All Implemented Interfaces:
MessageReplayChecker
public class InMemoryReplayChecker extends Object implements MessageReplayChecker
An in-memory based message replay checker implementation. This is mainly for testing and simple mock implementations.- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Constructor Summary
Constructors Constructor Description InMemoryReplayChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckReplay(String id)Checks if the supplied message ID already has been processed within the time the replay checker keeps the processed items in its cache.voidcheckReplay(SAMLObject object)Checks if the supplied message contains an ID that already has been processed within the time the replay checker keeps the processed items in its cache.voidsetReplayCacheExpiration(long replayCacheExpiration)Assigns the number of milliseconds each stored ID should be kept in the cache.
-
-
-
Method Detail
-
checkReplay
public void checkReplay(String id) throws MessageReplayException
Checks if the supplied message ID already has been processed within the time the replay checker keeps the processed items in its cache.- Specified by:
checkReplayin interfaceMessageReplayChecker- Parameters:
id- the message ID- Throws:
MessageReplayException- if there is a replay attack
-
checkReplay
public void checkReplay(SAMLObject object) throws MessageReplayException, IllegalArgumentException
Checks if the supplied message contains an ID that already has been processed within the time the replay checker keeps the processed items in its cache.- Specified by:
checkReplayin interfaceMessageReplayChecker- Parameters:
object- the SAML message object- Throws:
MessageReplayException- if there is a replay attackIllegalArgumentException- if the supplied object is not supported by the cheker
-
setReplayCacheExpiration
public void setReplayCacheExpiration(long replayCacheExpiration)
Assigns the number of milliseconds each stored ID should be kept in the cache. The default is 5 minutes.- Parameters:
replayCacheExpiration- number of millis
-
-