Class 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 Details

    • 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)
  • Constructor Details

    • MessageReplaySecurityHandler

      public MessageReplaySecurityHandler()
      Constructor.
  • Method Details

    • 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 class AbstractInitializableComponent
      Throws:
      ComponentInitializationException
    • doInvoke

      protected void doInvoke​(@Nonnull MessageContext messageContext) throws MessageHandlerException
      Performs the handler logic.
      Specified by:
      doInvoke in class AbstractMessageHandler
      Parameters:
      messageContext - the message context on which to invoke the handler
      Throws:
      MessageHandlerException - if there is an error invoking the handler on the message context