Class QueueTaskFilter
- All Implemented Interfaces:
ModelObject
,SubTask
,Queue.Task
,ResourceActivity
,ITask
Queue.Task
.- Since:
- 1.360
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the permission to see if the current user can abort this executable.Creates an object which performs the actual execution of the task.If this task needs to be run on a node with a particular label, return thatLabel
.If the execution of this task should be blocked for temporary reasons, this method returns a non-null object explaining why.Used for rendering HTML.long
Estimate of how long will it take to execute this task.Deprecated.getName()
Unique name of this task.Gets the list ofResource
s that this task requires.If a subset ofSubTask
s of aQueue.Task
needs to be collocated with otherSubTask
s, thoseSubTask
s should return the equal object here.Collection<? extends SubTask>
Obtains theSubTask
s that constitute this task.getUrl()
Returns the URL of this task relative to the context root of the application.Deprecated.boolean
boolean
Deprecated.boolean
True if the task allows concurrent builds, where the sameQueue.Task
is executed by multiple executors concurrently on the same or different nodes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jenkins.model.queue.ITask
hasReadPermission
Methods inherited from interface hudson.model.Queue.Task
getAffinityKey, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2
Methods inherited from interface hudson.model.queue.SubTask
getOwnerExecutable, getOwnerTask
-
Constructor Details
-
QueueTaskFilter
-
-
Method Details
-
getAssignedLabel
Description copied from interface:SubTask
If this task needs to be run on a node with a particular label, return thatLabel
. Otherwise null, indicating it can run on anywhere.- Specified by:
getAssignedLabel
in interfaceSubTask
- Returns:
- by default, null
-
getLastBuiltOn
Deprecated.Description copied from interface:SubTask
If the previous execution of this task run on a certain node and this task prefers to run on the same node, return that. Otherwise null.- Specified by:
getLastBuiltOn
in interfaceSubTask
- Returns:
- by default, null
-
isBuildBlocked
Deprecated.Description copied from interface:Queue.Task
Returns true if the execution should be blocked for temporary reasons.- Specified by:
isBuildBlocked
in interfaceQueue.Task
-
getWhyBlocked
Deprecated.- Specified by:
getWhyBlocked
in interfaceQueue.Task
-
getCauseOfBlockage
Description copied from interface:Queue.Task
If the execution of this task should be blocked for temporary reasons, this method returns a non-null object explaining why.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()
.- Specified by:
getCauseOfBlockage
in interfaceQueue.Task
- Returns:
- by default, null
-
getName
Description copied from interface:Queue.Task
Unique name of this task.This method is no longer used, left here for compatibility. Just return
ModelObject.getDisplayName()
.- Specified by:
getName
in interfaceQueue.Task
-
getFullDisplayName
- Specified by:
getFullDisplayName
in interfaceITask
- Specified by:
getFullDisplayName
in interfaceQueue.Task
- Returns:
- the full display name of the task.
Defaults to the same as
ModelObject.getDisplayName()
. - See Also:
-
getEstimatedDuration
public long getEstimatedDuration()Description copied from interface:SubTask
Estimate of how long will it take to execute this task. Measured in milliseconds.- Specified by:
getEstimatedDuration
in interfaceSubTask
- Returns:
- -1 if it's impossible to estimate (the default)
-
createExecutable
Description copied from interface:SubTask
Creates an object which performs the actual execution of the task.- Specified by:
createExecutable
in interfaceSubTask
- Returns:
- executable to be launched or null if the executable cannot be
created (e.g.
AbstractProject
is disabled) - Throws:
IOException
- executable cannot be created
-
checkAbortPermission
public void checkAbortPermission()Description copied from interface:Queue.Task
Checks the permission to see if the current user can abort this executable. Returns normally from this method if it's OK.NOTE: If you have implemented
AccessControlled
this defaults tocheckPermission(hudson.model.Item.CANCEL);
- Specified by:
checkAbortPermission
in interfaceQueue.Task
-
hasAbortPermission
public boolean hasAbortPermission()- Specified by:
hasAbortPermission
in interfaceITask
- Returns:
true
if the current user can cancel the current task. NOTE: If you have implementedAccessControlled
this returns by defaulthasPermission(Item.CANCEL)
-
getUrl
Description copied from interface:Queue.Task
Returns the URL of this task relative to the context root of the application.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.
-
isConcurrentBuild
public boolean isConcurrentBuild()Description copied from interface:Queue.Task
True if the task allows concurrent builds, where the sameQueue.Task
is executed by multiple executors concurrently on the same or different nodes.- Specified by:
isConcurrentBuild
in interfaceQueue.Task
- Returns:
- by default, false
-
getDisplayName
Description copied from interface:ResourceActivity
Used for rendering HTML.- Specified by:
getDisplayName
in interfaceModelObject
- Specified by:
getDisplayName
in interfaceResourceActivity
-
getResourceList
Description copied from interface:ResourceActivity
Gets the list ofResource
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 ofResource
s.If the activity doesn't lock any resources, just return
ResourceList.EMPTY
(or decline to override).- Specified by:
getResourceList
in interfaceResourceActivity
- Returns:
- never null
-
getSubTasks
Description copied from interface:Queue.Task
Obtains theSubTask
s that constitute this task.The collection returned by this method must also contain the primary
SubTask
represented by thisQueue.Task
object itself as the first element. The returned value is read-only.At least size 1.
- Specified by:
getSubTasks
in interfaceQueue.Task
- Returns:
- by default,
this
-
getSameNodeConstraint
Description copied from interface:SubTask
If a subset ofSubTask
s of aQueue.Task
needs to be collocated with otherSubTask
s, thoseSubTask
s should return the equal object here. If null, the execution unit isn't under a colocation constraint.- Specified by:
getSameNodeConstraint
in interfaceSubTask
- Returns:
- by default, null
-