java.lang.Object
org.jenkinsci.plugins.jqsmonitoring.buildqueue.QueueJob
All Implemented Interfaces:
Comparable<QueueJob>

@ExportedBean public class QueueJob extends Object implements Comparable<QueueJob>
Stores attributes and functions of a queue job. Implements the interface Comparable for sorting the jobs currently waiting in the queue according to their wait time.
Author:
yboev
  • Constructor Details

    • QueueJob

      public QueueJob(Queue.BuildableItem item, long currentTime)
      Constructor.
      Parameters:
      item - the job(item) waiting in the queue
      currentTime - the current time on which all items have been retrieved
  • Method Details

    • getApi

      public Api getApi()
      REST API
      Returns:
      the api.
    • getStatus

      @Exported public String getStatus()
      Returns the status of this queue job. Options: "ok", "blocked", "stuck"
      Returns:
      the status
    • getName

      @Exported public String getName()
      Returns ID of the waiting job.
      Returns:
      the ID
    • getTime

      @Exported public String getTime()
      Color Returns the time which a job has spend in the queue waiting as a formate String.
      Returns:
      the formated String
    • getCauseOfBlockage

      @Exported public String getCauseOfBlockage()
      Returns why the job is waiting in the queue.
    • getColor

      @Exported public String getColor()
      Color to be used for this job.
      Returns:
      the color as String
    • compareTo

      public int compareTo(QueueJob qj)
      Implementation of the comparing method.
      Specified by:
      compareTo in interface Comparable<QueueJob>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getIcon

      @Exported public String getIcon()
      Returns the icon for this queue job.
      Returns:
      address of the icon
    • getUrl

      @Exported public String getUrl()
      Returns the url for this queue job.
      Returns:
      the url as string.