Package org.apache.shiro.web.session
Class HttpServletSession
- java.lang.Object
-
- org.apache.shiro.web.session.HttpServletSession
-
- All Implemented Interfaces:
org.apache.shiro.session.Session
public class HttpServletSession extends Object implements org.apache.shiro.session.Session
Session
implementation that is backed entirely by a standard servlet containerHttpSession
instance. It does not interact with any of Shiro's session-related componentsSessionManager
,SecurityManager
, etc, and instead satisfies all method implementations by interacting with a servlet container providedHttpSession
instance.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description HttpServletSession(HttpSession httpSession, String host)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getAttribute(Object key)
Collection<Object>
getAttributeKeys()
String
getHost()
Serializable
getId()
Date
getLastAccessTime()
Date
getStartTimestamp()
long
getTimeout()
Object
removeAttribute(Object key)
void
setAttribute(Object key, Object value)
protected void
setHost(String host)
void
setTimeout(long maxIdleTimeInMillis)
void
stop()
void
touch()
-
-
-
Constructor Detail
-
HttpServletSession
public HttpServletSession(HttpSession httpSession, String host)
-
-
Method Detail
-
getId
public Serializable getId()
- Specified by:
getId
in interfaceorg.apache.shiro.session.Session
-
getStartTimestamp
public Date getStartTimestamp()
- Specified by:
getStartTimestamp
in interfaceorg.apache.shiro.session.Session
-
getLastAccessTime
public Date getLastAccessTime()
- Specified by:
getLastAccessTime
in interfaceorg.apache.shiro.session.Session
-
getTimeout
public long getTimeout() throws org.apache.shiro.session.InvalidSessionException
- Specified by:
getTimeout
in interfaceorg.apache.shiro.session.Session
- Throws:
org.apache.shiro.session.InvalidSessionException
-
setTimeout
public void setTimeout(long maxIdleTimeInMillis) throws org.apache.shiro.session.InvalidSessionException
- Specified by:
setTimeout
in interfaceorg.apache.shiro.session.Session
- Throws:
org.apache.shiro.session.InvalidSessionException
-
touch
public void touch() throws org.apache.shiro.session.InvalidSessionException
- Specified by:
touch
in interfaceorg.apache.shiro.session.Session
- Throws:
org.apache.shiro.session.InvalidSessionException
-
stop
public void stop() throws org.apache.shiro.session.InvalidSessionException
- Specified by:
stop
in interfaceorg.apache.shiro.session.Session
- Throws:
org.apache.shiro.session.InvalidSessionException
-
getAttributeKeys
public Collection<Object> getAttributeKeys() throws org.apache.shiro.session.InvalidSessionException
- Specified by:
getAttributeKeys
in interfaceorg.apache.shiro.session.Session
- Throws:
org.apache.shiro.session.InvalidSessionException
-
getAttribute
public Object getAttribute(Object key) throws org.apache.shiro.session.InvalidSessionException
- Specified by:
getAttribute
in interfaceorg.apache.shiro.session.Session
- Throws:
org.apache.shiro.session.InvalidSessionException
-
setAttribute
public void setAttribute(Object key, Object value) throws org.apache.shiro.session.InvalidSessionException
- Specified by:
setAttribute
in interfaceorg.apache.shiro.session.Session
- Throws:
org.apache.shiro.session.InvalidSessionException
-
removeAttribute
public Object removeAttribute(Object key) throws org.apache.shiro.session.InvalidSessionException
- Specified by:
removeAttribute
in interfaceorg.apache.shiro.session.Session
- Throws:
org.apache.shiro.session.InvalidSessionException
-
-