public abstract class QueueTaskFilter extends Object implements Queue.Task
Queue.Task.| Modifier | Constructor and Description |
|---|---|
protected |
QueueTaskFilter(Queue.Task base) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkAbortPermission()
Checks the permission to see if the current user can abort this executable.
|
Queue.Executable |
createExecutable()
Creates
Queue.Executable, which performs the actual execution of the task. |
Label |
getAssignedLabel()
If this task needs to be run on a node with a particular label,
return that
Label. |
CauseOfBlockage |
getCauseOfBlockage()
If the execution of this task should be blocked for temporary reasons,
this method returns a non-null object explaining why.
|
String |
getDisplayName()
Used for rendering HTML.
|
long |
getEstimatedDuration()
Estimate of how long will it take to execute this task.
|
String |
getFullDisplayName() |
Node |
getLastBuiltOn()
If the previous execution of this task run on a certain node
and this task prefers to run on the same node, return that.
|
String |
getName()
Unique name of this task.
|
Queue.Task |
getOwnerTask()
Gets the
Queue.Task that this subtask belongs to. |
ResourceList |
getResourceList()
Gets the list of
Resources that this task requires. |
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. |
String |
getUrl()
Returns the URL of this task relative to the context root of the application.
|
String |
getWhyBlocked() |
boolean |
hasAbortPermission()
Works just like
Queue.Task.checkAbortPermission() except it indicates the status by a return value,
instead of exception. |
boolean |
isBuildBlocked()
Returns true if the execution should be blocked
for temporary reasons.
|
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, waitgetDefaultAuthentication, getDefaultAuthenticationprotected QueueTaskFilter(Queue.Task base)
public Label getAssignedLabel()
SubTaskLabel. Otherwise null, indicating
it can run on anywhere.getAssignedLabel in interface SubTaskpublic Node getLastBuiltOn()
SubTaskgetLastBuiltOn in interface SubTaskpublic boolean isBuildBlocked()
Queue.Task
Short-hand for getCauseOfBlockage()!=null.
isBuildBlocked in interface Queue.Taskpublic String getWhyBlocked()
getWhyBlocked 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 String getName()
Queue.Task
This method is no longer used, left here for compatibility. Just return ModelObject.getDisplayName().
getName in interface Queue.Taskpublic String getFullDisplayName()
getFullDisplayName in interface Queue.TaskItem.getFullDisplayName()public long getEstimatedDuration()
SubTaskgetEstimatedDuration in interface SubTask@CheckForNull public Queue.Executable createExecutable() throws IOException
SubTaskQueue.Executable, which performs the actual execution of the task.createExecutable in interface SubTaskQueue.Executable to be launched or null if the executable cannot be
created (e.g. AbstractProject is disabled)IOException - Queue.Executable cannot be createdpublic void checkAbortPermission()
Queue.Task
NOTE: If you have implemented AccessControlled this should just be
checkPermission(hudson.model.Item.CANCEL);
checkAbortPermission in interface Queue.Taskpublic boolean hasAbortPermission()
Queue.TaskQueue.Task.checkAbortPermission() except it indicates the status by a return value,
instead of exception.
Also used by default for Queue.Item.hasCancelPermission().
NOTE: If you have implemented AccessControlled this should just be
return hasPermission(hudson.model.Item.CANCEL);
hasAbortPermission in interface Queue.Taskpublic String getUrl()
Queue.TaskWhen the user clicks an item in the queue, this is the page where the user is taken to. Hudson expects the current instance to be bound to the URL returned by this method.
getUrl in interface Queue.Taskpublic boolean isConcurrentBuild()
Queue.TaskQueue.Task is executed
by multiple executors concurrently on the same or different nodes.isConcurrentBuild in interface Queue.Taskpublic String getDisplayName()
ResourceActivitygetDisplayName in interface ModelObjectgetDisplayName in interface ResourceActivitypublic ResourceList getResourceList()
ResourceActivityResources that this task requires.
Used to make sure no two conflicting tasks run concurrently.
This method must always return the ResourceList
that contains the exact same set of Resources.
If the activity doesn't lock any resources, just
return ResourceList.EMPTY.
getResourceList in interface ResourceActivitypublic 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 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 SubTaskCopyright © 2019. All rights reserved.