use of org.orcid.api.common.writer.stats.StatsTimelineList in project ORCID-Source by ORCID.
the class StatsApiServiceDelegatorImpl method getAllStatsTimelines.
@Override
@AccessControl(requiredScope = ScopePathType.READ_PUBLIC, enableAnonymousAccess = true)
public Response getAllStatsTimelines() {
StatisticsSummary summary = statisticsCacheManager.retrieve();
if (summary == null)
return Response.status(Status.NOT_FOUND).build();
StatsTimelineList statsTimelines = new StatsTimelineList();
for (String key : summary.getStatistics().keySet()) {
StatisticsTimeline timeline = statisticsCacheManager.getStatisticsTimelineModel(StatisticsEnum.fromString(key));
if (timeline != null)
statsTimelines.getTimelines().add(timeline);
}
return Response.ok(statsTimelines).build();
}
Aggregations