org.jenkinsci.plugins.jqsmonitoring.buildqueue
Class QueueJob

java.lang.Object
  extended by 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
QueueJob(hudson.model.Queue.BuildableItem item, long currentTime)
          Constructor.
 
Method Summary
 int compareTo(QueueJob qj)
          Implementation of the comparing method.
 hudson.model.Api getApi()
          REST API
 String 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueJob

public QueueJob(hudson.model.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 Detail

getApi

public hudson.model.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.

Returns:

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>

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.


Copyright © 2004-2013. All Rights Reserved.