Package jenkins.model.queue
Class ItemDeletion
java.lang.Object
hudson.model.Queue.QueueDecisionHandler
jenkins.model.queue.ItemDeletion
- All Implemented Interfaces:
ExtensionPoint
A
Queue.QueueDecisionHandler that blocks items being deleted from entering the queue.- Since:
- 2.55
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcancelBuildsInProgress(Item initiatingItem) Cancels any builds in progress of this item (if a job) or descendants (if a folder).static booleanChecks if the suppliedItemor any of itsItem.getParent()are being deleted.static voidderegister(Item item) Deregister the suppliedItemfor deletion.static booleanisRegistered(Item item) Checks if the suppliedItemis explicitly registered for deletion.static booleanRegister the suppliedItemfor deletion.booleanshouldSchedule(Queue.Task p, List<Action> actions) Returns whether the new item should be scheduled.Methods inherited from class hudson.model.Queue.QueueDecisionHandler
all
-
Constructor Details
-
ItemDeletion
public ItemDeletion()
-
-
Method Details
-
contains
Checks if the suppliedItemor any of itsItem.getParent()are being deleted.- Parameters:
item- the item.- Returns:
trueif theItemor any of itsItem.getParent()are being deleted.
-
isRegistered
Checks if the suppliedItemis explicitly registered for deletion.- Parameters:
item- the item.- Returns:
trueif and only if the suppliedItemhas been register(Item)ed for deletion.
-
register
Register the suppliedItemfor deletion.- Parameters:
item- theItemthat is to be deleted.- Returns:
trueif and only if theItemwas registered and the caller is now responsible to callderegister(Item).
-
deregister
Deregister the suppliedItemfor deletion.- Parameters:
item- theItemthat was to be deleted and is now either deleted or the delete was aborted.
-
shouldSchedule
Description copied from class:Queue.QueueDecisionHandlerReturns whether the new item should be scheduled.- Specified by:
shouldSchedulein classQueue.QueueDecisionHandleractions- List of actions that are to be made available asActionable.getActions()upon the start of the build. This list is live, and can be mutated.
-
cancelBuildsInProgress
public static void cancelBuildsInProgress(@NonNull Item initiatingItem) throws Failure, InterruptedException Cancels any builds in progress of this item (if a job) or descendants (if a folder). Also cancels any associated queue items.- Parameters:
initiatingItem- an item being deleted- Throws:
FailureInterruptedException- Since:
- 2.470
-