public class RequiredValidUntilFilter extends Object implements MetadataFilter
validUntil
attribute on the root element of the
metadata document. It can optionally enforce that the validity period (now minus validUntil
date)
is not longer than a specified amount.
A maximum validity interval of less than 1 means that no restriction is placed on the metadata's
validUntil
attribute.Constructor and Description |
---|
RequiredValidUntilFilter()
Constructor.
|
RequiredValidUntilFilter(long maxValidity)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
XMLObject |
filter(XMLObject metadata)
Filters the given metadata, perhaps to remove elements that are not wanted.
|
long |
getMaxValidityInterval()
Get the maximum interval, in milliseconds, between now and the
validUntil date. |
protected org.joda.time.DateTime |
getValidUntil(XMLObject metadata)
Gets the validUntil time of the metadata, if present.
|
void |
setMaxValidityInterval(long validity)
Set the maximum interval, in milliseconds, between now and the
validUntil date. |
public RequiredValidUntilFilter()
public RequiredValidUntilFilter(long maxValidity)
maxValidity
- maximum interval, in seconds, between now and the validUntil
datepublic long getMaxValidityInterval()
validUntil
date.
A value of less than 1 indicates that there is no restriction.validUntil
datepublic void setMaxValidityInterval(@Duration long validity)
validUntil
date.
A value of less than 1 indicates that there is no restriction.validity
- time in milliseconds between now and the validUntil
date@Nullable public XMLObject filter(@Nullable XMLObject metadata) throws FilterException
filter
in interface MetadataFilter
metadata
- the metadata to be filtered.FilterException
- thrown if an error occurs during the filtering process@Nullable protected org.joda.time.DateTime getValidUntil(@Nonnull XMLObject metadata) throws FilterException
metadata
- metadata from which to get the validUntil instantFilterException
- thrown if the given XML object is not an EntitiesDescriptor
or
EntityDescriptor
Copyright © 2019. All rights reserved.