Class AlgorithmFilter
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.saml.metadata.resolver.filter.impl.AlgorithmFilter
-
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,org.opensaml.saml.metadata.resolver.filter.MetadataFilter
public class AlgorithmFilter extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent implements org.opensaml.saml.metadata.resolver.filter.MetadataFilterA 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<org.opensaml.saml.saml2.metadata.EntityDescriptor>,org.opensaml.core.xml.XMLObject>applyMapRules for adding algorithms.private org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml2.metadata.Extensions>extBuilderBuilder forExtensions.private org.slf4j.LoggerlogClass logger.private org.opensaml.xmlsec.algorithm.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(org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor, org.opensaml.saml.saml2.metadata.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.org.opensaml.core.xml.XMLObjectfilter(org.opensaml.core.xml.XMLObject metadata, org.opensaml.saml.metadata.resolver.filter.MetadataFilterContext context)protected voidfilterEntitiesDescriptor(org.opensaml.saml.saml2.metadata.EntitiesDescriptor descriptor)Filters entities descriptor.protected voidfilterEntityDescriptor(org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor)Filters entity descriptor.protected org.opensaml.saml.saml2.metadata.ExtensionsgetExtensions(org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor)Return existingExtensionsobject or create it first.voidsetRules(Map<Predicate<org.opensaml.saml.saml2.metadata.EntityDescriptor>,Collection<org.opensaml.core.xml.XMLObject>> rules)Set the mappings fromPredicateto extensions of various types to apply.
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
registry
@Nonnull private org.opensaml.xmlsec.algorithm.AlgorithmRegistry registry
Registry for sanity checking algorithms.
-
applyMap
@Nonnull @NonnullElements private Multimap<Predicate<org.opensaml.saml.saml2.metadata.EntityDescriptor>,org.opensaml.core.xml.XMLObject> applyMap
Rules for adding algorithms.
-
extBuilder
@Nonnull private final org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml2.metadata.Extensions> extBuilder
Builder forExtensions.
-
-
Method Detail
-
setRules
public void setRules(@Nonnull @NonnullElements Map<Predicate<org.opensaml.saml.saml2.metadata.EntityDescriptor>,Collection<org.opensaml.core.xml.XMLObject>> rules)Set the mappings fromPredicateto extensions of various types to apply.- Parameters:
rules- rules to apply
-
filter
@Nullable public org.opensaml.core.xml.XMLObject filter(@Nullable org.opensaml.core.xml.XMLObject metadata, @Nonnull org.opensaml.saml.metadata.resolver.filter.MetadataFilterContext context) throws org.opensaml.saml.metadata.resolver.filter.FilterException- Specified by:
filterin interfaceorg.opensaml.saml.metadata.resolver.filter.MetadataFilter- Throws:
org.opensaml.saml.metadata.resolver.filter.FilterException
-
filterEntityDescriptor
protected void filterEntityDescriptor(@Nonnull org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor)Filters entity descriptor.- Parameters:
descriptor- entity descriptor to filter
-
filterEntitiesDescriptor
protected void filterEntitiesDescriptor(@Nonnull org.opensaml.saml.saml2.metadata.EntitiesDescriptor descriptor)Filters entities descriptor.- Parameters:
descriptor- entities descriptor to filter
-
getExtensions
@Nonnull protected org.opensaml.saml.saml2.metadata.Extensions getExtensions(@Nonnull org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor)Return existingExtensionsobject or create it first.- Parameters:
descriptor- the surrounding entity- Returns:
- new or existing extension block
-
addEncryptionMethod
protected void addEncryptionMethod(@Nonnull org.opensaml.saml.saml2.metadata.EntityDescriptor descriptor, @Nonnull org.opensaml.saml.saml2.metadata.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
-
checkEncryptionMethod
private void checkEncryptionMethod(@Nonnull @NotEmpty String uri)Check the input method for "known" and "supported" status for logging purposes.- Parameters:
uri- input method
-
-