Package org.hpi.server.session

Examples of org.hpi.server.session.HPISession


   */
  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);
    }
  }
View Full Code Here

TOP

Related Classes of org.hpi.server.session.HPISession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.