Class NameIDFormatFilter
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.saml.metadata.resolver.filter.impl.NameIDFormatFilter
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MetadataFilter
public class NameIDFormatFilter extends AbstractInitializableComponent implements MetadataFilter
A filter that addsNameIDFormatcontent to entities in order to drive software behavior based on them. The entities to annotate are identified with aPredicate, and multiple formats can be associated with each.
-
-
Field Summary
Fields Modifier and Type Field Description private Multimap<Predicate<EntityDescriptor>,String>applyMapRules for adding formats.private SAMLObjectBuilder<NameIDFormat>formatBuilderBuilder forNameIDFormat.private org.slf4j.LoggerlogClass logger.private booleanremoveExistingFormatsWhether to strip any existing Formats when adding new ones.
-
Constructor Summary
Constructors Constructor Description NameIDFormatFilter()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XMLObjectfilter(XMLObject metadata, MetadataFilterContext context)protected voidfilterEntitiesDescriptor(EntitiesDescriptor descriptor)Filters entities descriptor.protected voidfilterEntityDescriptor(EntityDescriptor descriptor)Filters entity descriptor.protected voidfilterRoleDescriptor(RoleDescriptor role, Collection<String> formats)Filters role descriptor.voidsetRemoveExistingFormats(boolean flag)Set whether the filter should remove any existing formats from an entity to which it adds new ones.voidsetRules(Map<Predicate<EntityDescriptor>,Collection<String>> rules)Set the mappings fromPredicateto format collection to apply.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
removeExistingFormats
private boolean removeExistingFormats
Whether to strip any existing Formats when adding new ones.
-
applyMap
@Nonnull @NonnullElements private Multimap<Predicate<EntityDescriptor>,String> applyMap
Rules for adding formats.
-
formatBuilder
@Nonnull private final SAMLObjectBuilder<NameIDFormat> formatBuilder
Builder forNameIDFormat.
-
-
Method Detail
-
setRemoveExistingFormats
public void setRemoveExistingFormats(boolean flag)
Set whether the filter should remove any existing formats from an entity to which it adds new ones.Defaults to false (for compatibility).
- Parameters:
flag- flag to set
-
setRules
public void setRules(@Nonnull @NonnullElements Map<Predicate<EntityDescriptor>,Collection<String>> rules)
Set the mappings fromPredicateto format collection to apply.- Parameters:
rules- rules to apply
-
filter
@Nullable public XMLObject filter(@Nullable XMLObject metadata, @Nonnull MetadataFilterContext context) throws FilterException
- Specified by:
filterin interfaceMetadataFilter- Throws:
FilterException
-
filterEntityDescriptor
protected void filterEntityDescriptor(@Nonnull EntityDescriptor descriptor)Filters entity descriptor.- Parameters:
descriptor- entity descriptor to filter
-
filterRoleDescriptor
protected void filterRoleDescriptor(@Nonnull RoleDescriptor role, @Nonnull @NonnullElements Collection<String> formats)Filters role descriptor.- Parameters:
role- role to modifyformats- formats to attach
-
filterEntitiesDescriptor
protected void filterEntitiesDescriptor(@Nonnull EntitiesDescriptor descriptor)Filters entities descriptor.- Parameters:
descriptor- entities descriptor to filter
-
-