Search in sources :

Example 1 with StatsTimelineList

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();
}
Also used : StatsTimelineList(org.orcid.api.common.writer.stats.StatsTimelineList) StatisticsSummary(org.orcid.jaxb.model.statistics.StatisticsSummary) StatisticsTimeline(org.orcid.jaxb.model.statistics.StatisticsTimeline) AccessControl(org.orcid.core.security.visibility.aop.AccessControl)

Aggregations

StatsTimelineList (org.orcid.api.common.writer.stats.StatsTimelineList)1 AccessControl (org.orcid.core.security.visibility.aop.AccessControl)1 StatisticsSummary (org.orcid.jaxb.model.statistics.StatisticsSummary)1 StatisticsTimeline (org.orcid.jaxb.model.statistics.StatisticsTimeline)1