Class RequiredValidUntilFilter
- java.lang.Object
-
- org.opensaml.saml.metadata.resolver.filter.impl.RequiredValidUntilFilter
-
- All Implemented Interfaces:
org.opensaml.saml.metadata.resolver.filter.MetadataFilter
public class RequiredValidUntilFilter extends Object implements org.opensaml.saml.metadata.resolver.filter.MetadataFilter
A metadata filter that requires the presence of avalidUntilattribute on the root element of the metadata document. It can optionally enforce that the validity period (now minusvalidUntildate) is not longer than a specified amount. A maximum validity interval of less than 1 means that no restriction is placed on the metadata'svalidUntilattribute.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private DurationmaxValidityIntervalThe maximum interval between now and thevalidUntildate.
-
Constructor Summary
Constructors Constructor Description RequiredValidUntilFilter()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.opensaml.core.xml.XMLObjectfilter(org.opensaml.core.xml.XMLObject metadata, org.opensaml.saml.metadata.resolver.filter.MetadataFilterContext context)DurationgetMaxValidityInterval()Get the maximum interval between now and thevalidUntildate.protected InstantgetValidUntil(org.opensaml.core.xml.XMLObject metadata)Gets the validUntil time of the metadata, if present.voidsetMaxValidityInterval(Duration validity)Set the maximum interval between now and thevalidUntildate.
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
maxValidityInterval
@Nullable private Duration maxValidityInterval
The maximum interval between now and thevalidUntildate. Defaults to 14 days.
-
-
Method Detail
-
getMaxValidityInterval
@Nullable public Duration getMaxValidityInterval()
Get the maximum interval between now and thevalidUntildate. A value <=0 indicates that there is no restriction.- Returns:
- maximum interval between now and the
validUntildate
-
setMaxValidityInterval
public void setMaxValidityInterval(@Nullable Duration validity)Set the maximum interval between now and thevalidUntildate. A value <=0 indicates that there is no restriction.- Parameters:
validity- time between now and thevalidUntildate
-
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
-
getValidUntil
@Nullable protected Instant getValidUntil(@Nonnull org.opensaml.core.xml.XMLObject metadata) throws org.opensaml.saml.metadata.resolver.filter.FilterException
Gets the validUntil time of the metadata, if present.- Parameters:
metadata- metadata from which to get the validUntil instant- Returns:
- the valid until instant or null if it is not present
- Throws:
org.opensaml.saml.metadata.resolver.filter.FilterException- thrown if the given XML object is not anEntitiesDescriptororEntityDescriptor
-
-