Package jenkins.model.lazy
Class LazyBuildMixIn<JobT extends Job<JobT,RunT> & Queue.Task & LazyBuildMixIn.LazyLoadingJob<JobT,RunT>,RunT extends Run<JobT,RunT> & LazyBuildMixIn.LazyLoadingRun<JobT,RunT>>
java.lang.Object
jenkins.model.lazy.LazyBuildMixIn<JobT,RunT>
public abstract class LazyBuildMixIn<JobT extends Job<JobT,RunT> & Queue.Task & LazyBuildMixIn.LazyLoadingJob<JobT,RunT>,RunT extends Run<JobT,RunT> & LazyBuildMixIn.LazyLoadingRun<JobT,RunT>>
extends Object
Makes it easier to use a lazy
RunMap
from a Job
implementation.
Provides method implementations for some abstract Job
methods,
as well as some methods which are not abstract but which you should override.
Should be kept in a transient
field in the job.
- Since:
- 1.556
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static interface
LazyBuildMixIn.LazyLoadingJob<JobT extends Job<JobT,
RunT> & Queue.Task & LazyBuildMixIn.LazyLoadingJob<JobT, RunT>, RunT extends Run<JobT, RunT> & LazyBuildMixIn.LazyLoadingRun<JobT, RunT>> Marker for aJob
which uses this mixin.static interface
LazyBuildMixIn.LazyLoadingRun<JobT extends Job<JobT,
RunT> & Queue.Task & LazyBuildMixIn.LazyLoadingJob<JobT, RunT>, RunT extends Run<JobT, RunT> & LazyBuildMixIn.LazyLoadingRun<JobT, RunT>> Marker for aRun
which uses this mixin.static class
LazyBuildMixIn.RunMixIn<JobT extends Job<JobT,
RunT> & Queue.Task & LazyBuildMixIn.LazyLoadingJob<JobT, RunT>, RunT extends Run<JobT, RunT> & LazyBuildMixIn.LazyLoadingRun<JobT, RunT>> Accompanying helper for the run type. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_getRuns()
Same asgetRunMap()
but suitable forJob._getRuns()
.protected abstract JobT
asJob()
final HistoryWidget
Deprecated, for removal: This API element is subject to removal in a future version.final RunT
Suitable forJob.getBuild(java.lang.String)
.final RunT
getBuildByNumber
(int n) Suitable forJob.getBuildByNumber(int)
.Type token for the build type.Suitable forJob.getEstimatedDurationCandidates()
.final RunT
Suitable forJob.getFirstBuild()
.final RunT
Suitable forJob.getLastBuild()
.final RunT
getNearestBuild
(int n) Suitable forJob.getNearestBuild(int)
.final RunT
getNearestOldBuild
(int n) Suitable forJob.getNearestOldBuild(int)
.Gets the raw model.Loads an existing build record from disk.final RunT
newBuild()
Creates a new build of this project for immediate execution.final void
Something to be called fromJob.onCreatedFromScratch()
.void
Something to be called fromJob.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
.final void
Suitable forJob.removeRun(RunT)
.
-
Constructor Details
-
LazyBuildMixIn
protected LazyBuildMixIn()Initializes this mixin. Call this from a constructor andAbstractItem.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
to make sure it is always initialized.
-
-
Method Details
-
asJob
-
getRunMap
Gets the raw model. Normally should not be called as such. Note that the initial value is replaced duringonCreatedFromScratch()
oronLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
. -
_getRuns
Same asgetRunMap()
but suitable forJob._getRuns()
. -
onCreatedFromScratch
public final void onCreatedFromScratch()Something to be called fromJob.onCreatedFromScratch()
. -
onLoad
Something to be called fromJob.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
.- Throws:
IOException
-
getBuildClass
Type token for the build type. The build class must have two constructors: one taking the project type (P
); and one takingP
, thenFile
. -
loadBuild
Loads an existing build record from disk. The default implementation just calls the (Job
,File
) constructor ofgetBuildClass()
, which will callRun(Job, File)
.- Throws:
IOException
-
newBuild
Creates a new build of this project for immediate execution. Calls the (Job
) constructor ofgetBuildClass()
, which will callRun(Job)
. Suitable forSubTask.createExecutable()
.- Throws:
IOException
-
removeRun
Suitable forJob.removeRun(RunT)
. -
getBuild
Suitable forJob.getBuild(java.lang.String)
. -
getBuildByNumber
Suitable forJob.getBuildByNumber(int)
. -
getFirstBuild
Suitable forJob.getFirstBuild()
. -
getLastBuild
Suitable forJob.getLastBuild()
. -
getNearestBuild
Suitable forJob.getNearestBuild(int)
. -
getNearestOldBuild
Suitable forJob.getNearestOldBuild(int)
. -
getEstimatedDurationCandidates
Suitable forJob.getEstimatedDurationCandidates()
.- Since:
- 2.407
-
createHistoryWidget
Deprecated, for removal: This API element is subject to removal in a future version.Remove any code calling this method, history widget is now created viaWidgetFactory
implementation.
-
WidgetFactory
implementation.