Class Job<JobT extends Job<JobT,RunT>,RunT extends Run<JobT,RunT>>
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.AbstractItem
-
- hudson.model.Job<JobT,RunT>
-
- All Implemented Interfaces:
ExtensionPoint,DescriptorByNameOwner,Item,ModelObject,PersistenceRoot,Saveable,SearchableModelObject,SearchItem,AccessControlled,Loadable,ModelObjectWithChildren,ModelObjectWithContextMenu,OnMaster,HasWidgets,org.kohsuke.stapler.HttpDeletable,org.kohsuke.stapler.StaplerOverridable,org.kohsuke.stapler.StaplerProxy
- 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, ModelObjectWithChildren, HasWidgets
A job is an runnable entity under the monitoring of Hudson.Every time it "runs", it will be recorded as a
Runobject.To create a custom job type, extend
TopLevelItemDescriptorand putExtensionon it.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJob.LastItemListenerstatic classJob.SubItemBuildsLocationImpl-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
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 static HistoryWidget.Adapter<Run>HISTORY_ADAPTERprotected intnextBuildNumberNext build number.protected CopyOnWriteList<JobProperty<? super JobT>>propertiesList of properties configured for this project.RunIdMigratorrunIdMigrator-
Fields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract SortedMap<Integer,? extends RunT>_getRuns()Gets all the runs.voidaddProperty(JobProperty<? super JobT> jobProp)AddsJobProperty.intassignBuildNumber()Allocates a new buildCommand number.protected voidcheckRename(String newName)Allows subclasses to block renames for domain-specific reasons.protected HistoryWidgetcreateHistoryWidget()Deprecated, for removal: This API element is subject to removal in a future version.voiddelete()Deletes this item.voiddoBuildStatus(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Returns the image that shows the current buildCommand status.ModelObjectWithContextMenu.ContextMenudoChildrenContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)Generates the context menu to list up all the children.voiddoConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Accepts submission from the configuration page.voiddoDescription(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Accepts and serves the job descriptionvoiddoDoRename(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Deprecated.Exists for backwards compatibility, useAbstractItem.doConfirmRename(java.lang.String)instead.voiddoRssAll(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)voiddoRssChangelog(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)RSS feed for changes in this project.voiddoRssFailed(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)voidfastUpdateNextBuildNumber(int nextBuildNumber)Unconditionally sets the value ofgetNextBuildNumber().ACLgetACL()Returns theACLfor this object.Collection<? extends Job>getAllJobs()Gets all the jobs that thisItemcontains as descendants.List<JobProperty<? super JobT>>getAllProperties()List of allJobPropertyexposed primarily for the remoting API.RunTgetBuild(String id)Looks up a build by its ID.RunTgetBuildByNumber(int n)FilegetBuildDir()Directory for storingRunrecords.BuildDiscardergetBuildDiscarder()Returns the configured build discarder for this job, viaBuildDiscarderProperty, or null if none.RunTgetBuildForCLI(String id)HealthReportgetBuildHealth()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 theRuns whose build numbers matches the givenFingerprint.RangeSet.SortedMap<Integer,RunT>getBuildsAsMap()Gets all the builds in a map.RunList<RunT>getBuildsByTimestamp(long start, long end)Deprecated.as of 1.372.StringgetBuildStatusIconClassName()StringgetBuildStatusUrl()GraphgetBuildTimeGraph()EnvVarsgetCharacteristicEnvVars()Builds up the environment variable map that's sufficient to identify a process as ours.ObjectgetDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)EnvVarsgetEnvironment(Node node, TaskListener listener)Creates an environment variable override for launching processes for this project.longgetEstimatedDuration()protected List<RunT>getEstimatedDurationCandidates()Returns candidate build for calculating the estimated duration of the current run.RunTgetFirstBuild()Returns the oldest build in the record.BallColorgetIconColor()Used as the color of the status ball for the project.RunTgetLastBuild()Returns the last build.List<RunT>getLastBuildsOverThreshold(int numberOfBuilds, Result threshold)Returns the lastnumberOfBuildsbuilds with a build result ≥thresholdRunTgetLastCompletedBuild()Returns the last completed build, if any.RunTgetLastFailedBuild()Returns the last failed build, if any.RunTgetLastStableBuild()Returns the last stable build, if any.RunTgetLastSuccessfulBuild()Returns the last successful build, if any.RunTgetLastUnstableBuild()Returns the last unstable build, if any.RunTgetLastUnsuccessfulBuild()Returns the last build that was anything but stable, if any.LogRotatorgetLogRotator()Deprecated.as of 1.503 UsegetBuildDiscarder().RunTgetNearestBuild(int n)Gets the youngest build #m that satisfiesn<=m.RunTgetNearestOldBuild(int n)Gets the latest build #m that satisfiesm<=n.RunList<RunT>getNewBuilds()Gets the read-only view of the recent builds.intgetNextBuildNumber()Peeks the next build number.Collection<?>getOverrides()Overrides from job properties.PermalinkListgetPermalinks()Gets all thePermalinkProjectAction.Permalinks defined for this job.StringgetPronoun()Get the term used in the UI to represent this kind ofItem.Map<JobPropertyDescriptor,JobProperty<? super JobT>>getProperties()Gets all the job properties configured for this job.<T extends JobProperty>
TgetProperty(Class<T> clazz)Gets the specific property, or null if the property is not configured for this job.JobPropertygetProperty(String className)BindJobPropertys to URL spaces.Queue.ItemgetQueueItem()If this job is in the build queue, return its item.BuildTimelineWidgetgetTimeline()Deprecated.abstract booleanisBuildable()Returns true if we should display "build now" iconbooleanisBuilding()Returns true if a build of this project is in progress.booleanisHoldOffBuildUntilSave()booleanisInQueue()booleanisKeepDependencies()If true, it will keep all the build logs of dependency components.booleanisLogUpdated()Returns true if the log file is still being updated.booleanisNameEditable()Returns whether the name of this job can be changed by user.voidlogRotate()Perform log rotation.protected SearchIndexBuildermakeSearchIndex()Default implementation that returns empty index.voidmovedTo(DirectlyModifiableTopLevelItemGroup destination, AbstractItem newItem, File destDir)Notify this item it's been moved to another location, replaced by newItem (might be the same object, but not guaranteed).voidonCopiedFrom(Item src)When aItemis 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.voidonCreatedFromScratch()When an item is created from scratch (instead of copied), this method will be invoked.voidonLoad(ItemGroup<? extends Item> parent, String name)Called right after when aItemis loaded from disk.voidremoveProperty(JobProperty<? super JobT> jobProp)RemovesJobProperty<T extends JobProperty>
TremoveProperty(Class<T> clazz)Removes the property of the given type.protected abstract voidremoveRun(RunT run)Called fromRunto remove it from this job.voidrenameTo(String newName)Renames a job.voidsave()Save the settings to a file.protected voidsaveNextBuildNumber()voidsetBuildDiscarder(BuildDiscarder bd)voidsetLogRotator(LogRotator logRotator)Deprecated.as of 1.503 UsesetBuildDiscarder(BuildDiscarder)protected voidsubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Derived class can override this to perform additional config submission work.booleansupportsLogRotator()True if this instance supports log rotation configuration.voidupdateNextBuildNumber(int next)Programmatically updates the next build number.-
Methods inherited from class hudson.model.AbstractItem
delete, doCheckNewName, doConfigDotXml, doConfirmRename, doDoDelete, doReload, doSetName, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getTarget, getTaskNoun, getUrl, load, performDelete, resolveForCLI, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml, writeConfigDotXml, writeReplace
-
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
-
Methods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgets
-
Methods inherited from interface hudson.model.Item
getRelativeNameFrom, getRelativeNameFrom
-
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
-
Methods inherited from interface hudson.search.SearchItem
getSearchIndex
-
-
-
-
Field Detail
-
nextBuildNumber
protected transient volatile int nextBuildNumber
Next build number. Kept in a separate file because this is the only information that gets updated often. This allows the rest of the configuration to be in the VCS.In 1.28 and earlier, this field was stored in the project configuration file, so even though this is marked as transient, don't move it around.
-
properties
protected CopyOnWriteList<JobProperty<? super JobT extends Job<JobT,RunT>>> properties
List of properties configured for this project.
-
runIdMigrator
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public transient RunIdMigrator runIdMigrator
-
HISTORY_ADAPTER
public static final HistoryWidget.Adapter<Run> HISTORY_ADAPTER
-
-
Method Detail
-
save
public void save() throws IOExceptionDescription copied from class:AbstractItemSave the settings to a file.- Specified by:
savein interfaceItem- Specified by:
savein interfaceSaveable- Overrides:
savein classAbstractItem- Throws:
IOException- if the persistence failed.
-
onCreatedFromScratch
public void onCreatedFromScratch()
Description copied from interface:ItemWhen an item is created from scratch (instead of copied), this method will be invoked. Used as the post-construction initialization.- Specified by:
onCreatedFromScratchin interfaceItem
-
onLoad
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
Description copied from class:AbstractItemCalled right after when aItemis loaded from disk. This is an opportunity to do a post load processing.- Specified by:
onLoadin interfaceItem- Overrides:
onLoadin classAbstractItemname- Name of the directory (not a path --- just the name portion) from which the configuration was loaded. This usually becomes thenameof this item.- Throws:
IOException
-
onCopiedFrom
public void onCopiedFrom(Item src)
Description copied from class:AbstractItemWhen aItemis 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:
onCopiedFromin interfaceItem- Overrides:
onCopiedFromin classAbstractItem- Parameters:
src- Item from which it's copied from. The same type asthis. Never null.
-
isHoldOffBuildUntilSave
public boolean isHoldOffBuildUntilSave()
-
saveNextBuildNumber
protected void saveNextBuildNumber() throws IOException- Throws:
IOException
-
isInQueue
@Exported public boolean isInQueue()
-
getQueueItem
@Exported public Queue.Item getQueueItem()
If this job is in the build queue, return its item.
-
isBuilding
public boolean isBuilding()
Returns true if a build of this project is in progress.
-
isLogUpdated
public boolean isLogUpdated()
Returns true if the log file is still being updated.
-
getPronoun
public String getPronoun()
Description copied from class:AbstractItemGet the term used in the UI to represent this kind ofItem. Must start with a capital letter.- Overrides:
getPronounin classAbstractItem
-
isNameEditable
public boolean isNameEditable()
Returns whether the name of this job can be changed by user.- Overrides:
isNameEditablein classAbstractItem- Returns:
- whether
AbstractItem.namecan be modified by a user - See Also:
AbstractItem.checkRename(java.lang.String),AbstractItem.renameTo(java.lang.String)
-
isKeepDependencies
@Exported public boolean isKeepDependencies()
If true, it will keep all the build logs of dependency components. (This really only makes sense inAbstractProjectbut historically it was defined here.)
-
assignBuildNumber
public int assignBuildNumber() throws IOExceptionAllocates a new buildCommand number.- Throws:
IOException
-
getNextBuildNumber
@Exported public int getNextBuildNumber()
Peeks the next build number.
-
getCharacteristicEnvVars
public EnvVars getCharacteristicEnvVars()
Builds up the environment variable map that's sufficient to identify a process as ours. This is used to kill run-away processes viaProcessTree.killAll(Map).
-
getEnvironment
@NonNull public EnvVars getEnvironment(@CheckForNull Node node, @NonNull TaskListener listener) throws IOException, InterruptedException
Creates an environment variable override for launching processes for this project.This is for process launching outside the build execution (such as polling, tagging, deployment, etc.) that happens in a context of a specific job.
- Parameters:
node- Node to eventually run a process on. The implementation must cope with this parameter being null (in which case none of the node specific properties would be reflected in the resulting override.)- Throws:
IOExceptionInterruptedException
-
updateNextBuildNumber
public void updateNextBuildNumber(int next) throws IOExceptionProgrammatically updates the next build number.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
getLastBuild()returns. Otherwise it'll be no-op.- Throws:
IOException- Since:
- 1.199 (before that, this method was package private.)
-
fastUpdateNextBuildNumber
@Restricted(org.kohsuke.accmod.restrictions.Beta.class) public void fastUpdateNextBuildNumber(int nextBuildNumber)
Unconditionally sets the value ofgetNextBuildNumber(). UnlikeupdateNextBuildNumber(int)this does not save the number on disk, and does not checkgetLastBuild().
-
getBuildDiscarder
public BuildDiscarder getBuildDiscarder()
Returns the configured build discarder for this job, viaBuildDiscarderProperty, or null if none.
-
setBuildDiscarder
public void setBuildDiscarder(BuildDiscarder bd) throws IOException
- Throws:
IOException
-
getLogRotator
@Deprecated public LogRotator getLogRotator()
Deprecated.as of 1.503 UsegetBuildDiscarder().Left for backward compatibility. Returns non-null if and only ifLogRotatoris configured asBuildDiscarder.
-
setLogRotator
@Deprecated public void setLogRotator(LogRotator logRotator) throws IOException
Deprecated.as of 1.503 UsesetBuildDiscarder(BuildDiscarder)- Throws:
IOException
-
logRotate
public void logRotate() throws IOException, InterruptedExceptionPerform log rotation.- Throws:
IOExceptionInterruptedException
-
supportsLogRotator
public boolean supportsLogRotator()
True if this instance supports log rotation configuration.
-
makeSearchIndex
protected SearchIndexBuilder makeSearchIndex()
Description copied from class:AbstractModelObjectDefault implementation that returns empty index.- Overrides:
makeSearchIndexin classAbstractModelObject
-
getAllJobs
public Collection<? extends Job> getAllJobs()
Description copied from class:AbstractItemGets all the jobs that thisItemcontains as descendants.- Specified by:
getAllJobsin interfaceItem- Specified by:
getAllJobsin classAbstractItem
-
addProperty
public void addProperty(JobProperty<? super JobT> jobProp) throws IOException
AddsJobProperty.- Throws:
IOException- Since:
- 1.188
-
removeProperty
public void removeProperty(JobProperty<? super JobT> jobProp) throws IOException
RemovesJobProperty- 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.
-
getAllProperties
@Exported(name="property", inline=true) public List<JobProperty<? super JobT>> getAllProperties()List of allJobPropertyexposed primarily for the remoting API.- Since:
- 1.282
-
getProperty
public <T extends JobProperty> T getProperty(Class<T> clazz)
Gets the specific property, or null if the property is not configured for this job.
-
getProperty
public JobProperty getProperty(String className)
BindJobPropertys to URL spaces.- Since:
- 1.403
-
getOverrides
public Collection<?> getOverrides()
Overrides from job properties.- Specified by:
getOverridesin interfaceorg.kohsuke.stapler.StaplerOverridable- See Also:
JobProperty.getJobOverrides()
-
createHistoryWidget
@Deprecated(forRemoval=true, since="2.410") protected HistoryWidget createHistoryWidget()
Deprecated, for removal: This API element is subject to removal in a future version.
-
renameTo
public void renameTo(String newName) throws IOException
Renames a job.- Overrides:
renameToin classAbstractItem- Throws:
IOException
-
movedTo
public void movedTo(DirectlyModifiableTopLevelItemGroup destination, AbstractItem newItem, File destDir) throws IOException
Description copied from class:AbstractItemNotify this item it's been moved to another location, replaced by newItem (might be the same object, but not guaranteed). This method is executed after the item root directory has been moved to it's new location.Derived classes can override this method to add some specific behavior on move, but have to call parent method so the item is actually setup within it's new parent.
- Overrides:
movedToin classAbstractItem- Throws:
IOException- See Also:
Items.move(AbstractItem, jenkins.model.DirectlyModifiableTopLevelItemGroup)
-
delete
public void delete() throws IOException, InterruptedExceptionDescription copied from class:AbstractItemDeletes this item.Any exception indicates the deletion has failed, but
AbortExceptionwould prevent the caller from showing the stack trace. This- Specified by:
deletein interfaceItem- Overrides:
deletein classAbstractItem- Throws:
IOExceptionInterruptedException
-
isBuildable
@Exported public abstract boolean isBuildable()
Returns true if we should display "build now" icon
-
getBuilds
@Exported(name="allBuilds", visibility=-2) @WithBridgeMethods(java.util.List.class) public RunList<RunT> getBuilds()Gets the read-only view of all the builds.- Returns:
- never null. The first entry is the latest build.
-
getNewBuilds
@Exported(name="builds") public RunList<RunT> getNewBuilds()
Gets the read-only view of the recent builds.- Since:
- 1.485
-
getBuilds
public List<RunT> getBuilds(Fingerprint.RangeSet rs)
Obtains all theRuns whose build numbers matches the givenFingerprint.RangeSet.
-
getBuildByNumber
public RunT getBuildByNumber(int n)
- Parameters:
n- The build number.- Returns:
- null if no such build exists.
- See Also:
Run.getNumber(),LazyBuildMixIn.getBuildByNumber(int)
-
getBuildsByTimestamp
@WithBridgeMethods(java.util.List.class) @Deprecated public RunList<RunT> getBuildsByTimestamp(long start, long end)
Deprecated.as of 1.372. Should just dogetBuilds().byTimestamp(s,e)to avoid code bloat inJob.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 RunT getNearestBuild(int n)
Gets the youngest build #m that satisfiesn<=m. This is useful when you'd like to fetch a build but the exact build might be already gone (deleted, rotated, etc.)- See Also:
LazyBuildMixIn.getNearestBuild(int)
-
getNearestOldBuild
public RunT getNearestOldBuild(int n)
Gets the latest build #m that satisfiesm<=n. This is useful when you'd like to fetch a build but the exact build might be already gone (deleted, rotated, etc.)- See Also:
LazyBuildMixIn.getNearestOldBuild(int)
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
- Overrides:
getDynamicin classActionable
-
getBuildDir
public File getBuildDir()
Directory for storingRunrecords.Some
Jobs may not have backing data store forRuns, but thoseJobs that use file system for storing data should use this directory for consistency.- See Also:
RunMap
-
_getRuns
protected abstract SortedMap<Integer,? extends RunT> _getRuns()
Gets all the runs. The resulting map must be treated immutable (by employing copy-on-write semantics.) The map is descending order, with newest builds at the top.- See Also:
LazyBuildMixIn._getRuns()
-
removeRun
protected abstract void removeRun(RunT run)
Called fromRunto remove it from this job. The files are deleted already. So all the callee needs to do is to remove a reference from thisJob.- See Also:
LazyBuildMixIn.removeRun(RunT)
-
getLastBuild
@Exported public RunT getLastBuild()
Returns the last build.- See Also:
LazyBuildMixIn.getLastBuild()
-
getFirstBuild
@Exported public RunT getFirstBuild()
Returns the oldest build in the record.- See Also:
LazyBuildMixIn.getFirstBuild()
-
getLastSuccessfulBuild
@Exported public RunT getLastSuccessfulBuild()
Returns the last successful build, if any. Otherwise null. A successful build would include eitherResult.SUCCESSorResult.UNSTABLE.- See Also:
getLastStableBuild()
-
getLastUnsuccessfulBuild
@Exported public RunT getLastUnsuccessfulBuild()
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.- See Also:
getLastSuccessfulBuild()
-
getLastStableBuild
@Exported public RunT getLastStableBuild()
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.
-
getLastCompletedBuild
@Exported public RunT getLastCompletedBuild()
Returns the last completed build, if any. Otherwise null.
-
getLastBuildsOverThreshold
public List<RunT> getLastBuildsOverThreshold(int numberOfBuilds, Result threshold)
Returns the lastnumberOfBuildsbuilds with a build result ≥threshold- 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.
-
getEstimatedDurationCandidates
protected List<RunT> getEstimatedDurationCandidates()
Returns candidate build for calculating the estimated duration of the current run. Returns the 3 last successful (stable or unstable) builds, if there are any. Failing to find 3 of those, it will return up to 3 last unsuccessful builds. In any case it will not go more than 6 builds into the past to avoid costly build loading.
-
getEstimatedDuration
public long getEstimatedDuration()
-
getPermalinks
public PermalinkList getPermalinks()
Gets all thePermalinkProjectAction.Permalinks defined for this job.- Returns:
- never null
-
doRssChangelog
public void doRssChangelog(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletExceptionRSS feed for changes in this project.- Throws:
IOExceptionjavax.servlet.ServletException- Since:
- 2.60
-
doChildrenContextMenu
public ModelObjectWithContextMenu.ContextMenu doChildrenContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws Exception
Description copied from interface:ModelObjectWithChildrenGenerates the context menu to list up all the children.- Specified by:
doChildrenContextMenuin interfaceModelObjectWithChildren- Throws:
Exception
-
getIconColor
@Exported(visibility=2, name="color") public BallColor getIconColor()Used as the color of the status ball for the project.
-
getBuildHealth
public HealthReport getBuildHealth()
Get the current health report for a job.- Returns:
- the health report. Never returns null
-
getBuildHealthReports
@Exported(name="healthReport") public List<HealthReport> getBuildHealthReports()
-
doConfigSubmit
@POST public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormExceptionAccepts submission from the configuration page.- Throws:
IOExceptionjavax.servlet.ServletExceptionDescriptor.FormException
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormExceptionDerived class can override this to perform additional config submission work.- Throws:
IOExceptionjavax.servlet.ServletExceptionDescriptor.FormException
-
doDescription
public void doDescription(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOExceptionAccepts and serves the job description- Throws:
IOException
-
doBuildStatus
public void doBuildStatus(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOExceptionReturns the image that shows the current buildCommand status.- Throws:
IOException
-
getBuildStatusUrl
public String getBuildStatusUrl()
-
getBuildStatusIconClassName
public String getBuildStatusIconClassName()
-
getBuildTimeGraph
public Graph getBuildTimeGraph()
-
doDoRename
@Deprecated public void doDoRename(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
Deprecated.Exists for backwards compatibility, useAbstractItem.doConfirmRename(java.lang.String)instead.Renames this job.- Throws:
IOExceptionjavax.servlet.ServletException
-
checkRename
protected void checkRename(String newName) throws Failure
Description copied from class:AbstractItemAllows subclasses to block renames for domain-specific reasons. Generic validation of the new name (e.g., null checking, checking for illegal characters, and checking that the name is not in use) always happens prior to calling this method.- Overrides:
checkRenamein classAbstractItem- Parameters:
newName- the new name for the item- Throws:
Failure- if the rename should be blocked- See Also:
checkRename(java.lang.String)
-
doRssAll
public void doRssAll(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException- Throws:
IOExceptionjavax.servlet.ServletException
-
doRssFailed
public void doRssFailed(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException- Throws:
IOExceptionjavax.servlet.ServletException
-
getACL
public ACL getACL()
Returns theACLfor this object. We need to override the identical method in AbstractItem because we won't call getACL(Job) otherwise (single dispatch)- Specified by:
getACLin interfaceAccessControlled- Overrides:
getACLin classAbstractItem- Returns:
- never null.
-
getTimeline
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public BuildTimelineWidget getTimeline()
Deprecated.
-
-