use of org.graylog2.indexer.ranges.IndexRange in project graylog2-server by Graylog2.
the class IndexRangesResource method list.
@GET
@Timed
@ApiOperation(value = "Get a list of all index ranges")
@Produces(MediaType.APPLICATION_JSON)
public IndexRangesResponse list() {
final SortedSet<IndexRange> all = indexRangeService.findAll();
final List<IndexRangeSummary> ranges = Lists.newArrayListWithCapacity(all.size());
for (IndexRange range : all) {
if (!isPermitted(RestPermissions.INDEXRANGES_READ, range.indexName())) {
continue;
}
final IndexRangeSummary indexRange = IndexRangeSummary.create(range.indexName(), range.begin(), range.end(), range.calculatedAt(), range.calculationDuration());
ranges.add(indexRange);
}
return IndexRangesResponse.create(ranges.size(), ranges);
}
Aggregations