|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.model.AbstractModelObject
hudson.model.Actionable
hudson.model.AbstractItem
hudson.model.Job<JobT,RunT>
hudson.model.ViewJob<JobT,RunT>
public abstract class ViewJob<JobT extends ViewJob<JobT,RunT>,RunT extends Run<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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
|---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
| Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu |
|---|
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.MenuItem |
| Field Summary | |
|---|---|
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
All Runs. |
| Fields inherited from class hudson.model.Job |
|---|
HISTORY_ADAPTER, nextBuildNumber, properties |
| Fields inherited from class hudson.model.AbstractItem |
|---|
description, displayName, name, PRONOUN |
| Fields inherited from interface hudson.model.Item |
|---|
BUILD, CANCEL, CONFIGURE, CREATE, DELETE, DISCOVER, EXTENDED_READ, PERMISSIONS, READ, WIPEOUT, WORKSPACE |
| Fields inherited from interface hudson.model.Saveable |
|---|
NOOP |
| Constructor Summary | |
|---|---|
protected |
ViewJob(ItemGroup parent,
String name)
|
protected |
ViewJob(Jenkins parent,
String name)
Deprecated. as of 1.390 |
| Method Summary | |
|---|---|
protected SortedMap<Integer,RunT> |
_getRuns()
Gets all the runs. |
boolean |
isBuildable()
Returns true if we should display "build now" icon |
void |
onLoad(ItemGroup<? extends Item> parent,
String name)
Called right after when a Item is loaded from disk. |
protected abstract void |
reload()
Reloads the list of Runs. |
void |
removeRun(RunT run)
Called from Run 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.Actionable |
|---|
addAction, doContextMenu, getAction, getAction, getActions, getActions |
| 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.search.SearchableModelObject |
|---|
getSearch |
| Methods inherited from interface hudson.search.SearchItem |
|---|
getSearchIndex |
| Field Detail |
|---|
protected transient RunMap<RunT extends Run<JobT,RunT>> runs
Runs. Copy-on-write semantics.
public static boolean reloadPeriodically
We then switched to submission via HTTP, so this reloading is no longer necessary, so only do this when explicitly requested.
| Constructor Detail |
|---|
protected ViewJob(Jenkins parent,
String name)
protected ViewJob(ItemGroup parent,
String name)
| Method Detail |
|---|
public boolean isBuildable()
Job
isBuildable in class Job<JobT extends ViewJob<JobT,RunT>,RunT extends Run<JobT,RunT>>
public void onLoad(ItemGroup<? extends Item> parent,
String name)
throws IOException
AbstractItemItem is loaded from disk.
This is an opporunity to do a post load processing.
onLoad in interface ItemonLoad in class Job<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 the
name of this item.
IOExceptionprotected SortedMap<Integer,RunT> _getRuns()
Job
_getRuns in class Job<JobT extends ViewJob<JobT,RunT>,RunT extends Run<JobT,RunT>>public void removeRun(RunT run)
JobRun to remove it from this job.
The files are deleted already. So all the callee needs to do is to remove
a reference from this Job.
removeRun in class Job<JobT extends ViewJob<JobT,RunT>,RunT extends Run<JobT,RunT>>protected abstract void reload()
Runs. This operation can take a long time.
The loaded Runs should be set to runs.
protected void submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException,
Descriptor.FormException
Job
submit in class Job<JobT extends ViewJob<JobT,RunT>,RunT extends Run<JobT,RunT>>IOException
javax.servlet.ServletException
Descriptor.FormException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||