Package jenkins.model.queue
Class QueueIdStrategy
- java.lang.Object
-
- jenkins.model.queue.QueueIdStrategy
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
QueueIdStrategy.DefaultStrategy
@Restricted(org.kohsuke.accmod.restrictions.Beta.class) public abstract class QueueIdStrategy extends Object implements ExtensionPoint
Pluggable strategy to generate queue item IDs as well as persist an optional opaque state whenever the queue is persisted.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueueIdStrategy.DefaultStrategy
Default implementation if no extension is found.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description QueueIdStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract long
generateIdFor(Queue.Task project, List<Action> actions)
Generates a new ID for the given project and actions.static QueueIdStrategy
get()
void
load(Queue.State queueState)
Loads the state of this strategy from a persisted queue state.void
persist(Queue.State queueState)
Persist the state of this strategy.
-
-
-
Method Detail
-
get
public static QueueIdStrategy get()
-
persist
public void persist(@NonNull Queue.State queueState)
Persist the state of this strategy.
-
load
public void load(@NonNull Queue.State queueState)
Loads the state of this strategy from a persisted queue state.
-
generateIdFor
public abstract long generateIdFor(@NonNull Queue.Task project, @NonNull List<Action> actions)
Generates a new ID for the given project and actions.- Parameters:
project
- The task to be queued.actions
- The actions linked the task.- Returns:
- a new queue ID.
-
-