Class DefaultJWKSetCache

  • All Implemented Interfaces:
    JWKSetCache

    @ThreadSafe
    @Deprecated
    public class DefaultJWKSetCache
    extends java.lang.Object
    implements JWKSetCache
    Deprecated.
    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 long DEFAULT_LIFESPAN_MINUTES
      Deprecated.
      The default lifespan for cached JWK sets (15 minutes).
      static long DEFAULT_REFRESH_TIME_MINUTES
      Deprecated.
      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, java.util.concurrent.TimeUnit timeUnit)
      Deprecated.
      Creates a new JWK set cache.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      JWKSet get()
      Deprecated.
      Gets the cached JWK set.
      long getLifespan​(java.util.concurrent.TimeUnit timeUnit)
      Deprecated.
      Returns the configured lifespan of the cached JWK.
      long getPutTimestamp()
      Deprecated.
      Returns the cache put timestamp.
      long getRefreshTime​(java.util.concurrent.TimeUnit timeUnit)
      Deprecated.
      Returns the configured refresh time of the cached JWK.
      boolean isExpired()
      Deprecated.
      Returns true if the cached JWK set is expired.
      void put​(JWKSet jwkSet)
      Deprecated.
      Puts the specified JWK set into the cache or clears the cache.
      boolean requiresRefresh()
      Deprecated.
      Returns true if the cached JWK set requires a refresh.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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,
                                  java.util.concurrent.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 be null if no expiration or refresh time.
    • Method Detail

      • put

        public void put​(JWKSet jwkSet)
        Deprecated.
        Description copied from interface: JWKSetCache
        Puts the specified JWK set into the cache or clears the cache.
        Specified by:
        put in interface JWKSetCache
        Parameters:
        jwkSet - The JWK set to cache, null to clear the cache.
      • get

        public JWKSet get()
        Deprecated.
        Description copied from interface: JWKSetCache
        Gets the cached JWK set.
        Specified by:
        get in interface JWKSetCache
        Returns:
        The cached JWK set, null if none or expired.
      • requiresRefresh

        public boolean requiresRefresh()
        Deprecated.
        Description copied from interface: JWKSetCache
        Returns true 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 interface JWKSetCache
        Returns:
        true if 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.
        Returns true if the cached JWK set is expired.
        Returns:
        true if expired.
      • getLifespan

        public long getLifespan​(java.util.concurrent.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​(java.util.concurrent.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.