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 ofBatchTaskexecution.- 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 longdurationNumber of milli-seconds it took to run this build.intidUnique number that identifie this record amongBatchRunAction.protected BatchRunActionparentprotected ResultresultBuild result.StringtaskNamePointer that connects us back toBatchTaskCalendartimestamp
-
Constructor Summary
Constructors Modifier Constructor Description protectedBatchRun(Calendar timestamp, BatchRunAction parent, int id, BatchTask task)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(BatchRun that)Newer records should appear before older records.voiddoProgressiveLog(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Handles incremental log output.booleanequals(Object o)StringgetBuildNumber()StringgetBuildStatusIconClassName()StringgetBuildStatusUrl()StringgetDisplayName()longgetDuration()Gets the millisecond it took to build.StringgetDurationString()Gets the string that says how long the build took to run.longgetEstimatedDuration()BallColorgetIconColor()Gets the icon color for display.FilegetLogFile()Gets the log file that stores the execution result.BatchRungetNext()Obtains the next execution record, or null if no such record is available.StringgetNumber()BatchRunActiongetOwner()BatchTaskgetParent()BatchRungetPrevious()Obtains the previous execution record, or null if no such record is available.ResultgetResult()StringgetSearchUrl()StringgetTimestampString()Gets the string that says how long since this run has started.StringgetUrl()Gets the URL (under the context root) that points to this record.inthashCode()booleanisRunning()Is this task still running?voidrun()StringtoString()-
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:
getParentin 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:
getSearchUrlin interfaceSearchItem
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayNamein 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:
runin interfaceQueue.Executable- Specified by:
runin interfaceRunnable
-
doProgressiveLog
public void doProgressiveLog(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOExceptionHandles incremental log output.- Throws:
IOException
-
toString
public String toString()
- Specified by:
toStringin interfaceQueue.Executable- Overrides:
toStringin classObject
-
compareTo
public int compareTo(BatchRun that)
Newer records should appear before older records.- Specified by:
compareToin interfaceComparable<BatchRun>
-
getEstimatedDuration
public long getEstimatedDuration()
- Specified by:
getEstimatedDurationin interfaceQueue.Executable
-
-