Class QueueJob
- 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 Summary
Constructors Constructor Description QueueJob(Queue.BuildableItem item, long currentTime)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(QueueJob qj)
Implementation of the comparing method.Api
getApi()
REST APIString
getCauseOfBlockage()
Returns why the job is waiting in the queue.String
getColor()
Color to be used for this job.String
getIcon()
Returns the icon for this queue job.String
getName()
Returns ID of the waiting job.String
getStatus()
Returns the status of this queue job.String
getTime()
Color Returns the time which a job has spend in the queue waiting as a formate String.String
getUrl()
Returns the url for this queue job.
-
-
-
Constructor Detail
-
QueueJob
public QueueJob(Queue.BuildableItem item, long currentTime)
Constructor.- Parameters:
item
- the job(item) waiting in the queuecurrentTime
- the current time on which all items have been retrieved
-
-
Method Detail
-
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 interfaceComparable<QueueJob>
-
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.
-
-