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
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interfaceLazyBuildMixIn.LazyLoadingJob<JobT extends Job<JobT,RunT> & Queue.Task & LazyBuildMixIn.LazyLoadingJob<JobT, RunT>, RunT extends Run<JobT, RunT> & LazyBuildMixIn.LazyLoadingRun<JobT, RunT>> Marker for aJobwhich uses this mixin.static interfaceLazyBuildMixIn.LazyLoadingRun<JobT extends Job<JobT,RunT> & Queue.Task & LazyBuildMixIn.LazyLoadingJob<JobT, RunT>, RunT extends Run<JobT, RunT> & LazyBuildMixIn.LazyLoadingRun<JobT, RunT>> Marker for aRunwhich uses this mixin.static classLazyBuildMixIn.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
Constructors -
Method Summary
Modifier and TypeMethodDescription_getRuns()Same asgetRunMap()but suitable forJob._getRuns().protected abstract JobTasJob()final HistoryWidgetDeprecated, for removal: This API element is subject to removal in a future version.final RunTSuitable forJob.getBuild(java.lang.String).final RunTgetBuildByNumber(int n) Suitable forJob.getBuildByNumber(int).Type token for the build type.Suitable forJob.getEstimatedDurationCandidates().final RunTSuitable forJob.getFirstBuild().final RunTSuitable forJob.getLastBuild().final RunTgetNearestBuild(int n) Suitable forJob.getNearestBuild(int).final RunTgetNearestOldBuild(int n) Suitable forJob.getNearestOldBuild(int).Gets the raw model.Loads an existing build record from disk.final RunTnewBuild()Creates a new build of this project for immediate execution.final voidSomething to be called fromItem.onCreatedFromScratch().voidSomething to be called fromJob.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String).final voidSuitable 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 fromItem.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 viaWidgetFactoryimplementation.
-
WidgetFactoryimplementation.