use of edu.stanford.bmir.protege.web.shared.project.LoadProjectResult in project webprotege by protegeproject.
the class LoadProjectActionHandler method execute.
@Nonnull
@Override
public LoadProjectResult execute(@Nonnull final LoadProjectAction action, @Nonnull ExecutionContext executionContext) {
Stopwatch stopwatch = Stopwatch.createStarted();
logger.info("{} is being loaded due to request by {}", action.getProjectId(), executionContext.getUserId());
projectManager.getProject(action.getProjectId(), executionContext.getUserId());
stopwatch.stop();
logger.info("{} was loaded in {} ms due to request by {}", action.getProjectId(), stopwatch.elapsed(TimeUnit.MILLISECONDS), executionContext.getUserId());
MemoryMonitor memoryMonitor = new MemoryMonitor(logger);
memoryMonitor.monitorMemoryUsage();
memoryMonitor.logMemoryUsage();
final ProjectId projectId = action.getProjectId();
ProjectDetails projectDetails = projectDetailsManager.getProjectDetails(projectId);
if (!executionContext.getUserId().isGuest()) {
userActivityManager.addRecentProject(executionContext.getUserId(), action.getProjectId(), System.currentTimeMillis());
}
return new LoadProjectResult(action.getProjectId(), executionContext.getUserId(), projectDetails);
}
Aggregations