Package org.apache.shiro.session.mgt
Class DefaultSessionKey
- java.lang.Object
-
- org.apache.shiro.session.mgt.DefaultSessionKey
-
- All Implemented Interfaces:
Serializable,SessionKey
public class DefaultSessionKey extends Object implements SessionKey, Serializable
Default implementation of theSessionKeyinterface, which allows setting and retrieval of a concretesessionIdthat theSessionManagerimplementation can use to look up aSessioninstance.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultSessionKey()DefaultSessionKey(Serializable sessionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SerializablegetSessionId()Returns the id of the session to acquire.voidsetSessionId(Serializable sessionId)
-
-
-
Constructor Detail
-
DefaultSessionKey
public DefaultSessionKey()
-
DefaultSessionKey
public DefaultSessionKey(Serializable sessionId)
-
-
Method Detail
-
setSessionId
public void setSessionId(Serializable sessionId)
-
getSessionId
public Serializable getSessionId()
Description copied from interface:SessionKeyReturns the id of the session to acquire. Acquiring sessions by ID only is a suitable strategy when sessions are natively managed by Shiro directly. For example, the Servlet specification does not have an API that allows session acquisition by session ID, so the session ID alone is not sufficient for ServletContainer-based SessionManager implementations.- Specified by:
getSessionIdin interfaceSessionKey- Returns:
- the id of the session to acquire.
-
-