use of com.thinkbiganalytics.jobrepo.query.model.FeedStatus in project kylo by Teradata.
the class FeedHealthSummaryCache method getUserFeedHealth.
public SearchResult getUserFeedHealth(Long time, FeedSummaryFilter feedSummaryFilter, RoleSetExposingSecurityExpressionRoot userContext) {
SearchResult<com.thinkbiganalytics.jobrepo.query.model.FeedSummary> searchResult = new SearchResultImpl();
List<FeedHealth> feedSummaryHealth = null;
// get the entire list back and filter it for user access
List<? extends FeedSummary> list = getFeedSummaryList(time).stream().filter(filter(feedSummaryFilter, userContext)).collect(Collectors.toList());
feedSummaryHealth = list.stream().sorted(feedSummaryFilter.getSort() != null ? getComparator(feedSummaryFilter.getSort()) : byName).skip(feedSummaryFilter.getStart()).limit(feedSummaryFilter.getLimit() > 0 ? feedSummaryFilter.getLimit() : Integer.MAX_VALUE).map(f -> FeedModelTransform.feedHealth(f)).collect(Collectors.toList());
// Transform it to FeedSummary objects
FeedStatus feedStatus = FeedModelTransform.feedStatus(feedSummaryHealth);
Long total = new Long(list.size());
searchResult.setData(feedStatus.getFeedSummary());
searchResult.setRecordsTotal(total);
searchResult.setRecordsFiltered(total);
return searchResult;
}
use of com.thinkbiganalytics.jobrepo.query.model.FeedStatus in project kylo by Teradata.
the class FeedsRestController method getFeedHealth.
@GET
@Path("/health")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Provides a detailed health status of every feed.")
@ApiResponses(@ApiResponse(code = 200, message = "Returns the health.", response = FeedStatus.class))
public FeedStatus getFeedHealth(@Context HttpServletRequest request) {
this.accessController.checkPermission(AccessController.SERVICES, OperationsAccessControl.ACCESS_OPS);
return metadataAccess.read(() -> {
List<FeedHealth> feedHealth = getFeedHealthCounts(request);
FeedStatus status = FeedModelTransform.feedStatus(feedHealth);
return status;
});
}
Aggregations