Package com.nimbusds.jose.jwk.source
Class DefaultJWKSetCache
java.lang.Object
com.nimbusds.jose.jwk.source.DefaultJWKSetCache
- All Implemented Interfaces:
JWKSetCache
Deprecated.
see RemoteJWKSet.
JSON Web Key (JWK) set cache implementation.
- Version:
- 2021-01-08
- Author:
- Vladimir Dzhuvinov, Sarvesh Sharma
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Deprecated.The default lifespan for cached JWK sets (15 minutes).static final long
Deprecated.The default refresh time for cached JWK sets (5 minutes). -
Constructor Summary
ConstructorDescriptionDeprecated.Creates a new JWK set, the default lifespan of the cached JWK set is set to 15 minutes, the refresh time to 5 minutes.DefaultJWKSetCache
(long lifespan, long refreshTime, TimeUnit timeUnit) Deprecated.Creates a new JWK set cache. -
Method Summary
Modifier and TypeMethodDescriptionget()
Deprecated.Gets the cached JWK set.long
getLifespan
(TimeUnit timeUnit) Deprecated.Returns the configured lifespan of the cached JWK.long
Deprecated.Returns the cache put timestamp.long
getRefreshTime
(TimeUnit timeUnit) Deprecated.Returns the configured refresh time of the cached JWK.boolean
Deprecated.Returnstrue
if the cached JWK set is expired.void
Deprecated.Puts the specified JWK set into the cache or clears the cache.boolean
Deprecated.Returnstrue
if the cached JWK set requires a refresh.
-
Field Details
-
DEFAULT_LIFESPAN_MINUTES
Deprecated.The default lifespan for cached JWK sets (15 minutes).- See Also:
-
DEFAULT_REFRESH_TIME_MINUTES
Deprecated.The default refresh time for cached JWK sets (5 minutes).- See Also:
-
-
Constructor Details
-
DefaultJWKSetCache
public DefaultJWKSetCache()Deprecated.Creates a new JWK set, the default lifespan of the cached JWK set is set to 15 minutes, the refresh time to 5 minutes. -
DefaultJWKSetCache
Deprecated.Creates a new JWK set cache.- Parameters:
lifespan
- The lifespan of the cached JWK set before it expires, negative means no expiration.refreshTime
- The time after which the cached JWK set is marked for refresh, negative if not specified. Should be shorter or equal to the lifespan.timeUnit
- The lifespan time unit, may benull
if no expiration or refresh time.
-
-
Method Details
-
put
Deprecated.Description copied from interface:JWKSetCache
Puts the specified JWK set into the cache or clears the cache.- Specified by:
put
in interfaceJWKSetCache
- Parameters:
jwkSet
- The JWK set to cache,null
to clear the cache.
-
get
Deprecated.Description copied from interface:JWKSetCache
Gets the cached JWK set.- Specified by:
get
in interfaceJWKSetCache
- Returns:
- The cached JWK set,
null
if none or expired.
-
requiresRefresh
Deprecated.Description copied from interface:JWKSetCache
Returnstrue
if the cached JWK set requires a refresh. This should typically occur some time before the cache has expired, to allow for transient retrieval exceptions before expiration.- Specified by:
requiresRefresh
in interfaceJWKSetCache
- Returns:
true
if the cached JWK set requires a refresh.
-
getPutTimestamp
Deprecated.Returns the cache put timestamp.- Returns:
- The cache put timestamp, negative if not specified.
-
isExpired
Deprecated.Returnstrue
if the cached JWK set is expired.- Returns:
true
if expired.
-
getLifespan
Deprecated.Returns the configured lifespan of the cached JWK.- Parameters:
timeUnit
- The time unit to use.- Returns:
- The configured lifespan, negative means no expiration.
-
getRefreshTime
Deprecated.Returns the configured refresh time of the cached JWK.- Parameters:
timeUnit
- The time unit to use.- Returns:
- The configured refresh time, negative means no expiration.
-