public class ServletSessionAdapter extends java.lang.Object implements HttpSession
Modifier and Type | Field and Description |
---|---|
protected jakarta.servlet.http.HttpSession |
session |
Constructor and Description |
---|
ServletSessionAdapter(jakarta.servlet.http.HttpSession session) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this session, or
null if no object is bound under the name. |
java.util.Enumeration<java.lang.String> |
getAttributeNames() |
long |
getCreationTime() |
java.lang.String |
getId()
Returns a string containing the unique identifier assigned to this
session.
|
long |
getLastAccessedTime() |
int |
getMaxInactiveInterval() |
ServletContext |
getServletContext() |
void |
invalidate() |
boolean |
isNew() |
void |
removeAttribute(java.lang.String name) |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this session, using the name specified.
|
void |
setMaxInactiveInterval(int i) |
public ServletSessionAdapter(jakarta.servlet.http.HttpSession session)
public long getCreationTime()
public java.lang.String getId()
HttpSession
getId
in interface HttpSession
public long getLastAccessedTime()
public ServletContext getServletContext()
public void setMaxInactiveInterval(int i)
public int getMaxInactiveInterval()
public java.lang.Object getAttribute(java.lang.String name)
HttpSession
null
if no object is bound under the name.getAttribute
in interface HttpSession
name
- a string specifying the name of the objectpublic java.util.Enumeration<java.lang.String> getAttributeNames()
public void setAttribute(java.lang.String name, java.lang.Object value)
HttpSession
setAttribute
in interface HttpSession
name
- the name to which the object is bound; cannot be nullvalue
- the object to be boundpublic void removeAttribute(java.lang.String name)
removeAttribute
in interface HttpSession
public void invalidate()
public boolean isNew()