Package freenet.clients.http.SessionManager

Examples of freenet.clients.http.SessionManager.Session


   *            session, {@code false} otherwise
   * @return The current session, or {@code null} if there is no current
   *         session
   */
  public Session getCurrentSession(ToadletContext toadletContenxt, boolean create) {
    Session session = getSessionManager().useSession(toadletContenxt);
    if (create && (session == null)) {
      session = getSessionManager().createSession(UUID.randomUUID().toString(), toadletContenxt);
    }
    return session;
  }
View Full Code Here


   *            The toadlet context
   * @param sone
   *            The Sone to set as currently logged in
   */
  public void setCurrentSone(ToadletContext toadletContext, Sone sone) {
    Session session = getCurrentSession(toadletContext);
    if (sone == null) {
      session.removeAttribute("Sone.CurrentSone");
    } else {
      session.setAttribute("Sone.CurrentSone", sone.getId());
    }
  }
View Full Code Here

  }

  private OwnIdentity getLoggedInOwnIdentity(ToadletContext context) throws RedirectException {
    try {
      Session session = mSessionManager.useSession(context);
     
      if(session == null)
        throw new RedirectException(logIn);
     
      return mFreetalk.getIdentityManager().getOwnIdentity(session.getUserID());
    } catch(NoSuchIdentityException e) {
      Logger.warning(this, "Session is invalid, the own identity was deleted already.", e);
      mSessionManager.deleteSession(context);
      throw new RedirectException(logIn);
    }
View Full Code Here

TOP

Related Classes of freenet.clients.http.SessionManager.Session

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.