use of edu.stanford.bmir.protege.web.server.project.RecentProjectRecord in project webprotege by protegeproject.
the class UserActivityManager method addRecentProject.
public void addRecentProject(@Nonnull UserId userId, @Nonnull ProjectId projectId, long timestamp) {
if (userId.isGuest()) {
return;
}
UserActivityRecord record = getByUserId(userId);
List<RecentProjectRecord> recentProjects = record.getRecentProjects().stream().filter(recentProject -> !recentProject.getProjectId().equals(projectId)).sorted().collect(toList());
recentProjects.add(0, new RecentProjectRecord(projectId, timestamp));
UserActivityRecord replacement = new UserActivityRecord(record.getUserId(), record.getLastLogin(), record.getLastLogout(), recentProjects);
save(replacement);
}
Aggregations