Search in sources :

Example 1 with SessionEvent

use of net.geoprism.SessionEvent in project geoprism-registry by terraframe.

the class RegistrySessionController method loginWithLocales.

public ClientRequestIF loginWithLocales(ServletRequestIF req, String username, String password, Locale[] locales) {
    try {
        WebClientSession clientSession = WebClientSession.createUserSession(username, password, locales);
        ClientRequestIF clientRequest = clientSession.getRequest();
        req.getSession().setMaxInactiveInterval(CommonProperties.getSessionTime());
        req.getSession().setAttribute(ClientConstants.CLIENTSESSION, clientSession);
        req.setAttribute(ClientConstants.CLIENTREQUEST, clientRequest);
        ClientConfigurationService.handleSessionEvent(new SessionEvent(EventType.LOGIN_SUCCESS, clientRequest, username));
        return clientRequest;
    } catch (RuntimeException e) {
        ClientConfigurationService.handleSessionEvent(new SessionEvent(EventType.LOGIN_FAILURE, null, username));
        throw e;
    }
}
Also used : WebClientSession(com.runwaysdk.web.WebClientSession) SessionEvent(net.geoprism.SessionEvent) ClientRequestIF(com.runwaysdk.constants.ClientRequestIF)

Aggregations

ClientRequestIF (com.runwaysdk.constants.ClientRequestIF)1 WebClientSession (com.runwaysdk.web.WebClientSession)1 SessionEvent (net.geoprism.SessionEvent)1