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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
cancelBuildsInProgress
(Item initiatingItem) Cancels any builds in progress of this item (if a job) or descendants (if a folder).static boolean
Checks if the suppliedItem
or any of itsItem.getParent()
are being deleted.static void
deregister
(Item item) Deregister the suppliedItem
for deletion.static boolean
isRegistered
(Item item) Checks if the suppliedItem
is explicitly registered for deletion.static boolean
Register the suppliedItem
for deletion.boolean
shouldSchedule
(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 suppliedItem
or any of itsItem.getParent()
are being deleted.- Parameters:
item
- the item.- Returns:
true
if theItem
or any of itsItem.getParent()
are being deleted.
-
isRegistered
Checks if the suppliedItem
is explicitly registered for deletion.- Parameters:
item
- the item.- Returns:
true
if and only if the suppliedItem
has been register(Item)ed for deletion.
-
register
Register the suppliedItem
for deletion.- Parameters:
item
- theItem
that is to be deleted.- Returns:
true
if and only if theItem
was registered and the caller is now responsible to callderegister(Item)
.
-
deregister
Deregister the suppliedItem
for deletion.- Parameters:
item
- theItem
that was to be deleted and is now either deleted or the delete was aborted.
-
shouldSchedule
Description copied from class:Queue.QueueDecisionHandler
Returns whether the new item should be scheduled.- Specified by:
shouldSchedule
in classQueue.QueueDecisionHandler
actions
- 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:
Failure
InterruptedException
- Since:
- 2.470
-