Class RemoteSession
- java.lang.Object
-
- org.forgerock.openam.authentication.service.protocol.RemoteSession
-
- All Implemented Interfaces:
jakarta.servlet.http.HttpSession,Serializable
public class RemoteSession extends Object implements jakarta.servlet.http.HttpSession, Serializable
Facade for the standard servlet HttpSession object.- Author:
- Steve Ferris steve.ferris@forgerock.com
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description RemoteSession()Construct a new session facade.RemoteSession(jakarta.servlet.http.HttpSession session)Construct a new session facade.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ObjectgetAttribute(String name)Fetch the value of a given session attribute, either from local object pre serialization or the stored value post serialization.EnumerationgetAttributeNames()Returns a list of attribute names, either from local object pre serialization or the stored value post serialization.longgetCreationTime()The creation time of the session, either from local object pre serialization or the stored value post serialization.StringgetId()Returns the ID of the session, either from local object pre serialization or the stored value post serialization.longgetLastAccessedTime()Returns the last accessed time of the session, either from local object pre serialization or the stored value post serialization.intgetMaxInactiveInterval()Gets the maximum inactive session interval, either from local object pre serialization or the stored value post serialization.jakarta.servlet.ServletContextgetServletContext()Returns the Servlet Context, either from local object pre serialization or the stored value post serialization.jakarta.servlet.http.HttpSessionContextgetSessionContext()Deprecated.ObjectgetValue(String name)Deprecated.String[]getValueNames()Deprecated.voidinvalidate()Invalidates this session, only works pre-serializationbooleanisNew()Determines if the client knows about the session, either from local object pre serialization or the stored value post serialization.protected booleanisSerializable(Object obj)Tests if an object implements the java.io.Serializable interface.voidputValue(String name, Object value)Deprecated.voidremoveAttribute(String name)Removes an attribute from the session, either from local object pre serialization or the stored value post serialization.voidremoveValue(String name)Deprecated.voidsetAttribute(String name, Object value)Sets an attribute on the session, either from local object pre serialization or the stored value post serialization.voidsetMaxInactiveInterval(int interval)Sets the maximum inactive session interval on the session, only works pre serialization
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoteSession
public RemoteSession(jakarta.servlet.http.HttpSession session)
Construct a new session facade. This class wraps the standard HttpSession object allowing it to become serializable.- Parameters:
session- The HttpSession object to be wrapped
-
RemoteSession
public RemoteSession()
Construct a new session facade. Used on the remote end post deserialization
-
-
Method Detail
-
getCreationTime
public long getCreationTime()
The creation time of the session, either from local object pre serialization or the stored value post serialization.- Specified by:
getCreationTimein interfacejakarta.servlet.http.HttpSession- Returns:
- The session creation time
-
getId
public String getId()
Returns the ID of the session, either from local object pre serialization or the stored value post serialization.- Specified by:
getIdin interfacejakarta.servlet.http.HttpSession- Returns:
- The session id
-
getLastAccessedTime
public long getLastAccessedTime()
Returns the last accessed time of the session, either from local object pre serialization or the stored value post serialization.- Specified by:
getLastAccessedTimein interfacejakarta.servlet.http.HttpSession- Returns:
- The last session accessed time
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()
Returns the Servlet Context, either from local object pre serialization or the stored value post serialization.- Specified by:
getServletContextin interfacejakarta.servlet.http.HttpSession- Returns:
- The servlet context
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
Sets the maximum inactive session interval on the session, only works pre serialization- Specified by:
setMaxInactiveIntervalin interfacejakarta.servlet.http.HttpSession- Parameters:
interval- The maximum inactivate interval
-
getMaxInactiveInterval
public int getMaxInactiveInterval()
Gets the maximum inactive session interval, either from local object pre serialization or the stored value post serialization.- Specified by:
getMaxInactiveIntervalin interfacejakarta.servlet.http.HttpSession- Returns:
- The maximum session inactive interval
-
getSessionContext
public jakarta.servlet.http.HttpSessionContext getSessionContext()
Deprecated.Returns the session context, either from local object pre serialization or the stored value post serialization.- Specified by:
getSessionContextin interfacejakarta.servlet.http.HttpSession- Returns:
- The session context
-
getAttribute
public Object getAttribute(String name)
Fetch the value of a given session attribute, either from local object pre serialization or the stored value post serialization. Only attributes that were serializable will be available post serialization- Specified by:
getAttributein interfacejakarta.servlet.http.HttpSession- Parameters:
name- The name of the attribute to return- Returns:
- The value of the named attribute or null if not found or non-serializable
-
getValue
public Object getValue(String name)
Deprecated.Same functionality as @see getAttribute.- Specified by:
getValuein interfacejakarta.servlet.http.HttpSession- Parameters:
name- the name of the attribute to retrieve- Returns:
- The value of the named attribute or null if not found or non-serializable
-
getAttributeNames
public Enumeration getAttributeNames()
Returns a list of attribute names, either from local object pre serialization or the stored value post serialization.- Specified by:
getAttributeNamesin interfacejakarta.servlet.http.HttpSession- Returns:
- The attributes names
-
getValueNames
public String[] getValueNames()
Deprecated.Returns a list of value names, @see getAttributeNames- Specified by:
getValueNamesin interfacejakarta.servlet.http.HttpSession- Returns:
- The value names
-
setAttribute
public void setAttribute(String name, Object value)
Sets an attribute on the session, either from local object pre serialization or the stored value post serialization.- Specified by:
setAttributein interfacejakarta.servlet.http.HttpSession- Parameters:
name- The name of the attribute to setvalue- The attributes value
-
putValue
public void putValue(String name, Object value)
Deprecated.see @setAttribute- Specified by:
putValuein interfacejakarta.servlet.http.HttpSession- Parameters:
name- The name of the value to setvalue- The value of the value being set
-
removeAttribute
public void removeAttribute(String name)
Removes an attribute from the session, either from local object pre serialization or the stored value post serialization.- Specified by:
removeAttributein interfacejakarta.servlet.http.HttpSession- Parameters:
name- The name of the attribute to remove
-
removeValue
public void removeValue(String name)
Deprecated.- Specified by:
removeValuein interfacejakarta.servlet.http.HttpSession- Parameters:
name- The name of the value to remove- See Also:
removeAttribute(java.lang.String)
-
invalidate
public void invalidate()
Invalidates this session, only works pre-serialization- Specified by:
invalidatein interfacejakarta.servlet.http.HttpSession
-
isNew
public boolean isNew()
Determines if the client knows about the session, either from local object pre serialization or the stored value post serialization.- Specified by:
isNewin interfacejakarta.servlet.http.HttpSession- Returns:
- true if unknown to the client
-
isSerializable
protected boolean isSerializable(Object obj)
Tests if an object implements the java.io.Serializable interface.- Parameters:
obj- The obj to test for serialization.- Returns:
- true if the object implements Serializable, false otherwise.
-
-