Package org.silverpeas.core.web.session
Class HTTPSessionInfo
- java.lang.Object
-
- org.silverpeas.core.security.session.SessionInfo
-
- org.silverpeas.core.web.session.HTTPSessionInfo
-
- All Implemented Interfaces:
SilverpeasUserSession
public class HTTPSessionInfo extends SessionInfo
A Silverpeas user session built upon the HTTP session created by the underlying web server.It wraps the
HttpSession
instance created by the web server for a given user and it delegates all the session attribute management to it. So it can be used instead of an HTTP session.
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.security.session.SessionInfo
NoneSession
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getAttribute(String name)
Gets the value of the attribute named by the specified name.void
onClosed()
Frees the allocated resources used in the session management and carried by this session information.<T> void
setAttribute(String name, T value)
Sets an attribute named by the specified name with the specified value.void
setHttpSession(javax.servlet.http.HttpSession httpSession)
void
unsetAttribute(String name)
Unsets the specified attribute.-
Methods inherited from class org.silverpeas.core.security.session.SessionInfo
getCache, getId, getIPAddress, getLastAccessTimestamp, getLastIdleDuration, getOpeningTimestamp, getSessionId, getUser, getUserDetail, isAnonymous, isDefined, isOneShot, setAsIdle, setAsOneShot, setIPAddress, updateLastAccess
-
-
-
-
Method Detail
-
setHttpSession
public void setHttpSession(javax.servlet.http.HttpSession httpSession)
-
onClosed
public void onClosed()
Description copied from class:SessionInfo
Frees the allocated resources used in the session management and carried by this session information. This method must be called at session closing by the session management system.- Overrides:
onClosed
in classSessionInfo
-
setAttribute
public <T> void setAttribute(String name, T value)
Description copied from class:SessionInfo
Sets an attribute named by the specified name with the specified value. If no attribute exists with the specified name, then it is added to the session.- Specified by:
setAttribute
in interfaceSilverpeasUserSession
- Overrides:
setAttribute
in classSessionInfo
- Type Parameters:
T
- the type of the attribute value.- Parameters:
name
- the name of the attribute to set.value
- the value of the attribute to set.
-
unsetAttribute
public void unsetAttribute(String name)
Description copied from class:SessionInfo
Unsets the specified attribute. The consequence of an unset is the attribute is then removed from the session.- Specified by:
unsetAttribute
in interfaceSilverpeasUserSession
- Overrides:
unsetAttribute
in classSessionInfo
- Parameters:
name
- the name of the attribute to unset.
-
getAttribute
public <T> T getAttribute(String name)
Description copied from class:SessionInfo
Gets the value of the attribute named by the specified name.- Specified by:
getAttribute
in interfaceSilverpeasUserSession
- Overrides:
getAttribute
in classSessionInfo
- Type Parameters:
T
- the type of the attribute value.- Parameters:
name
- the name of the attribute to get.- Returns:
- the value of the attribute or null if no such attribute exists.
-
-