use of org.orcid.core.utils.statistics.StatisticsEnum in project ORCID-Source by ORCID.
the class StatisticsCacheManagerImpl method setLatestStatisticsTimeline.
@Override
public synchronized void setLatestStatisticsTimeline() {
LOG.info("Getting the latest statistics timeline map");
Map<StatisticsEnum, StatisticsTimeline> latestStatisticsTimelineMap = new HashMap<StatisticsEnum, StatisticsTimeline>();
for (StatisticsEnum type : StatisticsEnum.values()) {
StatisticsTimeline statisticsTimeline = statisticsManagerReadOnly.getStatisticsTimelineModel(type);
latestStatisticsTimelineMap.put(type, statisticsTimeline);
}
if (statisticsCache.get(CACHE_TIMELINE_KEY) == null) {
statisticsCache.put(new Element(CACHE_TIMELINE_KEY, latestStatisticsTimelineMap));
} else {
statisticsCache.replace(new Element(CACHE_TIMELINE_KEY, latestStatisticsTimelineMap));
}
}
Aggregations