Package jenkins.advancedqueue.sorter
Class QueueItemCache
- java.lang.Object
-
- jenkins.advancedqueue.sorter.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ItemInfo
addItem(ItemInfo itemInfo)
static QueueItemCache
get()
ItemInfo
getItem(long itemId)
ItemInfo
getItem(Integer itemId)
Deprecated.ItemInfo
getItem(String jobName)
Get the ItemInfo for the last knows start of this Job NameList<ItemInfo>
getSortedList()
This method will return a sorted list of all known and activeItemInfo
s this will include Items mapped toQueue.BuildableItem
s as well asQueue.BlockedItem
sItemInfo
removeItem(long itemId)
ItemInfo
removeItem(Integer itemId)
Deprecated.
-
-
-
Method Detail
-
get
public static QueueItemCache get()
-
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 ornull
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 benull
if job didn't run yet
-
removeItem
@CheckForNull @Deprecated public ItemInfo removeItem(Integer itemId)
Deprecated.
-
removeItem
@CheckForNull public ItemInfo removeItem(long itemId)
-
getSortedList
public List<ItemInfo> getSortedList()
This method will return a sorted list of all known and activeItemInfo
s this will include Items mapped toQueue.BuildableItem
s as well asQueue.BlockedItem
s- Returns:
- the sorted list of all
ItemInfo
s
-
-