calcResponseTime(start);
}
}
private AuthenticationSession openSessionIfNotAuthenticateRequest(final Request request) {
AuthenticationSession authenticationSession;
if (LOG.isDebugEnabled()) {
debugRequest = request.getId() + " - " + request.toString();
}
authenticationSession = request.getSession();
if (authenticationSession == null) {
if (LOG.isDebugEnabled()) {
debugAuthSession = "(none)";
debugContextId = "(none)";
}
if (!(request instanceof OpenSessionRequest)) {
throw new IsisException("AuthenticationSession required for all requests (except the initial Authenticate request)");
}
} else {
IsisContext.openSession(authenticationSession);
if (LOG.isDebugEnabled()) {
debugAuthSession = authenticationSession.toString();
debugContextId = IsisContext.getSessionId();
debugSessionInfo = IsisContext.debugSession();
}
}
return authenticationSession;