@ExportedBean(defaultVisibility=999) public abstract static class Queue.Item extends Actionable
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem
Modifier and Type | Field and Description |
---|---|
Queue.Task |
task
Project to be built.
|
Modifier | Constructor and Description |
---|---|
protected |
Item(Queue.Item item) |
protected |
Item(Queue.Task task,
List<Action> actions,
long id,
FutureImpl future) |
protected |
Item(Queue.Task task,
List<Action> actions,
long id,
FutureImpl future,
long inQueueSince) |
Modifier and Type | Method and Description |
---|---|
org.acegisecurity.Authentication |
authenticate()
Returns the identity that this task carries when it runs, for the purpose of access control.
|
org.kohsuke.stapler.HttpResponse |
doCancelQueue()
Deprecated.
Use
Queue.doCancelItem(long) instead. |
Api |
getApi() |
Label |
getAssignedLabel()
If this task needs to be run on a node with a particular label,
return that
Label . |
Label |
getAssignedLabelFor(SubTask st)
Test if the specified
SubTask needs to be run on a node with a particular label. |
abstract CauseOfBlockage |
getCauseOfBlockage()
Gets an object that describes why this item is in the queue.
|
List<Cause> |
getCauses()
Convenience method that returns a read only view of the
Cause s associated with this item in the queue. |
String |
getCausesDescription() |
String |
getDisplayName() |
QueueTaskFuture<Queue.Executable> |
getFuture()
Can be used to wait for the completion (either normal, abnormal, or cancellation) of the
Queue.Task . |
long |
getId()
Unique ID (per master) that tracks the
Queue.Task as it moves through different stages
in the queue (each represented by different subtypes of Item and into any subsequent
Run instance (see Run.getQueueId() ). |
int |
getIdLegacy()
Deprecated.
|
String |
getInQueueForString()
Returns a human readable presentation of how long this item is already in the queue.
|
long |
getInQueueSince()
Since when is this item in the queue.
|
String |
getParams()
Gets a human-readable message about the parameters of this item
|
String |
getSearchUrl()
Returns the URL of this item relative to the parent
SearchItem . |
String |
getUrl()
Returns the URL of this
Item relative to the context path of Jenkins |
String |
getWhy()
Gets a human-readable status message describing why it's in the queue.
|
boolean |
hasCancelPermission()
Checks whether a scheduled item may be canceled.
|
boolean |
isBlocked()
Build is blocked because another build is in progress,
required
Resource s are not available, or otherwise blocked
by Queue.Task.isBuildBlocked() . |
boolean |
isBuildable()
Build is waiting the executor to become available.
|
boolean |
isStuck()
True if the item is starving for an executor for too long.
|
String |
toString() |
addAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, replaceAction
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
@Exported public final Queue.Task task
protected Item(Queue.Task task, List<Action> actions, long id, FutureImpl future)
protected Item(Queue.Task task, List<Action> actions, long id, FutureImpl future, long inQueueSince)
protected Item(Queue.Item item)
@Exported public long getId()
Queue.Task
as it moves through different stages
in the queue (each represented by different subtypes of Item
and into any subsequent
Run
instance (see Run.getQueueId()
).@Deprecated public int getIdLegacy()
@Exported public boolean isBlocked()
Resource
s are not available, or otherwise blocked
by Queue.Task.isBuildBlocked()
.@Exported public boolean isBuildable()
Queue.getItems()
for
'pseudo' items that are actually not really in the queue.@Exported public boolean isStuck()
@Exported public long getInQueueSince()
public String getInQueueForString()
@WithBridgeMethods(value=java.util.concurrent.Future.class) public QueueTaskFuture<Queue.Executable> getFuture()
Queue.Task
.
Just like getId()
, the same object tracks various stages of the queue.
public Label getAssignedLabel()
Label
. Otherwise null, indicating
it can run on anywhere.
This code takes LabelAssignmentAction
into account, then fall back to SubTask.getAssignedLabel()
@CheckForNull public Label getAssignedLabelFor(@Nonnull SubTask st)
SubTask
needs to be run on a node with a particular label.
This method takes LabelAssignmentAction
into account, the first
non-null assignment will be returned.
Otherwise falls back to SubTask.getAssignedLabel()
public final List<Cause> getCauses()
Cause
s associated with this item in the queue.@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) public String getCausesDescription()
@Exported public String getUrl()
Item
relative to the context path of Jenkins@Exported public final String getWhy()
public abstract CauseOfBlockage getCauseOfBlockage()
@Exported public String getParams()
public boolean hasCancelPermission()
Queue.Task.hasAbortPermission()
public String getDisplayName()
public String getSearchUrl()
SearchItem
SearchItem
.@Deprecated public org.kohsuke.stapler.HttpResponse doCancelQueue() throws IOException, javax.servlet.ServletException
Queue.doCancelItem(long)
instead.IOException
javax.servlet.ServletException
@Nonnull public org.acegisecurity.Authentication authenticate()
Authentication
is allowed to use them. Implementers, if you are unsure,
return the identity of the user who queued the task, or ACL#SYSTEM
to bypass the access control
and run as the super user.public Api getApi()
Copyright © 2018. All rights reserved.