Class NamespacesStrippingStage

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 NamespacesStrippingStage extends AbstractNamespacesStrippingStage
A stage which removes all evidence of a given collection of XML namespaces from each metadata item.

The stage can operate either to remove (the default) or keep the designated namespaces.

Elements, attributes and namespace prefix definitions associated with a given namespace will be removed or retained depending on the keeping property.

Attributes without an explicit namespace prefix will never be removed by this stage.

Note that because the collection is specified as @NonnullElements, this stage can not be used in removing mode to remove elements in the default namespace. It will always remove elements in the default namespace if used in the keeping mode.

Since:
0.9.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Whether we are keeping (true) or removing (false).
    private Set<String>
    Designated XML namespaces to process.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the collection of designated namespaces.
    final boolean
    Indicate whether the stage is keeping the designated namespaces or removing them (the default).
    final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    protected boolean
    Determine whether a particular namespace should be stripped.
    void
    setKeeping(boolean keep)
    Set whether the stage is whether the stage is keeping the designated namespaces or removing them (the default).
    void
    Sets the collection of designated namespaces.
    void
    setWhitelisting(boolean keep)
    Deprecated, for removal: This API element is subject to removal in a future version.

    Methods inherited from class net.shibboleth.metadata.dom.AbstractNamespacesStrippingStage

    doExecute

    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

    • namespaces

      @Nonnull @NonnullElements @Unmodifiable private Set<String> namespaces
      Designated XML namespaces to process.
    • keeping

      private boolean keeping
      Whether we are keeping (true) or removing (false). Default: removing (false).
  • Constructor Details

    • NamespacesStrippingStage

      public NamespacesStrippingStage()
  • Method Details

    • getNamespaces

      @Nonnull @NonnullElements @Unmodifiable public final Collection<String> getNamespaces()
      Gets the collection of designated namespaces.
      Returns:
      collection of designated namespaces
    • setNamespaces

      public void setNamespaces(@Nonnull @NonnullElements @Unmodifiable Collection<String> nss)
      Sets the collection of designated namespaces.
      Parameters:
      nss - collection of designated namespaces
    • isKeeping

      public final boolean isKeeping()
      Indicate whether the stage is keeping the designated namespaces or removing them (the default).
      Returns:
      true if keeping, false for removing (the default)
      Since:
      0.10.0
    • setKeeping

      public void setKeeping(boolean keep)
      Set whether the stage is whether the stage is keeping the designated namespaces or removing them (the default).
      Parameters:
      keep - true if keeping, false for removing (the default)
      Since:
      0.10.0
    • isWhitelisting

      @Deprecated(since="0.10.0", forRemoval=true) public final boolean isWhitelisting()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Indicate whether the stage is keeping the designated namespaces or removing them (the default).
      Returns:
      true if keeping, false for removing (the default)
    • setWhitelisting

      @Deprecated(since="0.10.0", forRemoval=true) public void setWhitelisting(boolean keep)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set whether the stage is whether the stage is keeping the designated namespaces or removing them (the default).
      Parameters:
      keep - true if keeping, false for removing (the default)
    • removingNamespace

      protected boolean removingNamespace(@Nullable String namespace)
      Description copied from class: AbstractNamespacesStrippingStage
      Determine whether a particular namespace should be stripped.
      Specified by:
      removingNamespace in class AbstractNamespacesStrippingStage
      Parameters:
      namespace - potentially stripped namespace
      Returns:
      true if this namespace should be stripped