public abstract class AbstractQueueTask extends Object implements Queue.Task
Queue.Task to protect plugins
from new additions to the interface.
Plugins are encouraged to implement AccessControlled otherwise
the tasks will be hidden from display in the queue.
| Constructor and Description |
|---|
AbstractQueueTask() |
| Modifier and Type | Method and Description |
|---|---|
CauseOfBlockage |
getCauseOfBlockage()
If the execution of this task should be blocked for temporary reasons,
this method returns a non-null object explaining why.
|
org.acegisecurity.Authentication |
getDefaultAuthentication()
This default implementation is the historical behaviour, but this is no longer desirable.
|
org.acegisecurity.Authentication |
getDefaultAuthentication(Queue.Item item)
This method allows the task to provide the default fallback authentication object to be used
when
QueueItemAuthenticator fails to authenticate the build. |
Queue.Task |
getOwnerTask()
Gets the
Queue.Task that this subtask belongs to. |
Object |
getSameNodeConstraint()
If a subset of
SubTasks of a Queue.Task needs to be collocated with other SubTasks,
those SubTasks should return the equal object here. |
Collection<? extends SubTask> |
getSubTasks()
Obtains the
SubTasks that constitute this task. |
boolean |
isConcurrentBuild()
True if the task allows concurrent builds, where the same
Queue.Task is executed
by multiple executors concurrently on the same or different nodes. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckAbortPermission, getFullDisplayName, getName, getUrl, getWhyBlocked, hasAbortPermission, isBuildBlockedgetDisplayNamecreateExecutable, getAssignedLabel, getEstimatedDuration, getLastBuiltOngetDisplayName, getResourceListpublic Collection<? extends SubTask> getSubTasks()
Queue.TaskSubTasks that constitute this task.
The collection returned by this method must also contain the primary SubTask
represented by this Queue.Task object itself as the first element.
The returned value is read-only.
At least size 1.
Since this is a newly added method, the invocation may results in AbstractMethodError.
Use Tasks.getSubTasksOf(Queue.Task) that avoids this.
getSubTasks in interface Queue.Taskpublic final Queue.Task getOwnerTask()
SubTaskQueue.Task that this subtask belongs to.getOwnerTask in interface SubTaskpublic boolean isConcurrentBuild()
Queue.TaskQueue.Task is executed
by multiple executors concurrently on the same or different nodes.isConcurrentBuild in interface Queue.Taskpublic CauseOfBlockage getCauseOfBlockage()
Queue.TaskOtherwise this method returns null, indicating that the build can proceed right away.
This can be used to define mutual exclusion that goes beyond
ResourceActivity.getResourceList().
getCauseOfBlockage in interface Queue.Taskpublic Object getSameNodeConstraint()
SubTaskSubTasks of a Queue.Task needs to be collocated with other SubTasks,
those SubTasks should return the equal object here. If null, the execution unit isn't under a
colocation constraint.getSameNodeConstraint in interface SubTask@Nonnull public org.acegisecurity.Authentication getDefaultAuthentication()
Queue.Task.getDefaultAuthentication() for the contract.getDefaultAuthentication in interface Queue.TaskQueueItemAuthenticator,
Tasks.getDefaultAuthenticationOf(Queue.Task)@Nonnull public org.acegisecurity.Authentication getDefaultAuthentication(Queue.Item item)
Queue.TaskQueueItemAuthenticator fails to authenticate the build.
When the task execution touches other objects inside Jenkins, the access control is performed
based on whether this Authentication is allowed to use them.
This method was added to an interface after it was created, so plugins built against
older versions of Jenkins may not have this method implemented. Called private method _getDefaultAuthenticationOf(Task) on Tasks
to avoid AbstractMethodError.
getDefaultAuthentication in interface Queue.TaskQueueItemAuthenticator,
Tasks.getDefaultAuthenticationOf(Queue.Task, Queue.Item)Copyright © 2019. All rights reserved.