use of jenkins.model.lazy.LazyBuildMixIn in project blueocean-plugin by jenkinsci.
the class RunSearch method findRuns.
@SuppressWarnings("unchecked")
public static Iterable<BlueRun> findRuns(Job job, final Link parent, int start, int limit) {
final List<BlueRun> runs = new ArrayList<>();
Iterable<Job> pipelines;
if (job != null) {
pipelines = ImmutableList.of(job);
} else {
pipelines = Jenkins.getInstance().getItems(Job.class);
}
for (Job p : pipelines) {
Iterator<? extends Run> runIterator;
if (job instanceof LazyBuildMixIn.LazyLoadingJob) {
final LazyBuildMixIn lazyLoadMixin = ((LazyBuildMixIn.LazyLoadingJob) job).getLazyBuildMixIn();
runIterator = lazyLoadMixin.getRunMap().iterator();
} else {
runIterator = p.getBuilds().iterator();
}
runs.addAll(collectRuns(runIterator, parent, start, limit));
}
return runs;
}
Aggregations