use of com.epam.pipeline.controller.PagedResult in project cloud-pipeline by epam.
the class PipelineRunManager method loadActiveServices.
/**
* Method that will return all active runs for which current users is owner or is listed in run sids - a list of
* identities (user names or groups) that have access to run
* @param filter - filter containing a page and page size
* @return list of active runs which available for current user
*/
@Transactional(propagation = Propagation.SUPPORTS)
public PagedResult<List<PipelineRun>> loadActiveServices(PagingRunFilterVO filter) {
Assert.isTrue(filter.getPage() > 0, messageHelper.getMessage(MessageConstants.ERROR_PAGE_INDEX));
Assert.isTrue(filter.getPageSize() > 0, messageHelper.getMessage(MessageConstants.ERROR_PAGE_SIZE));
PipelineUser user = authManager.getCurrentUser();
List<PipelineRun> runs = pipelineRunDao.loadActiveServices(filter, user);
int count = pipelineRunDao.countActiveServices(user);
return new PagedResult<>(runs, count);
}
Aggregations