java.lang.Object
cloud.piranha.webapp.impl.DefaultHttpSession
- All Implemented Interfaces:
HttpSession
public class DefaultHttpSession extends java.lang.Object implements HttpSession
The default HttpSession.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
Constructors Constructor Description DefaultHttpSession(ServletContext servletContext)
Constructor.DefaultHttpSession(ServletContext servletContext, java.lang.String id, boolean newFlag)
Constructor. -
Method Summary
Modifier and Type Method Description java.lang.Object
getAttribute(java.lang.String name)
Get the attribute value.java.util.Enumeration<java.lang.String>
getAttributeNames()
Get the attribute names.long
getCreationTime()
Get the creation time.java.lang.String
getId()
Get the id.long
getLastAccessedTime()
Get the last accessed time.int
getMaxInactiveInterval()
Get the maximum inactive interval.ServletContext
getServletContext()
Get the servlet context.HttpSessionContext
getSessionContext()
Get the session context.java.lang.Object
getValue(java.lang.String name)
Get the value.java.lang.String[]
getValueNames()
Get the attribute names.void
invalidate()
Invalidate the session.boolean
isNew()
Is the session new.void
putValue(java.lang.String name, java.lang.Object value)
Set the value.void
removeAttribute(java.lang.String name)
Remove the attribute.void
removeValue(java.lang.String name)
Remove the value.void
setAttribute(java.lang.String name, java.lang.Object value)
Set the attribute.void
setId(java.lang.String id)
Set the id.void
setMaxInactiveInterval(int maxInactiveInterval)
Set the maximum inactive interval.void
setNew(boolean newFlag)
Set the new flag.void
setSessionManager(HttpSessionManager sessionManager)
Set the HTTP session manager.
-
Constructor Details
-
DefaultHttpSession
Constructor.- Parameters:
servletContext
- the servlet context.
-
DefaultHttpSession
Constructor.- Parameters:
servletContext
- the servlet context.id
- the id.newFlag
- the new flag.
-
-
Method Details
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)Get the attribute value.- Specified by:
getAttribute
in interfaceHttpSession
- Parameters:
name
- the attribute name.- Returns:
- the attribute value.
- See Also:
HttpSession.getAttribute(java.lang.String)
-
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()Get the attribute names.- Specified by:
getAttributeNames
in interfaceHttpSession
- Returns:
- the attribute names.
- See Also:
HttpSession.getAttributeNames()
-
getCreationTime
public long getCreationTime()Get the creation time.- Specified by:
getCreationTime
in interfaceHttpSession
- Returns:
- the creation time.
- See Also:
HttpSession.getCreationTime()
-
getId
public java.lang.String getId()Get the id.- Specified by:
getId
in interfaceHttpSession
- Returns:
- the id.
- See Also:
HttpSession.getId()
-
getLastAccessedTime
public long getLastAccessedTime()Get the last accessed time.- Specified by:
getLastAccessedTime
in interfaceHttpSession
- Returns:
- the last accessed time.
- See Also:
HttpSession.getLastAccessedTime()
-
getMaxInactiveInterval
public int getMaxInactiveInterval()Get the maximum inactive interval.- Specified by:
getMaxInactiveInterval
in interfaceHttpSession
- Returns:
- the maximum inactive interval.
- See Also:
HttpSession.getMaxInactiveInterval()
-
getServletContext
Get the servlet context.- Specified by:
getServletContext
in interfaceHttpSession
- Returns:
- the servlet context.
- See Also:
HttpSession.getServletContext()
-
getSessionContext
Get the session context.- Specified by:
getSessionContext
in interfaceHttpSession
- Returns:
- null
- See Also:
HttpSession.getSessionContext()
-
getValue
public java.lang.Object getValue(java.lang.String name)Get the value.- Specified by:
getValue
in interfaceHttpSession
- Parameters:
name
- the attribute name.- Returns:
- the value.
- See Also:
HttpSession.getValue(java.lang.String)
-
getValueNames
public java.lang.String[] getValueNames()Get the attribute names.- Specified by:
getValueNames
in interfaceHttpSession
- Returns:
- the attribute names.
- See Also:
HttpSession.getValueNames()
-
invalidate
public void invalidate()Invalidate the session.- Specified by:
invalidate
in interfaceHttpSession
- See Also:
HttpSession.invalidate()
-
isNew
public boolean isNew()Is the session new.- Specified by:
isNew
in interfaceHttpSession
- Returns:
- true if it is, false otherwise.
- See Also:
HttpSession.isNew()
-
putValue
public void putValue(java.lang.String name, java.lang.Object value)Set the value.- Specified by:
putValue
in interfaceHttpSession
- Parameters:
name
- the attribute name.value
- the attribute value.- See Also:
HttpSession.putValue(java.lang.String, java.lang.Object)
-
removeAttribute
public void removeAttribute(java.lang.String name)Remove the attribute.- Specified by:
removeAttribute
in interfaceHttpSession
- Parameters:
name
- the attribute name.- See Also:
HttpSession.removeAttribute(java.lang.String)
-
removeValue
public void removeValue(java.lang.String name)Remove the value.- Specified by:
removeValue
in interfaceHttpSession
- Parameters:
name
- the attribute name.- See Also:
HttpSession.removeValue(java.lang.String)
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Set the attribute.- Specified by:
setAttribute
in interfaceHttpSession
- Parameters:
name
- the attribute name.value
- the attribute value.- See Also:
HttpSession.setAttribute(java.lang.String, java.lang.Object)
-
setId
public void setId(java.lang.String id)Set the id.- Parameters:
id
- the id.
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int maxInactiveInterval)Set the maximum inactive interval.- Specified by:
setMaxInactiveInterval
in interfaceHttpSession
- Parameters:
maxInactiveInterval
- the maximum inactive interval.- See Also:
HttpSession.setMaxInactiveInterval(int)
-
setNew
public void setNew(boolean newFlag)Set the new flag.- Parameters:
newFlag
- the new flag.
-
setSessionManager
Set the HTTP session manager.- Parameters:
sessionManager
- the HTTP session manager.
-