Class QueueItemCache


  • public class QueueItemCache
    extends Object
    Keeps track of the Queue.Items seen by the Sorter. Uses a WeakHash to store the entries that have left the queue, this can be used by Strategies that needs this info but still minimizes the need to lookup the data again from Jenkins Core.
    Since:
    2.3
    Author:
    Magnus Sandberg
    • Method Detail

      • getItem

        public ItemInfo getItem​(long itemId)
      • getItem

        @Deprecated
        public ItemInfo getItem​(Integer itemId)
        Deprecated.
        Gets the Item for and itemId/queueId
        Parameters:
        itemId - the id of a Job currently in the queue
        Returns:
        the ItemInfo for the provided id or null if the id is not in the queue
      • getItem

        @CheckForNull
        public ItemInfo getItem​(String jobName)
        Get the ItemInfo for the last knows start of this Job Name
        Parameters:
        jobName - a name of a Job
        Returns:
        the ItemInfo for the last know start of the Job. Can be null if job didn't run yet
      • removeItem

        @CheckForNull
        public ItemInfo removeItem​(long itemId)