Package hudson.model
Class ViewJob<JobT extends ViewJob<JobT,RunT>,RunT extends Run<JobT,RunT>>
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.AbstractItem
-
- hudson.model.Job<JobT,RunT>
-
- hudson.model.ViewJob<JobT,RunT>
-
- All Implemented Interfaces:
ExtensionPoint
,DescriptorByNameOwner
,Item
,ModelObject
,PersistenceRoot
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,OnMaster
,org.kohsuke.stapler.HttpDeletable
,org.kohsuke.stapler.StaplerOverridable
,org.kohsuke.stapler.StaplerProxy
public abstract class ViewJob<JobT extends ViewJob<JobT,RunT>,RunT extends Run<JobT,RunT>> extends Job<JobT,RunT>
Job
that monitors activities that happen outside Hudson, which requires occasional batch reload activity to obtain the up-to-date information.This can be used as a base class to derive custom
Job
type.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Job
Job.LastItemListener, Job.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 boolean
reloadPeriodically
In the very old version of Hudson, an external job submission was just creating files on the file system, so we needed to periodically reload the jobs from a file system to pick up new records.protected RunMap<RunT>
runs
AllRun
s.-
Fields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, properties, runIdMigrator
-
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 Modifier and Type Method Description protected SortedMap<Integer,RunT>
_getRuns()
Gets all the runs.boolean
isBuildable()
Returns true if we should display "build now" iconvoid
onLoad(ItemGroup<? extends Item> parent, String name)
Called right after when aItem
is loaded from disk.protected abstract void
reload()
Reloads the list ofRun
s.void
removeRun(RunT run)
Called fromRun
to remove it from this job.protected void
submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Derived class can override this to perform additional config submission work.-
Methods inherited from class hudson.model.Job
addProperty, assignBuildNumber, checkRename, createHistoryWidget, delete, doBuildStatus, doChildrenContextMenu, doConfigSubmit, doDescription, doDoRename, doRssAll, doRssChangelog, doRssFailed, getACL, getAllJobs, getAllProperties, getBuild, getBuildByNumber, getBuildDir, getBuildDiscarder, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusIconClassName, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getDynamic, getEnvironment, getEstimatedDuration, getEstimatedDurationCandidates, getFirstBuild, getIconColor, getLastBuild, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNearestBuild, getNearestOldBuild, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getPronoun, getProperties, getProperty, getProperty, getQueueItem, getTimeline, getWidgets, isBuilding, isHoldOffBuildUntilSave, isInQueue, isKeepDependencies, isLogUpdated, isNameEditable, logRotate, makeSearchIndex, movedTo, onCopiedFrom, onCreatedFromScratch, removeProperty, removeProperty, renameTo, save, saveNextBuildNumber, setBuildDiscarder, setLogRotator, supportsLogRotator, updateNextBuildNumber
-
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, 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 hudson.model.Item
getRelativeNameFrom, getRelativeNameFrom
-
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
-
Methods inherited from interface hudson.search.SearchItem
getSearchIndex
-
-
-
-
Field Detail
-
runs
protected transient volatile RunMap<RunT extends Run<JobT,RunT>> runs
AllRun
s. Copy-on-write semantics.
-
reloadPeriodically
public static boolean reloadPeriodically
In the very old version of Hudson, an external job submission was just creating files on the file system, so we needed to periodically reload the jobs from a file system to pick up new records.We then switched to submission via HTTP, so this reloading is no longer necessary, so only do this when explicitly requested.
-
-
Constructor Detail
-
ViewJob
@Deprecated protected ViewJob(Jenkins parent, String name)
Deprecated.as of 1.390
-
-
Method Detail
-
isBuildable
public boolean isBuildable()
Description copied from class:Job
Returns true if we should display "build now" icon
-
onLoad
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
Description copied from class:AbstractItem
Called right after when aItem
is loaded from disk. This is an opportunity to do a post load processing.- Specified by:
onLoad
in interfaceItem
- Overrides:
onLoad
in classJob<JobT extends ViewJob<JobT,RunT>,RunT extends Run<JobT,RunT>>
name
- Name of the directory (not a path --- just the name portion) from which the configuration was loaded. This usually becomes thename
of this item.- Throws:
IOException
-
_getRuns
protected SortedMap<Integer,RunT> _getRuns()
Description copied from class:Job
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.
-
reload
protected abstract void reload()
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException
Description copied from class:Job
Derived class can override this to perform additional config submission work.
-
-