Class ByReferenceMetadataFilter

java.lang.Object
org.opensaml.saml.metadata.resolver.filter.impl.ByReferenceMetadataFilter
All Implemented Interfaces:
MetadataFilter

public class ByReferenceMetadataFilter
extends Object
implements MetadataFilter
A MetadataFilter that associates other filters with specific MetadataResolver instances by ID.

The MetadataFilterContext is used to identify which resolver is actually running, to properly identify which filters to apply.

Since:
4.0.0
  • Field Details

  • Constructor Details

    • ByReferenceMetadataFilter

      public ByReferenceMetadataFilter()
      Constructor.
  • Method Details

    • setFilterMappings

      public void setFilterMappings​(@Nonnull @NonnullElements Map<String,​MetadataFilter> map)
      Mapping of resolver names to filters to run.
      Parameters:
      map - filter mappings
    • filter

      public XMLObject filter​(@Nullable XMLObject metadata, @Nonnull MetadataFilterContext context) throws FilterException
      Filters the given metadata, perhaps to remove elements that are not wanted.
      Specified by:
      filter in interface MetadataFilter
      Parameters:
      metadata - the metadata to be filtered.
      context - the metadata filter context
      Returns:
      the filtered XMLObject, which may or may not be the same as the XMLObject instance passed in to the method. Maybe be null, for example if the top-level element was removed by the filter.
      Throws:
      FilterException - thrown if an error occurs during the filtering process