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
FieldsModifier and TypeFieldDescriptionstatic final longDeprecated.The default lifespan for cached JWK sets (15 minutes).static final longDeprecated.The default refresh time for cached JWK sets (5 minutes). -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.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.longgetLifespan(TimeUnit timeUnit) Deprecated.Returns the configured lifespan of the cached JWK.longDeprecated.Returns the cache put timestamp.longgetRefreshTime(TimeUnit timeUnit) Deprecated.Returns the configured refresh time of the cached JWK.booleanDeprecated.Returnstrueif the cached JWK set is expired.voidDeprecated.Puts the specified JWK set into the cache or clears the cache.booleanDeprecated.Returnstrueif 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 benullif no expiration or refresh time.
-
-
Method Details
-
put
Deprecated.Description copied from interface:JWKSetCachePuts the specified JWK set into the cache or clears the cache.- Specified by:
putin interfaceJWKSetCache- Parameters:
jwkSet- The JWK set to cache,nullto clear the cache.
-
get
Deprecated.Description copied from interface:JWKSetCacheGets the cached JWK set.- Specified by:
getin interfaceJWKSetCache- Returns:
- The cached JWK set,
nullif none or expired.
-
requiresRefresh
Deprecated.Description copied from interface:JWKSetCacheReturnstrueif 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:
requiresRefreshin interfaceJWKSetCache- Returns:
trueif 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.Returnstrueif the cached JWK set is expired.- Returns:
trueif 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.
-