Package hudson.model

Class Queue.Item

    • Field Detail

      • task

        public final Queue.Task task
        Project to be built.
    • Method Detail

      • getId

        public 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 Queue.Item and into any subsequent Run instance (see Run.getQueueId()).
      • getIdLegacy

        public int getIdLegacy()
      • isBlocked

        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

        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

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

        public long getInQueueSince()
        Since when is this item in the queue.
        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'
      • 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()

      • getAssignedLabelFor

        public Label getAssignedLabelFor​(@NonNull
                                         SubTask st)
        Test if the specified 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()

        st - SubTask to be checked.
        Required Label. Otherwise null, indicating it can run on anywhere.
      • getCauses

        public final List<Cause> getCauses()
        Convenience method that returns a read only view of the Causes associated with this item in the queue.
        can be empty but never null
      • getCausesDescription

        public String getCausesDescription()
      • getUrl

        public String getUrl()
        Returns the URL of this Queue.Item relative to the context path of Jenkins
        URL that ends with '/'.
      • getWhy

        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

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

        public boolean hasCancelPermission()
        Checks whether a scheduled item may be canceled.
        by default, the same as Queue.Task.hasAbortPermission()
      • getDisplayName

        public String getDisplayName()
      • getSearchUrl

        public String getSearchUrl()
        Description copied from interface: SearchItem
        Returns the URL of this item relative to the parent SearchItem.
        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 Jenkins.)
      • authenticate2

        public authenticate2()
        Returns the identity that this task carries when it runs, for the purpose of access control. When the task execution touches other objects inside Jenkins, the access control is performed based on whether this Authentication is allowed to use them. Implementers, if you are unsure, return the identity of the user who queued the task, or ACL.SYSTEM2 to bypass the access control and run as the super user.
      • getApi

        public Api getApi()
      • readResolve

        protected Object readResolve()