Class PullUpValidUntilStage

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
All Implemented Interfaces:
Stage<Element>, net.shibboleth.shared.component.Component, net.shibboleth.shared.component.DestructableComponent, net.shibboleth.shared.component.IdentifiableComponent, net.shibboleth.shared.component.IdentifiedComponent, net.shibboleth.shared.component.InitializableComponent

@ThreadSafe public class PullUpValidUntilStage extends AbstractIteratingStage<Element>
For each Item collection element that is a SAML EntitiesDescriptor this stage will scan all descendant EntitiesDescriptors and EntityDescriptors, determine the earliest valid until date, set that on the root EntitiesDescriptor and remove the valid until dates from all descendants.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Duration
    The maximum amount of time a descriptor may be valid.
    private Duration
    The minimum amount of time a descriptor may be valid.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Processes a given Item.
    final Duration
    Gets the maximum amount of time a descriptor may be valid.
    final Duration
    Gets the minimum amount of time a descriptor may be valid.
    protected Instant
    Gets the shortest cache duration for a given entity and entities descriptor and all its descendant descriptors.
    void
    Sets the maximum amount of time a descriptor may be valid.
    void
    Sets the minimum amount of time a descriptor may be valid.
    protected void
    setValidUntil(Element descriptor, Instant validUntil)
    Sets the valid until instant on the given descriptor.

    Methods inherited from class net.shibboleth.metadata.pipeline.AbstractIteratingStage

    doExecute

    Methods inherited from class net.shibboleth.metadata.pipeline.AbstractStage

    execute, getCollectionPredicate, setCollectionPredicate

    Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

    setId

    Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

    doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException

    Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

    checkComponentActive, checkSetterPreconditions, 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.shared.component.DestructableComponent

    destroy, isDestroyed

    Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

    getId

    Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

    initialize, isInitialized
  • Field Details

    • minValidityDuration

      @Nonnull private Duration minValidityDuration
      The minimum amount of time a descriptor may be valid. Default value: 0
    • maxValidityDuration

      @Nonnull private Duration maxValidityDuration
      The maximum amount of time a descriptor may be valid. Default value: 9223372036854775807L
  • Constructor Details

    • PullUpValidUntilStage

      public PullUpValidUntilStage()
  • Method Details

    • getMinimumValidityDuration

      @Nonnull public final Duration getMinimumValidityDuration()
      Gets the minimum amount of time a descriptor may be valid.
      Returns:
      minimum amount of time a descriptor may be valid, always 0 or greater
    • setMinimumValidityDuration

      public void setMinimumValidityDuration(@Nonnull Duration duration)
      Sets the minimum amount of time a descriptor may be valid.
      Parameters:
      duration - minimum amount of time a descriptor may be valid
    • getMaximumValidityDuration

      @Nonnull public final Duration getMaximumValidityDuration()
      Gets the maximum amount of time a descriptor may be valid.
      Returns:
      maximum maximum amount of time a descriptor may be valid, always greater than 0
    • setMaximumValidityDuration

      public void setMaximumValidityDuration(@Nonnull Duration duration)
      Sets the maximum amount of time a descriptor may be valid.
      Parameters:
      duration - maximum amount of time a descriptor may be valid, must be greater than 0
    • doExecute

      protected void doExecute(@Nonnull Item<Element> item) throws StageProcessingException
      Description copied from class: AbstractIteratingStage
      Processes a given Item.
      Specified by:
      doExecute in class AbstractIteratingStage<Element>
      Parameters:
      item - Item on which to operate
      Throws:
      StageProcessingException - thrown if there is a problem with the stage processing
    • getNearestValidUntil

      @Nullable protected Instant getNearestValidUntil(@Nonnull Element descriptor)
      Gets the shortest cache duration for a given entity and entities descriptor and all its descendant descriptors.
      Parameters:
      descriptor - descriptor from which to get the shortest cache duration
      Returns:
      the shortest cache duration from the descriptor and its descendants or null if the descriptor does not contain a cache duration
    • setValidUntil

      protected void setValidUntil(@Nonnull Element descriptor, @Nullable Instant validUntil)
      Sets the valid until instant on the given descriptor. If the given validUntil is null no instant is set. If the given validUntil is less than now + minValidityDuration then the instant of now + the minimum duration is set. If the given validUntil is greater than now + maxValidityDuration then the instant of now + the maximum duration is set. Otherwise the given instant is set.
      Parameters:
      descriptor - entity or entities descriptor to receive the validUntil, never null
      validUntil - validUntil time to be set on the given descriptor