hudson.model
Class Job<JobT extends Job<JobT,RunT>,RunT extends Run<JobT,RunT>>

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.AbstractItem
              extended by hudson.model.Job<JobT,RunT>
All Implemented Interfaces:
ExtensionPoint, DescriptorByNameOwner, Item, ModelObject, PersistenceRoot, Saveable, SearchableModelObject, SearchItem, AccessControlled, ICascadingJob, IJob, org.kohsuke.stapler.HttpDeletable, org.kohsuke.stapler.StaplerOverridable
Direct Known Subclasses:
AbstractProject, ViewJob

public abstract class Job<JobT extends Job<JobT,RunT>,RunT extends Run<JobT,RunT>>
extends AbstractItem
implements ExtensionPoint, org.kohsuke.stapler.StaplerOverridable, IJob, ICascadingJob

A job is an runnable entity under the monitoring of Hudson.

Every time it "runs", it will be recorded as a Run object.

To create a custom job type, extend TopLevelItemDescriptor and put Extension on it.

Author:
Kohsuke Kawaguchi, Nikita Levyankov

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
static String LOG_ROTATOR_PROPERTY_NAME
           
static String PARAMETERS_DEFINITION_JOB_PROPERTY_PROPERTY_NAME
           
static String PROPERTY_NAME_SEPARATOR
           
 
Fields inherited from interface hudson.model.Item
BUILD, CONFIGURE, CREATE, DELETE, EXTENDED_READ, PERMISSIONS, READ, WIPEOUT, WORKSPACE
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Method Summary
 void addCascadingChild(String cascadingChildName)
          Adds cascading child project name and saves configuration.
 void addProperty(JobProperty<? super JobT> jobProp)
          Adds JobProperty.
 int assignBuildNumber()
          Allocates a new buildCommand number.
 void doBuildStatus(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Returns the image that shows the current buildCommand status.
 void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Accepts submission from the configuration page.
 void doDescription(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Accepts and serves the job description
 void doDoRename(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Renames this job.
 void doModifyCascadingProperty(String propertyName)
           
 void doResetProjectProperty(String propertyName)
          Resets overridden properties to the values defined in parent.
 void doRssAll(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 void doRssFailed(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 void doUpdateCascadingProject(String projectName)
           
 ACL getACL()
          Returns the ACL for this object.
 Collection<? extends Job> getAllJobs()
          Gets all the jobs that this Item contains as descendants.
 List<JobProperty<? super JobT>> getAllProperties()
          List of all JobProperty exposed primarily for the remoting API.
 RunT getBuild(String id)
          Deprecated. since 2008-06-15. This is only used to support backward compatibility with old URLs.
 RunT getBuildByNumber(int n)
           
 RunT getBuildForCLI(String id)
           
 HealthReport getBuildHealth()
          Get the current health report for a job.
 List<HealthReport> getBuildHealthReports()
           
 RunList<RunT> getBuilds()
          Gets the read-only view of all the builds.
 List<RunT> getBuilds(Fingerprint.RangeSet rs)
          Obtains all the Runs whose build numbers matches the given Fingerprint.RangeSet.
 SortedMap<Integer,RunT> getBuildsAsMap()
          Gets all the builds in a map.
 RunList<RunT> getBuildsByTimestamp(long start, long end)
          Deprecated. as of 1.372. Should just do getBuilds().byTimestamp(s,e) to avoid code bloat in Job.
 String getBuildStatusUrl()
           
 Graph getBuildTimeGraph()
           
 Set<String> getCascadingChildrenNames()
          
 JobT getCascadingProject()
          Returns selected ccascading project.
 String getCascadingProjectName()
          Returns cascading project name.
 String getCreatedBy()
          Returns the author of the job.
 long getCreationTime()
          Returns time when the project was created.
 Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 long getEstimatedDuration()
           
 RunT getFirstBuild()
          Returns the oldest build in the record.
 BallColor getIconColor()
          Used as the color of the status ball for the project.
 RunT getLastBuild()
          Returns the last build.
 List<RunT> getLastBuildsOverThreshold(int numberOfBuilds, Result threshold)
          Returns the last 'numberOfBuilds' builds with a build result >= 'threshold'
 RunT getLastCompletedBuild()
          Returns the last completed build, if any.
 RunT getLastFailedBuild()
          Returns the last failed build, if any.
 RunT getLastStableBuild()
          Returns the last stable build, if any.
 RunT getLastSuccessfulBuild()
          Returns the last successful build, if any.
 RunT getLastUnstableBuild()
          Returns the last unstable build, if any.
 RunT getLastUnsuccessfulBuild()
          Returns the last build that was anything but stable, if any.
 LogRotator getLogRotator()
          Returns the log rotator for this job, or null if none.
 RunT getNearestBuild(int n)
          Gets the youngest build #m that satisfies n<=m.
 RunT getNearestOldBuild(int n)
          Gets the latest build #m that satisfies m<=n.
 int getNextBuildNumber()
          
 Collection<?> getOverrides()
          Overrides from job properties.
 PermalinkList getPermalinks()
          Gets all the PermalinkProjectAction.Permalinks defined for this job.
 Map<String,IProjectProperty> getProjectProperties()
          
 String getPronoun()
          Get the term used in the UI to represent this kind of Item.
 Map<JobPropertyDescriptor,JobProperty<? super JobT>> getProperties()
          Gets all the job properties configured for this job.
<T extends JobProperty>
T
getProperty(Class<T> clazz)
          Gets the specific property, or null if the propert is not configured for this job.
 IProjectProperty getProperty(String key)
          Returns job property by specified key.
 IProjectProperty getProperty(String key, Class clazz)
          Returns job property by specified key.
 Queue.Item getQueueItem()
          
 BuildTimelineWidget getTimeline()
           
 List<Widget> getWidgets()
           
 boolean hasCascadingChild(String cascadingChildName)
          Checks whether job has cascading children with given name
 boolean hasCascadingProject()
          Checks whether current job is inherited from other project.
 void initProjectProperties()
          Initialize project properties if null.
abstract  boolean isBuildable()
          Returns true if we should display "build now" icon
 boolean isBuilding()
          
 boolean isInQueue()
          
 boolean isKeepDependencies()
          
 boolean isNameEditable()
          
 void logRotate()
          Perform log rotation.
 void onCopiedFrom(Item src)
          When a Item is copied from existing one, the files are first copied on the file system, then it will be loaded, then this method will be invoked to perform any implementation-specific work.
 void onLoad(ItemGroup<? extends Item> parent, String name)
          Called right after when a Item is loaded from disk.
 void putProjectProperty(String key, IProjectProperty property)
          Put job property to properties map.
 void removeCascadingChild(String cascadingChildName)
          Remove cascading child project name and saves job configuration
 void removeProjectProperty(String key)
          Removes project property.
<T extends JobProperty>
T
removeProperty(Class<T> clazz)
          Removes the property of the given type.
 void removeProperty(JobProperty<? super JobT> jobProp)
          Removes JobProperty
 void renameCascadingChildName(String oldChildName, String newChildName)
          Remove cascading child project name and saves job configuration
 void renameCascadingProjectNameTo(String cascadingProjectName)
          Renames cascading project name.
 void renameTo(String newName)
          Renames a job.
 void save()
          Save the settings to a file.
 void setAllowSave(Boolean allowSave)
          Set true if save operation for config is permitted, false - otherwise .
 void setCascadingProjectName(String cascadingProjectName)
          Sets cascadingProject name and saves project configuration.
 void setLogRotator(LogRotator logRotator)
          Sets log rotator.
 boolean supportsLogRotator()
          
 void updateNextBuildNumber(int next)
          Programatically updates the next build number.
 
Methods inherited from class hudson.model.AbstractItem
checkPermission, delete, delete, doConfigDotXml, doDoDelete, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDescriptorByName, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRootDir, getSearchUrl, getShortUrl, getUrl, hasPermission, onCreatedFromScratch, resolveForCLI, setDescription, toString
 
Methods inherited from class hudson.model.Actionable
addAction, getAction, getAction, getActions, getActions
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getShortUrl, getUrl, onCreatedFromScratch
 
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
 
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
 
Methods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrl
 
Methods inherited from interface hudson.security.AccessControlled
checkPermission, hasPermission
 

Field Detail

PROPERTY_NAME_SEPARATOR

public static final String PROPERTY_NAME_SEPARATOR
See Also:
Constant Field Values

LOG_ROTATOR_PROPERTY_NAME

public static final String LOG_ROTATOR_PROPERTY_NAME
See Also:
Constant Field Values

PARAMETERS_DEFINITION_JOB_PROPERTY_PROPERTY_NAME

public static final String PARAMETERS_DEFINITION_JOB_PROPERTY_PROPERTY_NAME
See Also:
Constant Field Values
Method Detail

setAllowSave

public void setAllowSave(Boolean allowSave)
Set true if save operation for config is permitted, false - otherwise .

Parameters:
allowSave - allow save.

putProjectProperty

public void putProjectProperty(String key,
                               IProjectProperty property)
Put job property to properties map.

Specified by:
putProjectProperty in interface ICascadingJob
Parameters:
key - key.
property - property instance.

getProjectProperties

public Map<String,IProjectProperty> getProjectProperties()

Specified by:
getProjectProperties in interface ICascadingJob
Returns:
project properties.

removeProjectProperty

public void removeProjectProperty(String key)
Removes project property.

Specified by:
removeProjectProperty in interface ICascadingJob
Parameters:
key - property key.

getProperty

public IProjectProperty getProperty(String key)
Returns job property by specified key.

Specified by:
getProperty in interface ICascadingJob
Parameters:
key - key.
Returns:
IProjectProperty instance or null.

getProperty

public IProjectProperty getProperty(String key,
                                    Class clazz)
Returns job property by specified key.

Specified by:
getProperty in interface ICascadingJob
Parameters:
key - key.
clazz - IProperty subclass.
Returns:
IProjectProperty instance or null.

getCascadingChildrenNames

@Exported
public Set<String> getCascadingChildrenNames()

Specified by:
getCascadingChildrenNames in interface ICascadingJob
Returns:
list of cascading children project names.

addCascadingChild

public void addCascadingChild(String cascadingChildName)
                       throws IOException
Adds cascading child project name and saves configuration.

Specified by:
addCascadingChild in interface ICascadingJob
Parameters:
cascadingChildName - cascading child project name.
Throws:
IOException - if configuration couldn't be saved.

removeCascadingChild

public void removeCascadingChild(String cascadingChildName)
                          throws IOException
Remove cascading child project name and saves job configuration

Specified by:
removeCascadingChild in interface ICascadingJob
Parameters:
cascadingChildName - cascading child project name.
Throws:
IOException - if configuration couldn't be saved.

hasCascadingChild

public boolean hasCascadingChild(String cascadingChildName)
Checks whether job has cascading children with given name

Specified by:
hasCascadingChild in interface ICascadingJob
Parameters:
cascadingChildName - name of child.
Returns:
true if job has child with specified name, false - otherwise.

renameCascadingChildName

public void renameCascadingChildName(String oldChildName,
                                     String newChildName)
                              throws IOException
Remove cascading child project name and saves job configuration

Specified by:
renameCascadingChildName in interface ICascadingJob
Parameters:
oldChildName - old child project name.
newChildName - new child project name.
Throws:
IOException - if configuration couldn't be saved.

save

public void save()
          throws IOException
Description copied from class: AbstractItem
Save the settings to a file.

Specified by:
save in interface Item
Specified by:
save in interface Saveable
Overrides:
save in class AbstractItem
Throws:
IOException - if the persistence failed.

onLoad

public void onLoad(ItemGroup<? extends Item> parent,
                   String name)
            throws IOException
Description copied from class: AbstractItem
Called right after when a Item is loaded from disk. This is an opporunity to do a post load processing.

Specified by:
onLoad in interface Item
Overrides:
onLoad in class AbstractItem
name - Name of the directory (not a path --- just the name portion) from which the configuration was loaded. This usually becomes the name of this item.
Throws:
IOException

doResetProjectProperty

public void doResetProjectProperty(@QueryParameter
                                   String propertyName)
                            throws IOException
Resets overridden properties to the values defined in parent.

Parameters:
propertyName - the name of the properties. It possible to pass several names separated with PROPERTY_NAME_SEPARATOR.
Throws:
IOException - exception.

initProjectProperties

public final void initProjectProperties()
Initialize project properties if null.


onCopiedFrom

public void onCopiedFrom(Item src)
Description copied from class: AbstractItem
When a Item is copied from existing one, the files are first copied on the file system, then it will be loaded, then this method will be invoked to perform any implementation-specific work.

Specified by:
onCopiedFrom in interface Item
Overrides:
onCopiedFrom in class AbstractItem

isInQueue

@Exported
public boolean isInQueue()

Specified by:
isInQueue in interface IJob
Returns:
true if the build is in the queue.

getQueueItem

@Exported
public Queue.Item getQueueItem()

Specified by:
getQueueItem in interface IJob
Returns:
queue item If this job is in the build queue.

isBuilding

public boolean isBuilding()

Specified by:
isBuilding in interface IJob
Returns:
true if a build of this project is in progress.

getPronoun

public String getPronoun()
Description copied from class: AbstractItem
Get the term used in the UI to represent this kind of Item. Must start with a capital letter.

Overrides:
getPronoun in class AbstractItem

isNameEditable

public boolean isNameEditable()

Specified by:
isNameEditable in interface IJob
Returns:
whether the name of this job can be changed by user.

isKeepDependencies

@Exported
public boolean isKeepDependencies()

Specified by:
isKeepDependencies in interface IJob
Returns:
flag, which shows whether all the build logs of dependency components will be kept.

assignBuildNumber

public int assignBuildNumber()
                      throws IOException
Allocates a new buildCommand number.

Specified by:
assignBuildNumber in interface IJob
Returns:
new build number.
Throws:
IOException - if any.

getNextBuildNumber

@Exported
public int getNextBuildNumber()

Specified by:
getNextBuildNumber in interface IJob
Returns:
the next build number.

updateNextBuildNumber

public void updateNextBuildNumber(int next)
                           throws IOException
Programatically updates the next build number.

< p/> Much of Hudson assumes that the build number is unique and monotonic, so this method can only accept a new value that's bigger than IJob.getLastBuild() returns. Otherwise it'll be no-op.

Specified by:
updateNextBuildNumber in interface IJob
Parameters:
next - build number to set.
Throws:
IOException - if any.

getLogRotator

public LogRotator getLogRotator()
Returns the log rotator for this job, or null if none.

Specified by:
getLogRotator in interface IJob
Returns:
LogRotator instance.

setLogRotator

public void setLogRotator(LogRotator logRotator)
Sets log rotator.

Specified by:
setLogRotator in interface IJob
Parameters:
logRotator - log rotator.

logRotate

public void logRotate()
               throws IOException,
                      InterruptedException
Perform log rotation.

Specified by:
logRotate in interface IJob
Throws:
IOException - if any.
InterruptedException - if any.

supportsLogRotator

public boolean supportsLogRotator()

Specified by:
supportsLogRotator in interface IJob
Returns:
true if this instance supports log rotation configuration.

getAllJobs

public Collection<? extends Job> getAllJobs()
Description copied from class: AbstractItem
Gets all the jobs that this Item contains as descendants.

Specified by:
getAllJobs in interface Item
Specified by:
getAllJobs in class AbstractItem

addProperty

public void addProperty(JobProperty<? super JobT> jobProp)
                 throws IOException
Adds JobProperty.

Throws:
IOException
Since:
1.188

removeProperty

public void removeProperty(JobProperty<? super JobT> jobProp)
                    throws IOException
Removes JobProperty

Throws:
IOException
Since:
1.279

removeProperty

public <T extends JobProperty> T removeProperty(Class<T> clazz)
                                     throws IOException
Removes the property of the given type.

Returns:
The property that was just removed.
Throws:
IOException
Since:
1.279

getProperties

public Map<JobPropertyDescriptor,JobProperty<? super JobT>> getProperties()
Gets all the job properties configured for this job.

Specified by:
getProperties in interface IJob
Returns:
Map of properties.

getAllProperties

@Exported(name="property",
          inline=true)
public List<JobProperty<? super JobT>> getAllProperties()
List of all JobProperty exposed primarily for the remoting API. List contains cascadable JobProperty if any.

Specified by:
getAllProperties in interface IJob
Returns:
List of all JobProperty.
Since:
2.2.0

getProperty

public <T extends JobProperty> T getProperty(Class<T> clazz)
Gets the specific property, or null if the propert is not configured for this job. Supports cascading properties

Since:
2.2.0

getOverrides

public Collection<?> getOverrides()
Overrides from job properties.

Specified by:
getOverrides in interface org.kohsuke.stapler.StaplerOverridable

getWidgets

public List<Widget> getWidgets()
Specified by:
getWidgets in interface IJob
Returns:
HistoryWidget

renameTo

public void renameTo(String newName)
              throws IOException
Renames a job.

Throws:
IOException

isBuildable

@Exported
public abstract boolean isBuildable()
Returns true if we should display "build now" icon

Specified by:
isBuildable in interface IJob
Returns:
true if we should display "build now" icon

getBuilds

@Exported
public RunList<RunT> getBuilds()
Gets the read-only view of all the builds.

Specified by:
getBuilds in interface IJob
Returns:
never null. The first entry is the latest build.

getBuilds

public List<RunT> getBuilds(Fingerprint.RangeSet rs)
Obtains all the Runs whose build numbers matches the given Fingerprint.RangeSet.

Specified by:
getBuilds in interface IJob
Parameters:
rs - target rangeSet.
Returns:
all the Runs whose build numbers matches the given Fingerprint.RangeSet.

getBuildsAsMap

public SortedMap<Integer,RunT> getBuildsAsMap()
Gets all the builds in a map.

Specified by:
getBuildsAsMap in interface IJob
Returns:
all the builds in a map.

getBuild

@Deprecated
public RunT getBuild(String id)
Deprecated. since 2008-06-15. This is only used to support backward compatibility with old URLs.


getBuildByNumber

public RunT getBuildByNumber(int n)
Specified by:
getBuildByNumber in interface IJob
Parameters:
n - The build number.
Returns:
null if no such build exists.
See Also:
Run.getNumber()

getBuildsByTimestamp

public RunList<RunT> getBuildsByTimestamp(long start,
                                          long end)
Deprecated. as of 1.372. Should just do getBuilds().byTimestamp(s,e) to avoid code bloat in Job.

Obtains a list of builds, in the descending order, that are within the specified time range [start,end).

Returns:
can be empty but never null.

getBuildForCLI

@CLIResolver
public RunT getBuildForCLI(String id)
                                           throws org.kohsuke.args4j.CmdLineException
Throws:
org.kohsuke.args4j.CmdLineException

getNearestBuild

public final RunT getNearestBuild(int n)
Gets the youngest build #m that satisfies n<=m. This is useful when you'd like to fetch a build but the exact build might be already gone (deleted, rotated, etc.)

Specified by:
getNearestBuild in interface IJob
Parameters:
n - build to compare with.
Returns:
youngest build.

getNearestOldBuild

public final RunT getNearestOldBuild(int n)
Gets the latest build #m that satisfies m<=n. This is useful when you'd like to fetch a build but the exact build might be already gone (deleted, rotated, etc.)

Specified by:
getNearestOldBuild in interface IJob
Parameters:
n - build to compare with.
Returns:
the oldest build.

getDynamic

public Object getDynamic(String token,
                         org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp)
Overrides:
getDynamic in class Actionable

getLastBuild

@Exported
public RunT getLastBuild()
Returns the last build.

Specified by:
getLastBuild in interface IJob
Returns:
the last build

getFirstBuild

@Exported
public RunT getFirstBuild()
Returns the oldest build in the record.

Specified by:
getFirstBuild in interface IJob
Returns:
the oldest build in the record.

getLastSuccessfulBuild

@Exported
public RunT getLastSuccessfulBuild()
Returns the last successful build, if any. Otherwise null. A successful build would include either Result.SUCCESS or Result.UNSTABLE.

Specified by:
getLastSuccessfulBuild in interface IJob
Returns:
the last successful build, if any. Otherwise null. A successful build would include either Result.SUCCESS or Result.UNSTABLE.
See Also:
getLastStableBuild()

getLastUnsuccessfulBuild

@Exported
public RunT getLastUnsuccessfulBuild()
Returns the last build that was anything but stable, if any. Otherwise null.

Specified by:
getLastUnsuccessfulBuild in interface IJob
Returns:
the last build that was anything but stable, if any. Otherwise null.
See Also:
getLastSuccessfulBuild()

getLastUnstableBuild

@Exported
public RunT getLastUnstableBuild()
Returns the last unstable build, if any. Otherwise null.

Specified by:
getLastUnstableBuild in interface IJob
Returns:
the last unstable build, if any. Otherwise null.
See Also:
getLastSuccessfulBuild()

getLastStableBuild

@Exported
public RunT getLastStableBuild()
Returns the last stable build, if any. Otherwise null.

Specified by:
getLastStableBuild in interface IJob
Returns:
the last stable build, if any. Otherwise null.
See Also:
getLastSuccessfulBuild()

getLastFailedBuild

@Exported
public RunT getLastFailedBuild()
Returns the last failed build, if any. Otherwise null.

Specified by:
getLastFailedBuild in interface IJob
Returns:
the last failed build, if any. Otherwise null.

getLastCompletedBuild

@Exported
public RunT getLastCompletedBuild()
Returns the last completed build, if any. Otherwise null.

Specified by:
getLastCompletedBuild in interface IJob
Returns:
the last completed build, if any. Otherwise null.

getLastBuildsOverThreshold

public List<RunT> getLastBuildsOverThreshold(int numberOfBuilds,
                                             Result threshold)
Returns the last 'numberOfBuilds' builds with a build result >= 'threshold'

Specified by:
getLastBuildsOverThreshold in interface IJob
Parameters:
numberOfBuilds - build count to return.
threshold - required Result of the build.
Returns:
a list with the builds. May be smaller than 'numberOfBuilds' or even empty if not enough builds satisfying the threshold have been found. Never null.

getEstimatedDuration

public final long getEstimatedDuration()

getPermalinks

public PermalinkList getPermalinks()
Gets all the PermalinkProjectAction.Permalinks defined for this job.

Specified by:
getPermalinks in interface IJob
Returns:
never null

getIconColor

@Exported(visibility=2,
          name="color")
public BallColor getIconColor()
Used as the color of the status ball for the project.

Specified by:
getIconColor in interface IJob
Returns:
the color of the status ball for the project.

getBuildHealth

public HealthReport getBuildHealth()
Get the current health report for a job.

Specified by:
getBuildHealth in interface IJob
Returns:
the health report. Never returns null

getBuildHealthReports

@Exported(name="healthReport")
public List<HealthReport> getBuildHealthReports()
Specified by:
getBuildHealthReports in interface IJob
Returns:
list of HealthReport

doConfigSubmit

public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
                           org.kohsuke.stapler.StaplerResponse rsp)
                    throws IOException,
                           javax.servlet.ServletException,
                           Descriptor.FormException
Accepts submission from the configuration page.

Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException

doDescription

public void doDescription(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
                   throws IOException
Accepts and serves the job description

Throws:
IOException

doBuildStatus

public void doBuildStatus(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
                   throws IOException
Returns the image that shows the current buildCommand status.

Throws:
IOException

getBuildStatusUrl

public String getBuildStatusUrl()
Specified by:
getBuildStatusUrl in interface IJob
Returns:
build status image link. Info is taken from BallColor.getImage().
See Also:
IJob.getIconColor(), BallColor.getImage()

doDoRename

public void doDoRename(org.kohsuke.stapler.StaplerRequest req,
                       org.kohsuke.stapler.StaplerResponse rsp)
                throws IOException,
                       javax.servlet.ServletException
Renames this job.

Throws:
IOException
javax.servlet.ServletException

doRssAll

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

doRssFailed

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

getACL

public ACL getACL()
Returns the ACL for this object. We need to override the identical method in AbstractItem because we won't call getACL(Job) otherwise (single dispatch)

Specified by:
getACL in interface AccessControlled
Overrides:
getACL in class AbstractItem
Returns:
never null.

getTimeline

public BuildTimelineWidget getTimeline()
Specified by:
getTimeline in interface IJob
Returns:
BuildTimelineWidget based on build history

getCreatedBy

public String getCreatedBy()
Returns the author of the job.

Specified by:
getCreatedBy in interface IJob
Returns:
the author of the job.
Since:
2.0.1

getCreationTime

public long getCreationTime()
Returns time when the project was created.

Specified by:
getCreationTime in interface IJob
Returns:
time when the project was created.
Since:
2.0.1

getCascadingProjectName

public String getCascadingProjectName()
Returns cascading project name.

Specified by:
getCascadingProjectName in interface ICascadingJob
Returns:
cascading project name.

doUpdateCascadingProject

public void doUpdateCascadingProject(@QueryParameter(fixEmpty=true)
                                     String projectName)
                              throws IOException
Throws:
IOException

doModifyCascadingProperty

public void doModifyCascadingProperty(@QueryParameter(fixEmpty=true)
                                      String propertyName)

setCascadingProjectName

public void setCascadingProjectName(String cascadingProjectName)
                             throws IOException
Sets cascadingProject name and saves project configuration.

Specified by:
setCascadingProjectName in interface ICascadingJob
Parameters:
cascadingProjectName - cascadingProject name.
Throws:
IOException - if configuration couldn't be saved.

renameCascadingProjectNameTo

public void renameCascadingProjectNameTo(String cascadingProjectName)
Renames cascading project name. For the properties processing and children links updating please use setCascadingProjectName(java.lang.String) instead.

Specified by:
renameCascadingProjectNameTo in interface ICascadingJob
Parameters:
cascadingProjectName - new project name.

getCascadingProject

public JobT getCascadingProject()
Returns selected ccascading project.

Specified by:
getCascadingProject in interface ICascadingJob
Returns:
cascading project.

hasCascadingProject

public boolean hasCascadingProject()
Checks whether current job is inherited from other project.

Specified by:
hasCascadingProject in interface ICascadingJob
Returns:
boolean.

getBuildTimeGraph

public Graph getBuildTimeGraph()
Specified by:
getBuildTimeGraph in interface IJob
Returns:
Graph of builds


Copyright © 2004-2013 Hudson. All Rights Reserved.