Class ExpirationTimeContext<T>
- java.lang.Object
-
- net.shibboleth.oidc.metadata.cache.ExpirationTimeContext<T>
-
- Type Parameters:
T- The metadata type.
@Immutable public class ExpirationTimeContext<T> extends Object
Context to hold information pertaining to the computation of a metadata's expiration time.
-
-
Field Summary
Fields Modifier and Type Field Description private DurationmaxCacheDurationMaximum cache duration.private TmetadataThe metadata to base the expiry time off.private DurationminCacheDurationMinimum cache duration.private InstantnowThe now time to base computation off.
-
Constructor Summary
Constructors Constructor Description ExpirationTimeContext(T metadataIn, Duration minimumCacheDuration, Duration maximumCacheDuration, Instant timeNow)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DurationgetMaxCacheDuration()Get the maximum cache duration.TgetMetadata()Get the metadata.DurationgetMinCacheDuration()Get the minimum cache duration.InstantgetNow()Get the time to use a 'now'.
-
-
-
Field Detail
-
metadata
@Nonnull private final T metadata
The metadata to base the expiry time off.
-
minCacheDuration
@Nonnull private final Duration minCacheDuration
Minimum cache duration.
-
maxCacheDuration
@Nonnull private final Duration maxCacheDuration
Maximum cache duration.
-
now
@Nonnull private final Instant now
The now time to base computation off.
-
-
Constructor Detail
-
ExpirationTimeContext
public ExpirationTimeContext(@Nonnull T metadataIn, @Nonnull Duration minimumCacheDuration, @Nonnull Duration maximumCacheDuration, @Nonnull Instant timeNow)Constructor.- Parameters:
metadataIn- the metadata to base the expiry time off.minimumCacheDuration- minimum cache duration.maximumCacheDuration- maximum cache duration. *timeNow- the now time to base computation off.
-
-
Method Detail
-
getMetadata
public final T getMetadata()
Get the metadata.- Returns:
- Returns the metadata.
-
getMinCacheDuration
public final Duration getMinCacheDuration()
Get the minimum cache duration.- Returns:
- Returns the minCacheDuration.
-
getMaxCacheDuration
public final Duration getMaxCacheDuration()
Get the maximum cache duration.- Returns:
- Returns the maxCacheDuration.
-
getNow
public final Instant getNow()
Get the time to use a 'now'.- Returns:
- Returns now.
-
-