Class HttpSessionWrapper
- java.lang.Object
-
- org.apache.felix.http.base.internal.handler.HttpSessionWrapper
-
- All Implemented Interfaces:
jakarta.servlet.http.HttpSession
public class HttpSessionWrapper extends Object implements jakarta.servlet.http.HttpSession
The session wrapper keeps track of the internal session, manages their attributes separately and also handles session timeout.
-
-
Constructor Summary
Constructors Constructor Description HttpSessionWrapper(jakarta.servlet.http.HttpSession session, ExtServletContext context, org.apache.felix.http.base.internal.HttpConfig config, boolean terminate)Creates a newHttpSessionWrapperinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)ObjectgetAttribute(String name)Enumeration<String>getAttributeNames()longgetCreationTime()static Set<String>getExpiredSessionContextNames(jakarta.servlet.http.HttpSession session)StringgetId()longgetLastAccessedTime()intgetMaxInactiveInterval()jakarta.servlet.ServletContextgetServletContext()jakarta.servlet.http.HttpSessionContextgetSessionContext()static Set<String>getSessionContextNames(jakarta.servlet.http.HttpSession session)Get the names of all contexts using a session.ObjectgetValue(String name)String[]getValueNames()inthashCode()static booleanhasSession(String contextName, jakarta.servlet.http.HttpSession session)voidinvalidate()booleanisNew()voidputValue(String name, Object value)voidremoveAttribute(String name)voidremoveValue(String name)voidsetAttribute(String name, Object value)voidsetMaxInactiveInterval(int interval)
-
-
-
Constructor Detail
-
HttpSessionWrapper
public HttpSessionWrapper(jakarta.servlet.http.HttpSession session, ExtServletContext context, org.apache.felix.http.base.internal.HttpConfig config, boolean terminate)Creates a newHttpSessionWrapperinstance.
-
-
Method Detail
-
hasSession
public static boolean hasSession(String contextName, jakarta.servlet.http.HttpSession session)
-
getExpiredSessionContextNames
public static Set<String> getExpiredSessionContextNames(jakarta.servlet.http.HttpSession session)
-
getSessionContextNames
public static Set<String> getSessionContextNames(jakarta.servlet.http.HttpSession session)
Get the names of all contexts using a session.- Parameters:
session- The underlying session- Returns:
- The set of names
-
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttributein interfacejakarta.servlet.http.HttpSession
-
getAttributeNames
public Enumeration<String> getAttributeNames()
- Specified by:
getAttributeNamesin interfacejakarta.servlet.http.HttpSession
-
getCreationTime
public long getCreationTime()
- Specified by:
getCreationTimein interfacejakarta.servlet.http.HttpSession
-
getId
public String getId()
- Specified by:
getIdin interfacejakarta.servlet.http.HttpSession
-
getLastAccessedTime
public long getLastAccessedTime()
- Specified by:
getLastAccessedTimein interfacejakarta.servlet.http.HttpSession
-
getMaxInactiveInterval
public int getMaxInactiveInterval()
- Specified by:
getMaxInactiveIntervalin interfacejakarta.servlet.http.HttpSession
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()
- Specified by:
getServletContextin interfacejakarta.servlet.http.HttpSession
-
getValue
public Object getValue(String name)
- Specified by:
getValuein interfacejakarta.servlet.http.HttpSession
-
getValueNames
public String[] getValueNames()
- Specified by:
getValueNamesin interfacejakarta.servlet.http.HttpSession
-
invalidate
public void invalidate()
- Specified by:
invalidatein interfacejakarta.servlet.http.HttpSession
-
isNew
public boolean isNew()
- Specified by:
isNewin interfacejakarta.servlet.http.HttpSession
-
putValue
public void putValue(String name, Object value)
- Specified by:
putValuein interfacejakarta.servlet.http.HttpSession
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfacejakarta.servlet.http.HttpSession
-
removeValue
public void removeValue(String name)
- Specified by:
removeValuein interfacejakarta.servlet.http.HttpSession
-
setAttribute
public void setAttribute(String name, Object value)
- Specified by:
setAttributein interfacejakarta.servlet.http.HttpSession
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
- Specified by:
setMaxInactiveIntervalin interfacejakarta.servlet.http.HttpSession
-
getSessionContext
public jakarta.servlet.http.HttpSessionContext getSessionContext()
- Specified by:
getSessionContextin interfacejakarta.servlet.http.HttpSession
-
-