use of com.haulmont.cuba.web.Connection in project cuba by cuba-platform.
the class IdpLoginLifecycleManager method pingIdpSession.
@Order(Events.HIGHEST_PLATFORM_PRECEDENCE + 10)
@EventListener
protected void pingIdpSession(SessionHeartbeatEvent event) {
Connection connection = event.getSource().getConnection();
if (webIdpConfig.getIdpEnabled() && connection.isAuthenticated()) {
UserSession session = connection.getSessionNN();
String idpSessionId = session.getAttribute(IdpService.IDP_USER_SESSION_ATTRIBUTE);
if (idpSessionId != null) {
idpSessionPingConnector.pingIdpSessionServer(idpSessionId);
}
}
}
use of com.haulmont.cuba.web.Connection in project cuba by cuba-platform.
the class ExceptionDialog method forceLogout.
protected void forceLogout() {
App app = AppUI.getCurrent().getApp();
final WebWindowManager wm = app.getWindowManager();
try {
Connection connection = wm.getApp().getConnection();
if (connection.isConnected()) {
connection.logout();
}
} catch (Exception e) {
log.warn("Exception on forced logout", e);
} finally {
// always restart UI
String url = ControllerUtils.getLocationWithoutParams() + "?restartApp";
Page.getCurrent().open(url, "_self");
}
}
use of com.haulmont.cuba.web.Connection in project cuba by cuba-platform.
the class DefaultApp method createConnection.
@Override
protected Connection createConnection() {
Connection connection = super.createConnection();
connection.addStateChangeListener(this);
return connection;
}
Aggregations