Package hudson.plugins.batch_task
Class BatchRun
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.plugins.batch_task.BatchRun
-
- All Implemented Interfaces:
ModelObject
,Queue.Executable
,SearchableModelObject
,SearchItem
,Comparable<BatchRun>
,Runnable
,ModelObjectWithContextMenu
public final class BatchRun extends Actionable implements Queue.Executable, Comparable<BatchRun>
Record ofBatchTask
execution.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
Field Summary
Fields Modifier and Type Field Description protected long
duration
Number of milli-seconds it took to run this build.int
id
Unique number that identifie this record amongBatchRunAction
.protected BatchRunAction
parent
protected Result
result
Build result.String
taskName
Pointer that connects us back toBatchTask
Calendar
timestamp
-
Constructor Summary
Constructors Modifier Constructor Description protected
BatchRun(Calendar timestamp, BatchRunAction parent, int id, BatchTask task)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(BatchRun that)
Newer records should appear before older records.void
doProgressiveLog(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Handles incremental log output.boolean
equals(Object o)
String
getBuildNumber()
String
getBuildStatusIconClassName()
String
getBuildStatusUrl()
String
getDisplayName()
long
getDuration()
Gets the millisecond it took to build.String
getDurationString()
Gets the string that says how long the build took to run.long
getEstimatedDuration()
BallColor
getIconColor()
Gets the icon color for display.File
getLogFile()
Gets the log file that stores the execution result.BatchRun
getNext()
Obtains the next execution record, or null if no such record is available.String
getNumber()
BatchRunAction
getOwner()
BatchTask
getParent()
BatchRun
getPrevious()
Obtains the previous execution record, or null if no such record is available.Result
getResult()
String
getSearchUrl()
String
getTimestampString()
Gets the string that says how long since this run has started.String
getUrl()
Gets the URL (under the context root) that points to this record.int
hashCode()
boolean
isRunning()
Is this task still running?void
run()
String
toString()
-
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
-
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, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface hudson.model.Queue.Executable
getParentExecutable
-
-
-
-
Field Detail
-
result
protected Result result
Build result. If null, we are still building.
-
timestamp
public final Calendar timestamp
-
parent
protected transient BatchRunAction parent
-
id
public final int id
Unique number that identifie this record amongBatchRunAction
.
-
taskName
public final String taskName
Pointer that connects us back toBatchTask
- See Also:
getParent()
-
duration
protected long duration
Number of milli-seconds it took to run this build.
-
-
Constructor Detail
-
BatchRun
protected BatchRun(Calendar timestamp, BatchRunAction parent, int id, BatchTask task)
-
-
Method Detail
-
getResult
public Result getResult()
-
isRunning
public boolean isRunning()
Is this task still running?
-
getTimestampString
public String getTimestampString()
Gets the string that says how long since this run has started.- Returns:
- string like "3 minutes" "1 day" etc.
-
getLogFile
public File getLogFile()
Gets the log file that stores the execution result.
-
getParent
@NonNull public BatchTask getParent()
- Specified by:
getParent
in interfaceQueue.Executable
-
getOwner
public BatchRunAction getOwner()
-
getIconColor
public BallColor getIconColor()
Gets the icon color for display.
-
getBuildStatusIconClassName
public String getBuildStatusIconClassName()
-
getBuildStatusUrl
public String getBuildStatusUrl()
-
getPrevious
public BatchRun getPrevious()
Obtains the previous execution record, or null if no such record is available.
-
getNext
public BatchRun getNext()
Obtains the next execution record, or null if no such record is available.
-
getUrl
public String getUrl()
Gets the URL (under the context root) that points to this record.- Returns:
- URL like "job/foo/53/batchTasks/0"
-
getSearchUrl
public String getSearchUrl()
- Specified by:
getSearchUrl
in interfaceSearchItem
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
-
getNumber
public String getNumber()
-
getBuildNumber
public String getBuildNumber()
-
getDurationString
public String getDurationString()
Gets the string that says how long the build took to run.
-
getDuration
@Exported public long getDuration()
Gets the millisecond it took to build.
-
run
public void run()
- Specified by:
run
in interfaceQueue.Executable
- Specified by:
run
in interfaceRunnable
-
doProgressiveLog
public void doProgressiveLog(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
Handles incremental log output.- Throws:
IOException
-
toString
public String toString()
- Specified by:
toString
in interfaceQueue.Executable
- Overrides:
toString
in classObject
-
compareTo
public int compareTo(BatchRun that)
Newer records should appear before older records.- Specified by:
compareTo
in interfaceComparable<BatchRun>
-
getEstimatedDuration
public long getEstimatedDuration()
- Specified by:
getEstimatedDuration
in interfaceQueue.Executable
-
-