Package org.pac4j.play.store
Class PlayCacheSessionStore
- java.lang.Object
-
- org.pac4j.play.store.PlayCacheSessionStore
-
- All Implemented Interfaces:
org.pac4j.core.context.session.SessionStore<PlayWebContext>
,PlaySessionStore
- Direct Known Subclasses:
PlayEhCacheSessionStore
@Singleton public class PlayCacheSessionStore extends Object implements PlaySessionStore
This session store internally uses thePlayCacheStore
which uses the Play Cache, only an identifier is saved into the Play session.- Since:
- 2.0.0
- Author:
- Jerome Leleu
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PlayCacheSessionStore()
PlayCacheSessionStore(com.google.inject.Provider<play.cache.SyncCacheApi> cacheProvider)
PlayCacheSessionStore(play.cache.SyncCacheApi cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<org.pac4j.core.context.session.SessionStore<PlayWebContext>>
buildFromTrackableSession(PlayWebContext context, Object trackableSession)
boolean
destroySession(PlayWebContext context)
Optional<Object>
get(PlayWebContext context, String key)
String
getOrCreateSessionId(PlayWebContext context)
String
getPrefix()
protected String
getSessionIdFromSessionOrRequest(PlayWebContext context)
PlayCacheStore<String,Map<String,Object>>
getStore()
int
getTimeout()
Optional<Object>
getTrackableSession(PlayWebContext context)
boolean
renewSession(PlayWebContext context)
void
set(PlayWebContext context, String key, Object value)
protected void
setDefaultTimeout()
void
setPrefix(String prefix)
protected void
setSessionIdInSession(PlayWebContext context, String sessionId)
void
setTimeout(int timeout)
String
toString()
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
store
protected PlayCacheStore<String,Map<String,Object>> store
-
-
Method Detail
-
getOrCreateSessionId
public String getOrCreateSessionId(PlayWebContext context)
- Specified by:
getOrCreateSessionId
in interfaceorg.pac4j.core.context.session.SessionStore<PlayWebContext>
-
getSessionIdFromSessionOrRequest
protected String getSessionIdFromSessionOrRequest(PlayWebContext context)
-
setSessionIdInSession
protected void setSessionIdInSession(PlayWebContext context, String sessionId)
-
get
public Optional<Object> get(PlayWebContext context, String key)
- Specified by:
get
in interfaceorg.pac4j.core.context.session.SessionStore<PlayWebContext>
-
set
public void set(PlayWebContext context, String key, Object value)
- Specified by:
set
in interfaceorg.pac4j.core.context.session.SessionStore<PlayWebContext>
-
destroySession
public boolean destroySession(PlayWebContext context)
- Specified by:
destroySession
in interfaceorg.pac4j.core.context.session.SessionStore<PlayWebContext>
-
getTrackableSession
public Optional<Object> getTrackableSession(PlayWebContext context)
- Specified by:
getTrackableSession
in interfaceorg.pac4j.core.context.session.SessionStore<PlayWebContext>
-
buildFromTrackableSession
public Optional<org.pac4j.core.context.session.SessionStore<PlayWebContext>> buildFromTrackableSession(PlayWebContext context, Object trackableSession)
- Specified by:
buildFromTrackableSession
in interfaceorg.pac4j.core.context.session.SessionStore<PlayWebContext>
-
renewSession
public boolean renewSession(PlayWebContext context)
- Specified by:
renewSession
in interfaceorg.pac4j.core.context.session.SessionStore<PlayWebContext>
-
getPrefix
public String getPrefix()
-
setPrefix
public void setPrefix(String prefix)
-
getTimeout
public int getTimeout()
-
setTimeout
public void setTimeout(int timeout)
-
getStore
public PlayCacheStore<String,Map<String,Object>> getStore()
-
setDefaultTimeout
protected void setDefaultTimeout()
-
-