hudson.plugins.batch_task
Class BatchRun

java.lang.Object
  extended by hudson.plugins.batch_task.BatchRun
All Implemented Interfaces:
hudson.model.ModelObject, hudson.model.Queue.Executable, java.lang.Comparable<BatchRun>, java.lang.Runnable

public final class BatchRun
extends java.lang.Object
implements hudson.model.Queue.Executable, hudson.model.ModelObject, java.lang.Comparable<BatchRun>

Record of BatchTask execution.

Author:
Kohsuke Kawaguchi

Field Summary
protected  long duration
          Number of milli-seconds it took to run this build.
 int id
          Unique number that identifie this record among BatchRunAction.
protected  BatchRunAction parent
           
protected  hudson.model.Result result
          Build result.
 java.lang.String taskName
          Pointer that connects us back to BatchTask
 java.util.Calendar timestamp
           
 
Constructor Summary
protected BatchRun(java.util.Calendar timestamp, BatchRunAction parent, int id, BatchTask task)
           
 
Method Summary
 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.
 java.lang.String getBuildNumber()
           
 java.lang.String getBuildStatusUrl()
           
 java.lang.String getDisplayName()
           
 long getDuration()
          Gets the millisecond it took to build.
 java.lang.String getDurationString()
          Gets the string that says how long the build took to run.
 hudson.model.BallColor getIconColor()
          Gets the icon color for display.
 java.io.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.
 java.lang.String getNumber()
           
 BatchRunAction getOwner()
           
 BatchTask getParent()
           
 BatchRun getPrevious()
          Obtains the previous execution record, or null if no such record is available.
 hudson.model.Result getResult()
           
 java.lang.String getTimestampString()
          Gets the string that says how long since this run has started.
 java.lang.String getUrl()
          Gets the URL (under the context root) that points to this record.
 boolean isRunning()
          Is this task still running?
 void run()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

result

protected hudson.model.Result result
Build result. If null, we are still building.


timestamp

public final java.util.Calendar timestamp

parent

protected transient BatchRunAction parent

id

public final int id
Unique number that identifie this record among BatchRunAction.


taskName

public final java.lang.String taskName
Pointer that connects us back to BatchTask

See Also:
getParent()

duration

protected long duration
Number of milli-seconds it took to run this build.

Constructor Detail

BatchRun

protected BatchRun(java.util.Calendar timestamp,
                   BatchRunAction parent,
                   int id,
                   BatchTask task)
Method Detail

getResult

public hudson.model.Result getResult()

isRunning

public boolean isRunning()
Is this task still running?


getTimestampString

public java.lang.String getTimestampString()
Gets the string that says how long since this run has started.

Returns:
string like "3 minutes" "1 day" etc.

getLogFile

public java.io.File getLogFile()
Gets the log file that stores the execution result.


getParent

public BatchTask getParent()
Specified by:
getParent in interface hudson.model.Queue.Executable

getOwner

public BatchRunAction getOwner()

getIconColor

public hudson.model.BallColor getIconColor()
Gets the icon color for display.


getBuildStatusUrl

public java.lang.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 java.lang.String getUrl()
Gets the URL (under the context root) that points to this record.

Returns:
URL like "job/foo/53/batchTasks/0"

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.ModelObject

getNumber

public java.lang.String getNumber()

getBuildNumber

public java.lang.String getBuildNumber()

getDurationString

public java.lang.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 interface hudson.model.Queue.Executable
Specified by:
run in interface java.lang.Runnable

doProgressiveLog

public void doProgressiveLog(org.kohsuke.stapler.StaplerRequest req,
                             org.kohsuke.stapler.StaplerResponse rsp)
                      throws java.io.IOException
Handles incremental log output.

Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(BatchRun that)
Newer records should appear before older records.

Specified by:
compareTo in interface java.lang.Comparable<BatchRun>


Copyright © 2008. All Rights Reserved.