*/
private LoginResponse doLogin(LoginRequest request) {
User user = HPIDataFactory.getInstance().getUser(request.getUser().getNickname());
if (user != null && user.getPassphrase().equals(request.getUser().getPassphrase())) {
String remoteAddress = this.socket.getRemoteSocketAddress().toString();
HPISession session = HPISessionManager.getInstance().newSession(user, remoteAddress);
return new LoginResponse(session.getSession_id(), "User logged successfully.", Response.Status.SUCCESS);
} else {
return new LoginResponse("invalid session", "User not found or passphrase doesn't match.", Response.Status.FAIL);
}
}