Class Sessions.Memory

java.lang.Object
com.codename1.backend.Sessions.Memory
All Implemented Interfaces:
SessionStore
Enclosing class:
Sessions

public static final class Sessions.Memory extends Object implements SessionStore
Sessions in this process's memory. The default.
  • Constructor Details

    • Memory

      public Memory()
  • Method Details

    • load

      public HttpSession load(String id)
      Description copied from interface: SessionStore
      The session with this id, or null when there is none or it expired.
      Specified by:
      load in interface SessionStore
    • save

      public void save(HttpSession session, String previousId)
      Description copied from interface: SessionStore
      Records a session after a request that created or changed it. When its id changed, previousId names the entry to drop; otherwise it is null.
      Specified by:
      save in interface SessionStore
    • delete

      public void delete(String id)
      Description copied from interface: SessionStore
      Forgets a session.
      Specified by:
      delete in interface SessionStore
    • purgeExpired

      public int purgeExpired(long now)
      Description copied from interface: SessionStore
      Drops every session that has expired by now; answers how many.
      Specified by:
      purgeExpired in interface SessionStore
    • size

      public int size()
      Description copied from interface: SessionStore
      How many sessions are kept, or -1 when that is expensive to know.
      Specified by:
      size in interface SessionStore