use of jetbrains.buildServer.server.rest.data.build.BuildsFilterWithBuildExcludes in project teamcity-rest by JetBrains.
the class BuildFinder method getBuilds.
/**
* Finds builds by the specified criteria within specified range
* This is slow!
*
* @param buildsFilter the filter for the builds to find
* @return the builds found
*/
private List<SBuild> getBuilds(@NotNull final BuildsFilter buildsFilter) {
final ArrayList<SBuild> result = new ArrayList<SBuild>();
// todo: sort and ensure there are no duplicates
result.addAll(BuildsFilterProcessor.getMatchingRunningBuilds(buildsFilter, myServiceLocator.getSingletonService(BuildsManager.class)));
final Integer originalCount = buildsFilter.getCount();
if (originalCount == null || result.size() < originalCount) {
final BuildsFilter patchedBuildsFilter = new BuildsFilterWithBuildExcludes(buildsFilter, result);
if (originalCount != null) {
patchedBuildsFilter.setCount(originalCount - result.size());
}
result.addAll(BuildsFilterProcessor.getMatchingFinishedBuilds(patchedBuildsFilter, myServiceLocator.getSingletonService(BuildHistory.class)));
}
return result;
}
Aggregations