|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Store
The Store
object provides the persistence scheme
used by sessions. In order to facilitate a range of storage
techniques for session data the Session
must be
able to avail of arbitrary strategies. An implementation of
this interface can be used to store all objects given to
a session instance. For example, objects can be stored within
a relational database, a file, or some in-memory container.
To configure the system to use a specific implementation the
system property simple.http.session.store
can be
used. If this is not specified then a default implementation
is used which simply stores the data within an internal map.
All Store
implementations must have a single
argument constructor that takes a Cookie
.
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. |
java.util.Set |
keySet()
To ascertain what mappings exist, the names of all values previously put into this store can be retrieved with this method. |
void |
prepare(java.lang.Object data)
This method is used to prepare the Store for
use with an active session. |
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 |
---|
void prepare(java.lang.Object data) throws StoreException
Store
for
use with an active session. This should contain sufficent
functionality to setup the storage environment so that the
Session
object can transparently store and
retrieve session variables from the storage medium. If
there is a problem initializing an exception is thrown.
data
- the data used to initialize this instance
StoreException
- if there problem initializingjava.lang.Object get(java.lang.String name) throws StoreException
put
method.
If there is no value by the given name within this store
then this will return null. Also, if there is a problem
retrieving the data from the underlying storage mechanism
this may thrown an StoreException
.
name
- this is the name of the variable to retrieve
StoreException
- thrown if there is an I/O errorvoid put(java.lang.String name, java.lang.Object value) throws StoreException
get
method. If the object can
not be stored an StoreException
is thrown.
name
- this is the name of the variable to be mappedvalue
- this is the value mapped to the given name
StoreException
- if there is an storage problemboolean contains(java.lang.String name) throws StoreException
StoreException
- if there is an storage problemvoid remove(java.lang.String name) throws StoreException
name
- this is the name of the variable to remove
StoreException
- if there is an storage problemjava.util.Set keySet() throws StoreException
Set
that contains
the names of all the session variables currently stored.
StoreException
- if there is an storage problemvoid destroy() throws StoreException
StoreException
- if there is an storage problem
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |