Class PlayCacheSessionStore

java.lang.Object
org.pac4j.play.store.PlayCacheSessionStore
All Implemented Interfaces:
org.pac4j.core.context.session.SessionStore
Direct Known Subclasses:
PlayEhCacheSessionStore

@Singleton public class PlayCacheSessionStore extends Object implements org.pac4j.core.context.session.SessionStore
This session store internally uses the PlayCacheStore which uses the Play Cache, only an identifier is saved into the Play session.
Since:
2.0.0
Author:
Jerome Leleu
  • Field Details

  • Constructor Details

    • PlayCacheSessionStore

      protected PlayCacheSessionStore()
    • PlayCacheSessionStore

      @Inject public PlayCacheSessionStore(play.cache.SyncCacheApi cache)
    • PlayCacheSessionStore

      public PlayCacheSessionStore(com.google.inject.Provider<play.cache.SyncCacheApi> cacheProvider)
  • Method Details

    • getSessionId

      public Optional<String> getSessionId(org.pac4j.core.context.WebContext context, boolean createSession)
      Specified by:
      getSessionId in interface org.pac4j.core.context.session.SessionStore
    • getSessionIdFromSessionOrRequest

      protected String getSessionIdFromSessionOrRequest(org.pac4j.core.context.WebContext context)
    • setSessionIdInSession

      protected void setSessionIdInSession(org.pac4j.core.context.WebContext context, String sessionId)
    • get

      public Optional<Object> get(org.pac4j.core.context.WebContext context, String key)
      Specified by:
      get in interface org.pac4j.core.context.session.SessionStore
    • set

      public void set(org.pac4j.core.context.WebContext context, String key, Object value)
      Specified by:
      set in interface org.pac4j.core.context.session.SessionStore
    • destroySession

      public boolean destroySession(org.pac4j.core.context.WebContext context)
      Specified by:
      destroySession in interface org.pac4j.core.context.session.SessionStore
    • getTrackableSession

      public Optional<Object> getTrackableSession(org.pac4j.core.context.WebContext context)
      Specified by:
      getTrackableSession in interface org.pac4j.core.context.session.SessionStore
    • buildFromTrackableSession

      public Optional<org.pac4j.core.context.session.SessionStore> buildFromTrackableSession(org.pac4j.core.context.WebContext context, Object trackableSession)
      Specified by:
      buildFromTrackableSession in interface org.pac4j.core.context.session.SessionStore
    • renewSession

      public boolean renewSession(org.pac4j.core.context.WebContext context)
      Specified by:
      renewSession in interface org.pac4j.core.context.session.SessionStore
    • getTimeout

      public int getTimeout()
    • setTimeout

      public void setTimeout(int timeout)
    • setDefaultTimeout

      protected void setDefaultTimeout()