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
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.Logger
Class logger.private AlgorithmRegistry
Registry for sanity checking algorithms. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addEncryptionMethod
(EntityDescriptor descriptor, EncryptionMethod encryptionMethod) AddEncryptionMethod
extension to everyKeyDescriptor
found in an entity.private void
checkDigestMethod
(String uri) Check the input method for "known" and "supported" status for logging purposes.private void
Check the input method for "known" and "supported" status for logging purposes.private void
checkSigningMethod
(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 void
filterEntitiesDescriptor
(EntitiesDescriptor descriptor) Filters entities descriptor.protected void
filterEntityDescriptor
(EntityDescriptor descriptor) Filters entity descriptor.protected Extensions
getExtensions
(EntityDescriptor descriptor) Return existingExtensions
object or create it first.void
setRules
(Map<Predicate<EntityDescriptor>, Collection<XMLObject>> rules) Set the mappings fromPredicate
to extensions of various types to apply.Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, 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
public void setRules(@Nonnull @NonnullElements Map<Predicate<EntityDescriptor>, Collection<XMLObject>> rules) Set the mappings fromPredicate
to 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.- Specified by:
filter
in interfaceMetadataFilter
- 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 existingExtensions
object 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) AddEncryptionMethod
extension to everyKeyDescriptor
found 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
-