Class AbstractValidationParametersBuilder<T extends AbstractValidationParametersBuilder<T>>

java.lang.Object
se.swedenconnect.opensaml.common.validation.AbstractValidationParametersBuilder<T>
All Implemented Interfaces:
ValidationParametersBuilder
Direct Known Subclasses:
AbstractResponseValidationParametersBuilder

public abstract class AbstractValidationParametersBuilder<T extends AbstractValidationParametersBuilder<T>> extends Object implements ValidationParametersBuilder
Abstract base class for building the ValidationContext object using a builder pattern. These settings are parameters that control the validation of an object.
Author:
Martin Lindström (martin@idsec.se)
  • Constructor Details

    • AbstractValidationParametersBuilder

      public AbstractValidationParametersBuilder()
  • Method Details

    • build

      public org.opensaml.saml.common.assertion.ValidationContext build()
      Builds a ValidationContext object.
      Specified by:
      build in interface ValidationParametersBuilder
      Returns:
      the ValidationContext object
    • staticParameter

      public T staticParameter(String name, Object value)
      Generic method that adds a static validation parameter.
      Parameters:
      name - the parameter name
      value - the parameter value
      Returns:
      the builder
    • dynamicParameter

      public T dynamicParameter(String name, Object value)
      Generic method that adds a dynamic validation parameter.
      Parameters:
      name - the parameter name
      value - the parameter value
      Returns:
      the builder
    • strictValidation

      public T strictValidation(boolean flag)
      Tells whether strict validation should be performed.
      Parameters:
      flag - true/false
      Returns:
      the builder
    • allowedClockSkew

      public T allowedClockSkew(Duration skew)
      Gives the duration that is the maximum allowed clock skew when verifying time stamps.
      Parameters:
      skew - duration
      Returns:
      the builder
    • allowedClockSkew

      public T allowedClockSkew(long millis)
      Gives the number of milliseconds that is the maximum allowed clock skew when verifying time stamps.
      Parameters:
      millis - number of milliseconds
      Returns:
      the builder
    • maxAgeReceivedMessage

      public T maxAgeReceivedMessage(Duration maxAge)
      Gives the maximum age (difference between issuance time and the validation time) that a received message is allowed to have.
      Parameters:
      maxAge - maximum allowed age on messages
      Returns:
      the builder
    • maxAgeReceivedMessage

      public T maxAgeReceivedMessage(long millis)
      Gives the maximum age (difference between issuance time and the validation time) that a received message is allowed to have.
      Parameters:
      millis - number of milliseconds
      Returns:
      the builder
    • receiveInstant

      public T receiveInstant(Instant instant)
      Sets the reception instant (i.e., when a message being validated was received).
      Parameters:
      instant - the reception instant
      Returns:
      the builder
    • receiveInstant

      public T receiveInstant(long instant)
      Sets the reception instant (i.e., when a message being validated was received).
      Parameters:
      instant - the reception instant
      Returns:
      the builder
    • signatureRequired

      public T signatureRequired(boolean required)
      Tells whether we require an object being validated to be signed.
      Parameters:
      required - true/false
      Returns:
      the builder
    • signatureValidationCriteriaSet

      public T signatureValidationCriteriaSet(net.shibboleth.shared.resolver.CriteriaSet criteriaSet)
      Gives the trust basis criteria set to use when verifying signatures (SignatureTrustEngine.validate).
      Parameters:
      criteriaSet - the criteria set
      Returns:
      the builder
    • getThis

      protected abstract T getThis()
      Returns 'this' object.
      Returns:
      this object (the concrete builder)
    • addStaticParameter

      public final void addStaticParameter(String name, Object value)
      Adds a static validation parameter.
      Parameters:
      name - the name of the parameter
      value - the value of the parameter
    • addStaticParameterIfMissing

      public final void addStaticParameterIfMissing(String name, Object value)
      Adds a static validation parameter if it is not set yet.
      Parameters:
      name - the name of the parameter
      value - the value of the parameter
    • addStaticParameters

      public final void addStaticParameters(Map<String,Object> pars)
      Adds static validation parameters.
      Parameters:
      pars - static validation parameters
    • addDynamicParameter

      public final void addDynamicParameter(String name, Object value)
      Adds a dynamic validation parameter.
      Parameters:
      name - the name of the parameter
      value - the value of the parameter
    • addDynamicParameters

      public final void addDynamicParameters(Map<String,Object> pars)
      Adds dynamic validation parameters.
      Parameters:
      pars - dynamic validation parameters
    • getStaticParameter

      protected final Object getStaticParameter(String name)
      Gets a static parameter.
      Parameters:
      name - the parameter name
      Returns:
      the value or null
    • getDynamicParameter

      protected final Object getDynamicParameter(String name)
      Gets a dynamic parameter.
      Parameters:
      name - the parameter name
      Returns:
      the value or null