Class MessageReplaySecurityHandler

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, org.opensaml.messaging.handler.MessageHandler

    public class MessageReplaySecurityHandler
    extends org.opensaml.messaging.handler.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 Logger log
      Logger.
      private org.opensaml.storage.ReplayCache replayCache
      Message replay cache instance to use.
      private boolean requiredRule
      Whether this rule is required to be met.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doInitialize()
      protected void doInvoke​(org.opensaml.messaging.context.MessageContext messageContext)
      Duration getExpires()
      Gets the lifetime of replay entries.
      org.opensaml.storage.ReplayCache getReplayCache()
      Get the replay cache instance to use.
      void setExpires​(Duration exp)
      Sets the lifetime of replay entries.
      void setReplayCache​(org.opensaml.storage.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 interface net.shibboleth.utilities.java.support.component.InitializableComponent

        initialize, isInitialized
    • Field Detail

      • log

        @Nonnull
        private final Logger log
        Logger.
      • replayCache

        @NonnullAfterInit
        private org.opensaml.storage.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)
    • Constructor Detail

      • MessageReplaySecurityHandler

        public MessageReplaySecurityHandler()
        Constructor.
    • Method Detail

      • getReplayCache

        @NonnullAfterInit
        public org.opensaml.storage.ReplayCache getReplayCache()
        Get the replay cache instance to use.
        Returns:
        Returns the replayCache.
      • setReplayCache

        public void setReplayCache​(@Nonnull
                                   org.opensaml.storage.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 net.shibboleth.utilities.java.support.component.ComponentInitializationException
        Overrides:
        doInitialize in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
        Throws:
        net.shibboleth.utilities.java.support.component.ComponentInitializationException
      • doInvoke

        protected void doInvoke​(@Nonnull
                                org.opensaml.messaging.context.MessageContext messageContext)
                         throws org.opensaml.messaging.handler.MessageHandlerException
        Specified by:
        doInvoke in class org.opensaml.messaging.handler.AbstractMessageHandler
        Throws:
        org.opensaml.messaging.handler.MessageHandlerException