Class AsynchronousValidator

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    class AsynchronousValidator
    extends java.lang.Object
    implements java.io.Closeable
    Class used for asynchronous revalidations to be used when the "stale- while-revalidate" directive is present
    • Field Detail

      • queued

        private final java.util.Set<java.lang.String> queued
      • log

        private final org.apache.commons.logging.Log log
    • Method Detail

      • 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
      • markComplete

        void markComplete​(java.lang.String identifier)
        Removes an identifier from the internal list of revalidation jobs in progress. This is meant to be called by AsynchronousValidationRequest.run() once the revalidation is complete, using the identifier passed in during constructions.
        Parameters:
        identifier -
      • jobSuccessful

        void jobSuccessful​(java.lang.String identifier)
        The revalidation job was successful thus the number of consecutive failed attempts will be reset to zero. Should be called by AsynchronousValidationRequest.run().
        Parameters:
        identifier - the revalidation job's unique identifier
      • jobFailed

        void jobFailed​(java.lang.String identifier)
        The revalidation job did fail and thus the number of consecutive failed attempts will be increased. Should be called by AsynchronousValidationRequest.run().
        Parameters:
        identifier - the revalidation job's unique identifier
      • getScheduledIdentifiers

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