Search in sources :

Example 1 with UserSessionService

use of com.haulmont.cuba.security.app.UserSessionService in project cuba by cuba-platform.

the class ClientUserSession method setAttribute.

@Override
public void setAttribute(String name, Serializable value) {
    super.setAttribute(name, value);
    if (authenticated) {
        UserSessionService uss = AppBeans.get(UserSessionService.NAME);
        uss.setSessionAttribute(id, name, value);
    }
}
Also used : UserSessionService(com.haulmont.cuba.security.app.UserSessionService)

Example 2 with UserSessionService

use of com.haulmont.cuba.security.app.UserSessionService in project cuba by cuba-platform.

the class ClientUserSession method setLocale.

@Override
public void setLocale(Locale locale) {
    super.setLocale(locale);
    if (authenticated) {
        UserSessionService uss = AppBeans.get(UserSessionService.NAME);
        uss.setSessionLocale(id, locale);
    }
}
Also used : UserSessionService(com.haulmont.cuba.security.app.UserSessionService)

Example 3 with UserSessionService

use of com.haulmont.cuba.security.app.UserSessionService in project cuba by cuba-platform.

the class UserSessionsDatasource method loadData.

@Override
protected void loadData(Map<String, Object> params) {
    TimeSource timeSource = AppBeans.get(TimeSource.NAME);
    updateTs = timeSource.currentTimestamp();
    data.clear();
    if (!AppBeans.get(Security.class).isEntityOpPermitted(UserSessionEntity.class, EntityOp.READ))
        return;
    UserSessionService uss = AppBeans.get(UserSessionService.NAME);
    Collection<UserSessionEntity> userSessionList = uss.loadUserSessionEntities(createFilter(params));
    for (UserSessionEntity entity : userSessionList) {
        if (!sessionFilter.test(entity)) {
            continue;
        }
        data.put(entity.getId(), entity);
    }
}
Also used : UserSessionService(com.haulmont.cuba.security.app.UserSessionService) TimeSource(com.haulmont.cuba.core.global.TimeSource) UserSessionEntity(com.haulmont.cuba.security.entity.UserSessionEntity)

Example 4 with UserSessionService

use of com.haulmont.cuba.security.app.UserSessionService in project cuba by cuba-platform.

the class ClientUserSession method removeAttribute.

@Override
public void removeAttribute(String name) {
    super.removeAttribute(name);
    if (authenticated) {
        UserSessionService uss = AppBeans.get(UserSessionService.NAME);
        uss.removeSessionAttribute(id, name);
    }
}
Also used : UserSessionService(com.haulmont.cuba.security.app.UserSessionService)

Example 5 with UserSessionService

use of com.haulmont.cuba.security.app.UserSessionService in project cuba by cuba-platform.

the class ClientUserSession method setAddress.

@Override
public void setAddress(String address) {
    super.setAddress(address);
    if (authenticated) {
        UserSessionService uss = AppBeans.get(UserSessionService.NAME);
        uss.setSessionAddress(id, address);
    }
}
Also used : UserSessionService(com.haulmont.cuba.security.app.UserSessionService)

Aggregations

UserSessionService (com.haulmont.cuba.security.app.UserSessionService)9 NoUserSessionException (com.haulmont.cuba.security.global.NoUserSessionException)2 TimeSource (com.haulmont.cuba.core.global.TimeSource)1 Connection (com.haulmont.cuba.desktop.Connection)1 App (com.haulmont.cuba.portal.App)1 Connection (com.haulmont.cuba.portal.Connection)1 PortalSession (com.haulmont.cuba.portal.security.PortalSession)1 UserSessionEntity (com.haulmont.cuba.security.entity.UserSessionEntity)1 ExecutionException (java.util.concurrent.ExecutionException)1 HttpSession (javax.servlet.http.HttpSession)1