Class AlgorithmFilter
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.saml.metadata.resolver.filter.impl.AlgorithmFilter
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MetadataFilter
public class AlgorithmFilter extends AbstractInitializableComponent implements MetadataFilter
A filter that adds algorithm extension content to entities in order to drive software behavior based on them.The entities to annotate are identified with a
Predicate, and multiple algorithms can be associated with each.
-
-
Field Summary
Fields Modifier and Type Field Description private Multimap<Predicate<EntityDescriptor>,XMLObject>applyMapRules for adding algorithms.private SAMLObjectBuilder<Extensions>extBuilderBuilder forExtensions.private org.slf4j.LoggerlogClass logger.private AlgorithmRegistryregistryRegistry for sanity checking algorithms.
-
Constructor Summary
Constructors Constructor Description AlgorithmFilter()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddEncryptionMethod(EntityDescriptor descriptor, EncryptionMethod encryptionMethod)AddEncryptionMethodextension to everyKeyDescriptorfound in an entity.private voidcheckDigestMethod(String uri)Check the input method for "known" and "supported" status for logging purposes.private voidcheckEncryptionMethod(String uri)Check the input method for "known" and "supported" status for logging purposes.private voidcheckSigningMethod(String uri)Check the input method for "known" and "supported" status for logging purposes.XMLObjectfilter(XMLObject metadata, MetadataFilterContext context)protected voidfilterEntitiesDescriptor(EntitiesDescriptor descriptor)Filters entities descriptor.protected voidfilterEntityDescriptor(EntityDescriptor descriptor)Filters entity descriptor.protected ExtensionsgetExtensions(EntityDescriptor descriptor)Return existingExtensionsobject or create it first.voidsetRules(Map<Predicate<EntityDescriptor>,Collection<XMLObject>> rules)Set the mappings fromPredicateto extensions of various types 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.
-
registry
@Nonnull private AlgorithmRegistry registry
Registry for sanity checking algorithms.
-
applyMap
@Nonnull @NonnullElements private Multimap<Predicate<EntityDescriptor>,XMLObject> applyMap
Rules for adding algorithms.
-
extBuilder
@Nonnull private final SAMLObjectBuilder<Extensions> extBuilder
Builder forExtensions.
-
-
Method Detail
-
setRules
public void setRules(@Nonnull @NonnullElements Map<Predicate<EntityDescriptor>,Collection<XMLObject>> rules)
Set the mappings fromPredicateto extensions of various types 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
-
filterEntitiesDescriptor
protected void filterEntitiesDescriptor(@Nonnull EntitiesDescriptor descriptor)Filters entities descriptor.- Parameters:
descriptor- entities descriptor to filter
-
getExtensions
@Nonnull protected Extensions getExtensions(@Nonnull EntityDescriptor descriptor)
Return existingExtensionsobject or create it first.- Parameters:
descriptor- the surrounding entity- Returns:
- new or existing extension block
-
addEncryptionMethod
protected void addEncryptionMethod(@Nonnull EntityDescriptor descriptor, @Nonnull EncryptionMethod encryptionMethod)AddEncryptionMethodextension to everyKeyDescriptorfound in an entity.- Parameters:
descriptor- the entity to modifyencryptionMethod- extension to add
-
checkDigestMethod
private void checkDigestMethod(@Nonnull @NotEmpty String uri)
Check the input method for "known" and "supported" status for logging purposes.- Parameters:
uri- input method
-
checkSigningMethod
private void checkSigningMethod(@Nonnull @NotEmpty String uri)
Check the input method for "known" and "supported" status for logging purposes.- Parameters:
uri- input method
-
-