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.
|
ResourceList |
getResourceList()
Gets the list of
Resource s that this task requires. |
Object |
getSameNodeConstraint()
If a subset of
SubTask s of a Queue.Task needs to be collocated with other SubTask s,
those SubTask s should return the equal object here. |
Collection<? extends SubTask> |
getSubTasks()
Obtains the
SubTask s that constitute this task. |
String |
getUrl()
Returns the URL of this task relative to the context root of the application.
|
String |
getWhyBlocked()
Deprecated.
|
boolean |
hasAbortPermission()
Works just like
Queue.Task.checkAbortPermission() except it indicates the status by a return value,
instead of exception. |
boolean |
isBuildBlocked()
Deprecated.
|
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, wait
getAffinityKey, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2
getOwnerTask
protected QueueTaskFilter(Queue.Task base)
public Label getAssignedLabel()
SubTask
Label
. Otherwise null, indicating
it can run on anywhere.getAssignedLabel
in interface SubTask
public Node getLastBuiltOn()
SubTask
getLastBuiltOn
in interface SubTask
@Deprecated public boolean isBuildBlocked()
Queue.Task
isBuildBlocked
in interface Queue.Task
@Deprecated public String getWhyBlocked()
getWhyBlocked
in interface Queue.Task
public CauseOfBlockage getCauseOfBlockage()
Queue.Task
Otherwise 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.Task
public String getName()
Queue.Task
This method is no longer used, left here for compatibility. Just return ModelObject.getDisplayName()
.
getName
in interface Queue.Task
public String getFullDisplayName()
getFullDisplayName
in interface Queue.Task
Item.getFullDisplayName()
public long getEstimatedDuration()
SubTask
getEstimatedDuration
in interface SubTask
@CheckForNull public Queue.Executable createExecutable() throws IOException
SubTask
Queue.Executable
, which performs the actual execution of the task.createExecutable
in interface SubTask
Queue.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.Task
public boolean hasAbortPermission()
Queue.Task
Queue.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.Task
public String getUrl()
Queue.Task
When 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.Task
public boolean isConcurrentBuild()
Queue.Task
Queue.Task
is executed
by multiple executors concurrently on the same or different nodes.isConcurrentBuild
in interface Queue.Task
public String getDisplayName()
ResourceActivity
getDisplayName
in interface ModelObject
getDisplayName
in interface ResourceActivity
public ResourceList getResourceList()
ResourceActivity
Resource
s 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 Resource
s.
If the activity doesn't lock any resources, just
return ResourceList.EMPTY
(or decline to override).
getResourceList
in interface ResourceActivity
public Collection<? extends SubTask> getSubTasks()
Queue.Task
SubTask
s 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.
getSubTasks
in interface Queue.Task
this
public Object getSameNodeConstraint()
SubTask
SubTask
s of a Queue.Task
needs to be collocated with other SubTask
s,
those SubTask
s should return the equal object here. If null, the execution unit isn't under a
colocation constraint.getSameNodeConstraint
in interface SubTask
Copyright © 2004–2021. All rights reserved.