hudson.plugins.batch_task
Class BatchTask

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.plugins.batch_task.BatchTask
All Implemented Interfaces:
hudson.model.ModelObject, hudson.model.Queue.Task, hudson.model.ResourceActivity, hudson.search.SearchableModelObject, hudson.search.SearchItem

public final class BatchTask
extends hudson.model.AbstractModelObject
implements hudson.model.Queue.Task

A batch task.

Author:
Kohsuke Kawaguchi

Field Summary
 java.lang.String name
          Name of this task.
 java.lang.String script
          Shell script to be executed.
 
Constructor Summary
BatchTask(java.lang.String name, java.lang.String script)
           
 
Method Summary
 void checkAbortPermission()
           
 hudson.model.Queue.Executable createExecutable()
           
 hudson.widgets.HistoryWidget createHistoryWidget()
           
 void doCancelQueue(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 void doDoDelete(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Deletes this task.
 void doExecute(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Schedules the execution
 hudson.security.ACL getACL()
          Returns the ACL for this object.
 hudson.model.Label getAssignedLabel()
           
 java.lang.String getBuildStatusUrl()
           
 java.lang.String getDisplayName()
           
 java.lang.Object getDynamic(java.lang.String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 long getEstimatedDuration()
           
 java.lang.String getFullDisplayName()
           
 hudson.model.BallColor getIconColor()
           
 hudson.model.Node getLastBuiltOn()
           
 BatchRun getLastFailedRun()
           
 BatchRun getLastRun()
          Obtains the latest BatchRun record.
 BatchRun getLastSuccessfulRun()
           
 java.lang.String getName()
           
 java.lang.String getNextBuildNumber()
          Gets the expected build number assigned to the next run.
 BatchTaskProperty getParent()
           
 hudson.model.ResourceList getResourceList()
          BatchTask requires exclusive access to the workspace.
 java.lang.Iterable<BatchRun> getRuns()
          Gets all the run records.
 java.lang.String getSearchUrl()
           
 java.lang.String getUrl()
           
 java.lang.String getWhyBlocked()
           
 boolean hasAbortPermission()
           
 boolean hasBuildPermission()
           
 boolean hasConfigurePermission()
           
 boolean hasDeletePermission()
           
 boolean isBuildBlocked()
           
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final java.lang.String name
Name of this task. Used for display.


script

public final java.lang.String script
Shell script to be executed.

Constructor Detail

BatchTask

@DataBoundConstructor
public BatchTask(java.lang.String name,
                                      java.lang.String script)
Method Detail

getParent

public BatchTaskProperty getParent()

getSearchUrl

public java.lang.String getSearchUrl()
Specified by:
getSearchUrl in interface hudson.search.SearchItem

getDisplayName

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

getFullDisplayName

public java.lang.String getFullDisplayName()
Specified by:
getFullDisplayName in interface hudson.model.Queue.Task

isBuildBlocked

public boolean isBuildBlocked()
Specified by:
isBuildBlocked in interface hudson.model.Queue.Task

getWhyBlocked

public java.lang.String getWhyBlocked()
Specified by:
getWhyBlocked in interface hudson.model.Queue.Task

getName

public java.lang.String getName()
Specified by:
getName in interface hudson.model.Queue.Task

getEstimatedDuration

public long getEstimatedDuration()
Specified by:
getEstimatedDuration in interface hudson.model.Queue.Task

getAssignedLabel

public hudson.model.Label getAssignedLabel()
Specified by:
getAssignedLabel in interface hudson.model.Queue.Task

getLastBuiltOn

public hudson.model.Node getLastBuiltOn()
Specified by:
getLastBuiltOn in interface hudson.model.Queue.Task

getBuildStatusUrl

public java.lang.String getBuildStatusUrl()

getIconColor

public hudson.model.BallColor getIconColor()

getLastRun

public BatchRun getLastRun()
Obtains the latest BatchRun record.


getLastSuccessfulRun

public BatchRun getLastSuccessfulRun()

getLastFailedRun

public BatchRun getLastFailedRun()

getRuns

public java.lang.Iterable<BatchRun> getRuns()
Gets all the run records.


createHistoryWidget

public hudson.widgets.HistoryWidget createHistoryWidget()

createExecutable

public hudson.model.Queue.Executable createExecutable()
                                               throws java.io.IOException
Specified by:
createExecutable in interface hudson.model.Queue.Task
Throws:
java.io.IOException

getNextBuildNumber

public java.lang.String getNextBuildNumber()
Gets the expected build number assigned to the next run.

Returns:
string like "5-3"

getACL

public hudson.security.ACL getACL()
Returns the ACL for this object.


checkAbortPermission

public void checkAbortPermission()
Specified by:
checkAbortPermission in interface hudson.model.Queue.Task

hasAbortPermission

public boolean hasAbortPermission()
Specified by:
hasAbortPermission in interface hudson.model.Queue.Task

hasBuildPermission

public boolean hasBuildPermission()

hasDeletePermission

public boolean hasDeletePermission()

hasConfigurePermission

public boolean hasConfigurePermission()

getResourceList

public hudson.model.ResourceList getResourceList()
BatchTask requires exclusive access to the workspace.

Specified by:
getResourceList in interface hudson.model.ResourceActivity

getDynamic

public java.lang.Object getDynamic(java.lang.String token,
                                   org.kohsuke.stapler.StaplerRequest req,
                                   org.kohsuke.stapler.StaplerResponse rsp)

doExecute

public void doExecute(org.kohsuke.stapler.StaplerRequest req,
                      org.kohsuke.stapler.StaplerResponse rsp)
               throws java.io.IOException,
                      javax.servlet.ServletException
Schedules the execution

Throws:
java.io.IOException
javax.servlet.ServletException

doDoDelete

public void doDoDelete(org.kohsuke.stapler.StaplerRequest req,
                       org.kohsuke.stapler.StaplerResponse rsp)
                throws java.io.IOException,
                       javax.servlet.ServletException
Deletes this task.

Throws:
java.io.IOException
javax.servlet.ServletException

doCancelQueue

public void doCancelQueue(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
                   throws java.io.IOException,
                          javax.servlet.ServletException
Throws:
java.io.IOException
javax.servlet.ServletException

getUrl

public java.lang.String getUrl()
Specified by:
getUrl in interface hudson.model.Queue.Task


Copyright © 2009. All Rights Reserved.