Class AlgorithmFilter
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.saml.metadata.resolver.filter.AbstractMetadataFilter
org.opensaml.saml.metadata.resolver.filter.impl.AlgorithmFilter
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,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
FieldsModifier and TypeFieldDescriptionprivate Multimap<Predicate<EntityDescriptor>,XMLObject> Rules for adding algorithms.private final SAMLObjectBuilder<Extensions>Builder forExtensions.private final org.slf4j.LoggerClass logger.private AlgorithmRegistryRegistry for sanity checking algorithms. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 voidCheck 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.filter(XMLObject metadata, MetadataFilterContext context) Filters the given metadata, perhaps to remove elements that are not wanted.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 org.opensaml.saml.metadata.resolver.filter.AbstractMetadataFilter
getType, setTypeMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
registry
Registry for sanity checking algorithms. -
applyMap
Rules for adding algorithms. -
extBuilder
Builder forExtensions.
-
-
Constructor Details
-
AlgorithmFilter
public AlgorithmFilter()Constructor.
-
-
Method Details
-
setRules
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 Filters the given metadata, perhaps to remove elements that are not wanted.- 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
-
filterEntityDescriptor
Filters entity descriptor.- Parameters:
descriptor- entity descriptor to filter
-
filterEntitiesDescriptor
Filters entities descriptor.- Parameters:
descriptor- entities descriptor to filter
-
getExtensions
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
Check the input method for "known" and "supported" status for logging purposes.- Parameters:
uri- input method
-
checkSigningMethod
Check the input method for "known" and "supported" status for logging purposes.- Parameters:
uri- input method
-
checkEncryptionMethod
Check the input method for "known" and "supported" status for logging purposes.- Parameters:
uri- input method
-