Class BatchMetadataCacheBuilderSpec<IdentifierType,MetadataType>
java.lang.Object
net.shibboleth.oidc.metadata.cache.impl.BaseMetadataCacheBuilderSpec<IdentifierType,MetadataType>
net.shibboleth.oidc.metadata.cache.impl.BatchMetadataCacheBuilderSpec<IdentifierType,MetadataType>
- Type Parameters:
IdentifierType- The metadata identifier type.MetadataType- the metadata type.
- All Implemented Interfaces:
MetadataCacheBuilderSpec<IdentifierType,MetadataType>
public class BatchMetadataCacheBuilderSpec<IdentifierType,MetadataType>
extends BaseMetadataCacheBuilderSpec<IdentifierType,MetadataType>
implements MetadataCacheBuilderSpec<IdentifierType,MetadataType>
A specification for building a batch read-ahead metadata cache.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LoadingStrategyThe function to use to load metadata.private booleanIs a match based on an identifier required? If not, all known metadata will be returned.private DurationRefresh interval used when metadata does not contain any validUntil or cacheDuration information.private DurationFloor, in milliseconds, for the refresh interval.private Function<byte[],List<MetadataType>> How to parse the loaded metadata from the loadingStrategy into a usable metadatatype.Determine the expiration time of the source batch loaded metadata.private Predicate<byte[]>Is the raw metadata bytes from the source valid? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LoadingStrategyGet the batch metadata loading strategy.protected DurationGet the max delay to wait before refreshing metadata.protected DurationGet the min delay to wait before refreshing metadata.protected Function<byte[],List<MetadataType>> Get the raw batch metadata to metadata type parsing strategy.Get the source metadata expiry date strategy.protected Predicate<byte[]>Get the predicate which determines if the source metadata is valid or not.booleanGet if an identifier criteria match is required.voidsetLoadingStrategy(LoadingStrategy strategy) Set the batch metadata loading strategy, applies to theBatchMetadataCachetype.voidsetMatchRequired(boolean required) Set if a match on identifier is required in order to return results.voidsetMaxRefreshDelay(Duration delay) Sets the maximum amount of time between refresh intervals.voidsetMinRefreshDelay(Duration delay) Sets the minimum amount of time between refreshes.voidsetParsingStrategy(Function<byte[], List<MetadataType>> strategy) Set he raw batch metadata to metadata type parsing strategy.voidsetSourceMetadataExpiryStrategy(Function<byte[], Instant> strategy) Set a strategy to find the metadata expiry date from a source metadata document as bytes.voidsetSourceMetadataValidPredicate(Predicate<byte[]> predicate) Set the predicate which determines if the source metadata is valid or not.Methods inherited from class net.shibboleth.oidc.metadata.cache.impl.BaseMetadataCacheBuilderSpec
getCacheId, getCriteriaToIdentifierStrategy, getIdentifierExtractionStrategy, getMetadataBeforeRemovalHook, getMetadataFilterStrategy, getMetadataValidPredicate, getRefreshDelayFactor, setCacheId, setCriteriaToIdentifierStrategy, setIdentifierExtractionStrategy, setMetadataBeforeRemovalHook, setMetadataFilterStrategy, setMetadataValidPredicate, setRefreshDelayFactor
-
Field Details
-
parsingStrategy
How to parse the loaded metadata from the loadingStrategy into a usable metadatatype. Applicable forBatchMetadataCachetypes. -
loadingStrategy
The function to use to load metadata. Applicable forBatchMetadataCachetypes. -
maxRefreshDelay
Refresh interval used when metadata does not contain any validUntil or cacheDuration information. Default value: 4 hours -
minRefreshDelay
Floor, in milliseconds, for the refresh interval. Default value: 5 minutes -
matchOnIdentifierRequired
private boolean matchOnIdentifierRequiredIs a match based on an identifier required? If not, all known metadata will be returned. Defaults to true - a match on identifier is required. -
sourceMetadataExpiryStrategy
Determine the expiration time of the source batch loaded metadata. -
sourceMetadataValidPredicate
Is the raw metadata bytes from the source valid?
-
-
Constructor Details
-
BatchMetadataCacheBuilderSpec
public BatchMetadataCacheBuilderSpec()Constructor.
-
-
Method Details
-
setSourceMetadataValidPredicate
Set the predicate which determines if the source metadata is valid or not.- Parameters:
predicate- the predicate.
-
getSourceMetadataValidPredicate
Get the predicate which determines if the source metadata is valid or not.- Returns:
- the predicate.
-
setSourceMetadataExpiryStrategy
Set a strategy to find the metadata expiry date from a source metadata document as bytes.- Parameters:
strategy- the strategy.
-
getSourceMetadataExpiryStrategy
Get the source metadata expiry date strategy.- Returns:
- the strategy.
-
setMatchRequired
public void setMatchRequired(boolean required) Set if a match on identifier is required in order to return results. If false and there are no identifiers in the criteria to match on, all cached entries will be returned.- Parameters:
required- does the metadata lookup need to match the given criteria.
-
isMatchOnIdentifierRequired
public boolean isMatchOnIdentifierRequired()Get if an identifier criteria match is required.- Returns:
- is an identifier criteria match required.
-
getMinRefreshDelay
Get the min delay to wait before refreshing metadata.- Returns:
- the min delay.
-
getMaxRefreshDelay
Get the max delay to wait before refreshing metadata.- Returns:
- the max delay.
-
setMinRefreshDelay
Sets the minimum amount of time between refreshes.- Parameters:
delay- minimum amount of time between refreshes
-
setMaxRefreshDelay
Sets the maximum amount of time between refresh intervals.- Parameters:
delay- maximum amount of time, in milliseconds, between refresh intervals
-
setParsingStrategy
Set he raw batch metadata to metadata type parsing strategy.- Parameters:
strategy- the parsing strategy.
-
getParsingStrategy
Get the raw batch metadata to metadata type parsing strategy.- Returns:
- the parsing strategy.
-
setLoadingStrategy
Set the batch metadata loading strategy, applies to theBatchMetadataCachetype.- Parameters:
strategy- the strategy to set.
-
getLoadingStrategy
Get the batch metadata loading strategy.- Returns:
- the strategy.
-