Module org.jpo
Package org.jpo.cache

Class ThumbnailCreationQueue

java.lang.Object
org.jpo.cache.ThumbnailCreationQueue

public class ThumbnailCreationQueue extends Object
Queue that holds requests to create Thumbnails from Images.
  • Field Details

  • Method Details

    • requestThumbnailCreation

      public static ThumbnailQueueRequest requestThumbnailCreation(ThumbnailQueueRequest newThumbnailQueueRequest)
      This method creates a ThumbnailQueueRequest and sticks it on the ThumbnailCreationQueue if Thumbnail is not already on the queue. Otherwise, the queue priority of the existing request is increased if the request comes in with a higher priority. If the new request forces a rebuild of the image this is also updated in the request.
      Parameters:
      newThumbnailQueueRequest - the request to put on the queue
      Returns:
      true if the request was added to the queue, false if the request already existed.
    • clear

      @TestOnly public static void clear()
      Remove all queue requests from the queue.
    • size

      public static int size()
      Returns the number of requests currently on the queue
      Returns:
      The number of requests on the queue.
    • removeFromQueue

      public static void removeFromQueue(ThumbnailQueueRequest requestToRemove)
      removes the request for a specific ThumbnailController from the queue if it was on the queue in the first place.
      Parameters:
      requestToRemove - The request to remove
    • findThumbnailQueueRequest

      @TestOnly protected static ThumbnailQueueRequest findThumbnailQueueRequest(ThumbnailQueueRequestCallbackHandler callbackHandler)
      This method returns the ThumbnailQueueRequest for the supplied ThumbnailController if such a request exists. Otherwise, it returns null.
      Parameters:
      callbackHandler - The ThumbnailQueueRequestCallbackHandler for which the request is to be found
      Returns:
      The ThumbnailQueueRequest if it exists.