- All Known Implementing Classes:
EjwsStateTable
public interface HttpSessionOps
Operations for managing an HTTP session.
The type parameter T is the type of the session implementation
and can be used to reference an application-specific data structure.
Each session is represented by a string that provides a session ID.
For the class EmbeddedWebServer, the method
EmbeddedWebServer.addSessionFilter(String,HttpSessionOps)
should be called to install a specific instance of this class. For
EmbeddedWebServer, the class
EjwsStateTable will provide a suitable
implementation of this class. The method
EmbeddedWebServer.addSessionFilter(String,boolean)
can install EjwsStateTable as a default.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine if this object recognizes a session ID.Get the session implementation associated with a session ID.voidAdd a session ID to this object.voidRemove a session ID from this object.voidRename a session implementation by changing the session ID referencing it.
-
Method Details
-
remove
Remove a session ID from this object.- Parameters:
sid- the session ID
-
put
Add a session ID to this object. This method is responsible for creating a new session implementation, but must not change an existing one. If the session ID already exists, nothing is added or removed.- Parameters:
sid- the session IDstate- an object representing the state of a session
-
rename
Rename a session implementation by changing the session ID referencing it.- Parameters:
oldID- the existing sessionIDnewID- the new sessionID- Throws:
IllegalStateException- oldID was not already added or newID was already added
-
contains
Determine if this object recognizes a session ID.- Parameters:
sid- the session ID- Returns:
- true if the session exists; false otherwise
-
get
Get the session implementation associated with a session ID.- Parameters:
sid- the session ID- Returns:
- the session implementation
-