|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
The Session
object is used to store session data
relating to a specific HTTP client. The HTTP protocol does not
maintain state between requests, so in order to build up data
some identifier from the HTTP request must be used to acquire
session information. Typically the session identifier is taken
from a HTTP cookie, which can then be used to acquire data.
That data is stored in a Session
implementation.
This interface hides the complexities of the session handling
system, which is broken into two separate entities. The first
is the Store
which acts as the storage mechanism
for session variables, the other is the leasing mechanism,
which is used to determine when a session has expired. The
result is a very simple session management mechanism.
Store
Method Summary | |
---|---|
boolean |
contains(java.lang.String name)
This method is used to determine whether there is a value mapped to the specified name. |
void |
destroy()
In order to free up any resources consumed by this object it must be destroyed when it is no longer useful. |
java.lang.Object |
get(java.lang.String name)
This method is used to acquire a session variable that has been previously stored with the put method. |
boolean |
isEmpty()
This is a convenience method that can be used to determine whether there are any variables within the session. |
java.util.Set |
keySet()
To ascertain what mappings exist, the names of all values previously put into a session can be retrieved with this method. |
void |
put(java.lang.String name,
java.lang.Object value)
This maps the given session variable to the provided name. |
void |
remove(java.lang.String name)
This removes the mapping for the specified name. |
Method Detail |
---|
java.lang.Object get(java.lang.String name)
put
method.
If there is no value by the given name within the store
then this will return null. Also, if there is a problem
retrieving the data null is returned instead.
name
- this is the name of the variable to retrieve
void put(java.lang.String name, java.lang.Object value)
get
method with its name.
name
- this is the name of the variable to be mappedvalue
- this is the value mapped to the given nameboolean contains(java.lang.String name)
void remove(java.lang.String name)
name
- this is the name of the variable to removeboolean isEmpty()
java.util.Set keySet()
Set
that contains
the names of all the session variables currently stored.
void destroy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |