Class XMLSchemaValidationStage

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 XMLSchemaValidationStage extends AbstractIteratingStage<Element>
A pipeline stage that XML schema validates the elements within the DOMElementItem collection.

This stage requires the following properties be set prior to initialization:

  • schemaResources
If DOM Elements are required to be valid, per isElementRequiredToBeSchemaValid() and an Element is found to be invalid than an ErrorStatus object is set on the element. If the Element is not required to be valid and an Element is found to be invalid than an WarningStatus is set on the Element.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Whether Elements are required to be schema valid.
    private static final org.slf4j.Logger
    Class logger.
    private List<Resource>
    Collection of schema resources.
    private Schema
    Schema used to validate Elements.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Processes a given Item.
    protected void
     
    final List<Resource>
    Gets an unmodifiable list of schema resources against which Elements are validated.
    private Schema
    Returns the shared validation schema built during initialization.
    final boolean
    Gets whether Elements are required to be schema valid.
    void
    Sets whether Elements are required to be schema valid.
    void
    Sets the schema resources against which Elements are validated.

    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

    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

    • LOG

      @Nonnull private static final org.slf4j.Logger LOG
      Class logger.
    • schemaResources

      @Nonnull @NonnullElements @Unmodifiable private List<Resource> schemaResources
      Collection of schema resources.
    • elementRequiredToBeSchemaValid

      private boolean elementRequiredToBeSchemaValid
      Whether Elements are required to be schema valid. Default value: true
    • validationSchema

      @NonnullAfterInit private Schema validationSchema
      Schema used to validate Elements. Built during initialization.
  • Constructor Details

    • XMLSchemaValidationStage

      public XMLSchemaValidationStage()
  • Method Details

    • getSchemaResources

      @Nonnull @NonnullElements @Unmodifiable public final List<Resource> getSchemaResources()
      Gets an unmodifiable list of schema resources against which Elements are validated.
      Returns:
      unmodifiable list of schema resources against which Elements are validated
    • setSchemaResources

      public void setSchemaResources(@Nonnull @NonnullElements @Unmodifiable List<Resource> resources)
      Sets the schema resources against which Elements are validated.
      Parameters:
      resources - schema resources against which Elements are validated
    • isElementRequiredToBeSchemaValid

      public final boolean isElementRequiredToBeSchemaValid()
      Gets whether Elements are required to be schema valid.
      Returns:
      whether Elements are required to be schema valid
    • setElementRequiredToBeSchemaValid

      public void setElementRequiredToBeSchemaValid(boolean isRequired)
      Sets whether Elements are required to be schema valid.
      Parameters:
      isRequired - whether Elements are required to be schema valid
    • getValidationSchema

      private Schema getValidationSchema()
      Returns the shared validation schema built during initialization.
      Returns:
      the shared validation schema
    • 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
    • doInitialize

      protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException
      Overrides:
      doInitialize in class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
      Throws:
      net.shibboleth.shared.component.ComponentInitializationException