Package jenkins.advancedqueue.sorter
Class SorterStrategy
java.lang.Object
jenkins.advancedqueue.sorter.SorterStrategy
- All Implemented Interfaces:
ExtensionPoint,Describable<SorterStrategy>
- Direct Known Subclasses:
MultiBucketStrategy
public abstract class SorterStrategy
extends Object
implements ExtensionPoint, Describable<SorterStrategy>
- Since:
- 2.0
- Author:
- Magnus Sandberg
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<SorterStrategy>all()All registeredSorterStrategys.static List<SorterStrategyDescriptor>abstract intGets a default priority bucket to be used.abstract intGets number of priority buckets to be used.static SorterStrategygetPrioritySorterStrategy(SorterStrategyDescriptor sorterStrategy) static SorterStrategyDescriptorgetSorterStrategy(String key) voidonCanceledItem(Queue.LeftItem item) Called when aItemleaves the queue and it is canceled.abstract SorterStrategyCallbackonNewItem(Queue.Item item, SorterStrategyCallback weightCallback) Called when a newItementers the queue.voidonStartedItem(Queue.LeftItem item, float weight) Called when aItemleaves the queue and it is started.
-
Constructor Details
-
SorterStrategy
public SorterStrategy()
-
-
Method Details
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<SorterStrategy>
-
onNewItem
public abstract SorterStrategyCallback onNewItem(@NonNull Queue.Item item, SorterStrategyCallback weightCallback) Called when a newItementers the queue.- Parameters:
item- theQueue.WaitingItemorBuildableItemthat enters the queueweightCallback- the callback holds the priority to use anded the called method must set the weight before returning- Returns:
- the
SorterStrategyCallbackprovided to the call must be returned
-
onStartedItem
Called when aItemleaves the queue and it is started.- Parameters:
item- theQueue.LeftItemweight- the weight assigned when the item entered the queue
-
onCanceledItem
Called when aItemleaves the queue and it is canceled. -
getNumberOfPriorities
public abstract int getNumberOfPriorities()Gets number of priority buckets to be used. -
getDefaultPriority
public abstract int getDefaultPriority()Gets a default priority bucket to be used. -
getAllSorterStrategies
-
getSorterStrategy
-
getPrioritySorterStrategy
@CheckForNull public static SorterStrategy getPrioritySorterStrategy(SorterStrategyDescriptor sorterStrategy) -
all
All registeredSorterStrategys.
-