Class CachingJWKSetSource<C extends SecurityContext>

    • Constructor Detail

      • CachingJWKSetSource

        public CachingJWKSetSource​(JWKSetSource<C> source,
                                   long timeToLive,
                                   long cacheRefreshTimeout,
                                   EventListener<CachingJWKSetSource<C>,​C> eventListener)
        Creates a new caching JWK set source.
        Parameters:
        source - The JWK set source to decorate. Must not be null.
        timeToLive - The time to live of the cached JWK set, in milliseconds.
        cacheRefreshTimeout - The cache refresh timeout, in milliseconds.
        eventListener - The event listener, null if not specified.
    • Method Detail

      • getJWKSet

        public JWKSet getJWKSet​(JWKSetCacheRefreshEvaluator refreshEvaluator,
                                long currentTime,
                                C context)
                         throws KeySourceException
        Description copied from interface: JWKSetSource
        Gets the JWK set.
        Parameters:
        refreshEvaluator - Controls whether refresh of the JWK set cache (if utilised by the source) is required.
        currentTime - The current time, in milliseconds since the Unix epoch.
        context - Optional context, null if not required.
        Returns:
        The JWK set.
        Throws:
        KeySourceException - If JWK set retrieval failed.
      • getCacheRefreshTimeout

        public long getCacheRefreshTimeout()
        Returns the cache refresh timeout.
        Returns:
        The cache refresh timeout, in milliseconds.
      • getTimeToLive

        public long getTimeToLive()
        Returns the time to live of the cached JWK set.
        Returns:
        The time to live, in milliseconds.