Class CacheRevalidatorBase

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    DefaultAsyncCacheRevalidator, DefaultCacheRevalidator

    class CacheRevalidatorBase
    extends java.lang.Object
    implements java.io.Closeable
    Abstract cache re-validation class.
    • Method Detail

      • scheduleRevalidation

        void scheduleRevalidation​(java.lang.String cacheKey,
                                  java.lang.Runnable command)
        Schedules an asynchronous re-validation
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • awaitTermination

        public void awaitTermination​(org.apache.hc.core5.util.Timeout timeout)
                              throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • jobSuccessful

        void jobSuccessful​(java.lang.String identifier)
      • jobFailed

        void jobFailed​(java.lang.String identifier)
      • getScheduledIdentifiers

        java.util.Set<java.lang.String> getScheduledIdentifiers()
      • isStale

        boolean isStale​(org.apache.hc.core5.http.HttpResponse httpResponse)
        Determines if the given response is generated from a stale cache entry.
        Parameters:
        httpResponse - the response to be checked
        Returns:
        whether the response is stale or not