Search in sources :

Example 1 with LogOutUserResult

use of edu.stanford.bmir.protege.web.shared.user.LogOutUserResult in project webprotege by protegeproject.

the class LogOutUserActionHandler method execute.

@Nonnull
@Override
public LogOutUserResult execute(@Nonnull LogOutUserAction action, @Nonnull ExecutionContext executionContext) {
    WebProtegeSession session = executionContext.getSession();
    UserId userId = session.getUserInSession();
    session.clearUserInSession();
    if (!userId.isGuest()) {
        userActivityManager.setLastLogout(userId, System.currentTimeMillis());
    }
    return new LogOutUserResult(userInSessionFactory.getUserInSession(UserId.getGuest()));
}
Also used : UserId(edu.stanford.bmir.protege.web.shared.user.UserId) WebProtegeSession(edu.stanford.bmir.protege.web.server.session.WebProtegeSession) LogOutUserResult(edu.stanford.bmir.protege.web.shared.user.LogOutUserResult) Nonnull(javax.annotation.Nonnull)

Aggregations

WebProtegeSession (edu.stanford.bmir.protege.web.server.session.WebProtegeSession)1 LogOutUserResult (edu.stanford.bmir.protege.web.shared.user.LogOutUserResult)1 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)1 Nonnull (javax.annotation.Nonnull)1