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
Sessionimplementation that is backed entirely by a standard servlet containerHttpSessioninstance. 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 providedHttpSessioninstance.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description HttpServletSession(javax.servlet.http.HttpSession httpSession, String host)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(Object key)Collection<Object>getAttributeKeys()StringgetHost()SerializablegetId()DategetLastAccessTime()DategetStartTimestamp()longgetTimeout()ObjectremoveAttribute(Object key)voidsetAttribute(Object key, Object value)protected voidsetHost(String host)voidsetTimeout(long maxIdleTimeInMillis)voidstop()voidtouch()
-
-
-
Constructor Detail
-
HttpServletSession
public HttpServletSession(javax.servlet.http.HttpSession httpSession, String host)
-
-
Method Detail
-
getId
public Serializable getId()
- Specified by:
getIdin interfaceorg.apache.shiro.session.Session
-
getStartTimestamp
public Date getStartTimestamp()
- Specified by:
getStartTimestampin interfaceorg.apache.shiro.session.Session
-
getLastAccessTime
public Date getLastAccessTime()
- Specified by:
getLastAccessTimein interfaceorg.apache.shiro.session.Session
-
getTimeout
public long getTimeout() throws org.apache.shiro.session.InvalidSessionException- Specified by:
getTimeoutin 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:
setTimeoutin interfaceorg.apache.shiro.session.Session- Throws:
org.apache.shiro.session.InvalidSessionException
-
setHost
protected void setHost(String host)
-
getHost
public String getHost()
- Specified by:
getHostin interfaceorg.apache.shiro.session.Session
-
touch
public void touch() throws org.apache.shiro.session.InvalidSessionException- Specified by:
touchin interfaceorg.apache.shiro.session.Session- Throws:
org.apache.shiro.session.InvalidSessionException
-
stop
public void stop() throws org.apache.shiro.session.InvalidSessionException- Specified by:
stopin interfaceorg.apache.shiro.session.Session- Throws:
org.apache.shiro.session.InvalidSessionException
-
getAttributeKeys
public Collection<Object> getAttributeKeys() throws org.apache.shiro.session.InvalidSessionException
- Specified by:
getAttributeKeysin 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:
getAttributein 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:
setAttributein interfaceorg.apache.shiro.session.Session- Throws:
org.apache.shiro.session.InvalidSessionException
-
-