Package com.nimbusds.jose.jwk.source
Class DefaultJWKSetCache
- java.lang.Object
-
- com.nimbusds.jose.jwk.source.DefaultJWKSetCache
-
- All Implemented Interfaces:
JWKSetCache
@ThreadSafe @Deprecated public class DefaultJWKSetCache extends Object implements JWKSetCache
Deprecated.see RemoteJWKSet.JSON Web Key (JWK) set cache implementation.- Version:
- 2021-01-08
- Author:
- Vladimir Dzhuvinov, Sarvesh Sharma
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_LIFESPAN_MINUTESDeprecated.The default lifespan for cached JWK sets (15 minutes).static longDEFAULT_REFRESH_TIME_MINUTESDeprecated.The default refresh time for cached JWK sets (5 minutes).
-
Constructor Summary
Constructors Constructor Description 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(long lifespan, long refreshTime, TimeUnit timeUnit)Deprecated.Creates a new JWK set cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JWKSetget()Deprecated.Gets the cached JWK set.longgetLifespan(TimeUnit timeUnit)Deprecated.Returns the configured lifespan of the cached JWK.longgetPutTimestamp()Deprecated.Returns the cache put timestamp.longgetRefreshTime(TimeUnit timeUnit)Deprecated.Returns the configured refresh time of the cached JWK.booleanisExpired()Deprecated.Returnstrueif the cached JWK set is expired.voidput(JWKSet jwkSet)Deprecated.Puts the specified JWK set into the cache or clears the cache.booleanrequiresRefresh()Deprecated.Returnstrueif the cached JWK set requires a refresh.
-
-
-
Field Detail
-
DEFAULT_LIFESPAN_MINUTES
public static final long DEFAULT_LIFESPAN_MINUTES
Deprecated.The default lifespan for cached JWK sets (15 minutes).- See Also:
- Constant Field Values
-
DEFAULT_REFRESH_TIME_MINUTES
public static final long DEFAULT_REFRESH_TIME_MINUTES
Deprecated.The default refresh time for cached JWK sets (5 minutes).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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
public DefaultJWKSetCache(long lifespan, long refreshTime, TimeUnit timeUnit)
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 Detail
-
put
public void put(JWKSet jwkSet)
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
public JWKSet 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
public boolean 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
public long getPutTimestamp()
Deprecated.Returns the cache put timestamp.- Returns:
- The cache put timestamp, negative if not specified.
-
isExpired
public boolean isExpired()
Deprecated.Returnstrueif the cached JWK set is expired.- Returns:
trueif expired.
-
getLifespan
public long getLifespan(TimeUnit timeUnit)
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
public long getRefreshTime(TimeUnit timeUnit)
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.
-
-