Class MessageReplaySecurityHandler
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.handler.AbstractMessageHandler
-
- org.opensaml.saml.common.binding.security.impl.MessageReplaySecurityHandler
-
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,MessageHandler
public class MessageReplaySecurityHandler extends AbstractMessageHandler
Security message handler implementation that which checks for replay of SAML messages.
-
-
Field Summary
Fields Modifier and Type Field Description private Duration
expires
Time to expire cache entries.private org.slf4j.Logger
log
Logger.private ReplayCache
replayCache
Message replay cache instance to use.private boolean
requiredRule
Whether this rule is required to be met.
-
Constructor Summary
Constructors Constructor Description MessageReplaySecurityHandler()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doInitialize()
protected void
doInvoke(MessageContext messageContext)
Duration
getExpires()
Gets the lifetime of replay entries.ReplayCache
getReplayCache()
Get the replay cache instance to use.void
setExpires(Duration exp)
Sets the lifetime of replay entries.void
setReplayCache(ReplayCache cache)
Set the replay cache instance to use.void
setRequiredRule(boolean flag)
Set whether this rule is required to be met.-
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, doPreInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Logger.
-
replayCache
@NonnullAfterInit private ReplayCache replayCache
Message replay cache instance to use.
-
requiredRule
private boolean requiredRule
Whether this rule is required to be met.
-
expires
@Nonnull private Duration expires
Time to expire cache entries. Default value: (3 minutes)
-
-
Method Detail
-
getReplayCache
@NonnullAfterInit public ReplayCache getReplayCache()
Get the replay cache instance to use.- Returns:
- Returns the replayCache.
-
setReplayCache
public void setReplayCache(@Nonnull ReplayCache cache)
Set the replay cache instance to use.- Parameters:
cache
- The replayCache to set.
-
setRequiredRule
public void setRequiredRule(boolean flag)
Set whether this rule is required to be met.- Parameters:
flag
- flag to set
-
getExpires
@Nonnull public Duration getExpires()
Gets the lifetime of replay entries.- Returns:
- lifetime of entries
-
setExpires
public void setExpires(@Nonnull Duration exp)
Sets the lifetime of replay entries.- Parameters:
exp
- lifetime of entries
-
doInitialize
protected void doInitialize() throws ComponentInitializationException
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
doInvoke
protected void doInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException
- Specified by:
doInvoke
in classAbstractMessageHandler
- Throws:
MessageHandlerException
-
-