hudson.model
Class Queue.Item

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.Queue.Item
All Implemented Interfaces:
ModelObject, SearchableModelObject, SearchItem, ModelObjectWithContextMenu
Direct Known Subclasses:
Queue.NotWaitingItem, Queue.WaitingItem
Enclosing class:
Queue

@ExportedBean(defaultVisibility=999)
public abstract static class Queue.Item
extends Actionable

Item in a queue.


Nested Class Summary
 
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.MenuItem
 
Field Summary
 int id
          VM-wide unique ID that tracks the Queue.TransientTask as it moves through different stages in the queue (each represented by different subtypes of Item.
 Queue.Task task
          Project to be built.
 
Constructor Summary
protected Queue.Item(Queue.Item item)
           
protected Queue.Item(Queue.Task task, List<Action> actions, int id, FutureImpl future)
           
protected Queue.Item(Queue.Task task, List<Action> actions, int id, FutureImpl future, long inQueueSince)
           
 
Method Summary
 org.kohsuke.stapler.HttpResponse doCancelQueue()
          Deprecated. Use Queue.doCancelItem(int) instead.
 Label getAssignedLabel()
          If this task needs to be run on a node with a particular label, return that 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 Causes associated with this item in the queue.
 String getDisplayName()
           
 Future<Queue.Executable> getFuture()
          Can be used to wait for the completion (either normal, abnormal, or cancellation) of the Queue.TransientTask.
 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 getWhy()
          Gets a human-readable status message describing why it's in the queue.
 boolean hasCancelPermission()
           
 boolean isBlocked()
          Build is blocked because another build is in progress, required Resources 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()
           
 
Methods inherited from class hudson.model.Actionable
addAction, doContextMenu, getAction, getAction, getActions, getActions, getDynamic
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

@Exported
public final int id
VM-wide unique ID that tracks the Queue.TransientTask as it moves through different stages in the queue (each represented by different subtypes of Item.


task

@Exported
public final Queue.Task task
Project to be built.

Constructor Detail

Queue.Item

protected Queue.Item(Queue.Task task,
                     List<Action> actions,
                     int id,
                     FutureImpl future)

Queue.Item

protected Queue.Item(Queue.Task task,
                     List<Action> actions,
                     int id,
                     FutureImpl future,
                     long inQueueSince)

Queue.Item

protected Queue.Item(Queue.Item item)
Method Detail

isBlocked

@Exported
public boolean isBlocked()
Build is blocked because another build is in progress, required Resources are not available, or otherwise blocked by Queue.Task.isBuildBlocked().


isBuildable

@Exported
public boolean isBuildable()
Build is waiting the executor to become available. This flag is only used in Queue.getItems() for 'pseudo' items that are actually not really in the queue.


isStuck

@Exported
public boolean isStuck()
True if the item is starving for an executor for too long.


getInQueueSince

@Exported
public long getInQueueSince()
Since when is this item in the queue.

Returns:
Unix timestamp

getInQueueForString

public String getInQueueForString()
Returns a human readable presentation of how long this item is already in the queue. E.g. something like '3 minutes 40 seconds'


getFuture

public Future<Queue.Executable> getFuture()
Can be used to wait for the completion (either normal, abnormal, or cancellation) of the Queue.TransientTask.

Just like id, the same object tracks various stages of the queue.


getAssignedLabel

public Label getAssignedLabel()
If this task needs to be run on a node with a particular label, return that Label. Otherwise null, indicating it can run on anywhere.

This code takes LabelAssignmentAction into account, then fall back to SubTask.getAssignedLabel()


getCauses

public final List<Cause> getCauses()
Convenience method that returns a read only view of the Causes associated with this item in the queue.

Returns:
can be empty but never null
Since:
1.343

getWhy

@Exported
public final String getWhy()
Gets a human-readable status message describing why it's in the queue.


getCauseOfBlockage

public abstract CauseOfBlockage getCauseOfBlockage()
Gets an object that describes why this item is in the queue.


getParams

@Exported
public String getParams()
Gets a human-readable message about the parameters of this item

Returns:
String

hasCancelPermission

public boolean hasCancelPermission()

getDisplayName

public String getDisplayName()

getSearchUrl

public String getSearchUrl()
Description copied from interface: SearchItem
Returns the URL of this item relative to the parent SearchItem.

Returns:
URL like "foo" or "foo/bar". The path can end with '/'. The path that starts with '/' will be interpreted as the absolute path (within the context path of Hudson.)

doCancelQueue

@Deprecated
public org.kohsuke.stapler.HttpResponse doCancelQueue()
                                               throws IOException,
                                                      javax.servlet.ServletException
Deprecated. Use Queue.doCancelItem(int) instead.

Throws:
IOException
javax.servlet.ServletException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2013. All Rights Reserved.