Package org.apache.catalina
Interface Store
- All Known Implementing Classes:
DataSourceStore
,FileStore
,StoreBase
public interface Store
A Store is the abstraction of a Catalina component that provides persistent storage and loading of Sessions
and their associated user data. Implementations are free to save and load the Sessions to any media they wish, but it
is assumed that saved Sessions are persistent across server or context restarts.
- Author:
- Craig R. McClanahan
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a property change listener to this component.void
clear()
Remove all Sessions from this Store.int
getSize()
String[]
keys()
Load and return the Session associated with the specified session identifier from this Store, without removing it.void
Remove the Session with the specified session identifier from this Store, if present.void
Remove a property change listener from this component.void
Save the specified Session into this Store.void
setManager
(Manager manager) Set the Manager associated with this Store.
-
Method Details
-
getManager
Manager getManager()- Returns:
- the Manager instance associated with this Store.
-
setManager
Set the Manager associated with this Store.- Parameters:
manager
- The Manager which will use this Store.
-
getSize
- Returns:
- the number of Sessions present in this Store.
- Throws:
IOException
- if an input/output error occurs
-
addPropertyChangeListener
Add a property change listener to this component.- Parameters:
listener
- The listener to add
-
keys
- Returns:
- an array containing the session identifiers of all Sessions currently saved in this Store. If there are no such Sessions, a zero-length array is returned.
- Throws:
IOException
- if an input/output error occurred
-
load
Load and return the Session associated with the specified session identifier from this Store, without removing it. If there is no such stored Session, returnnull
.- Parameters:
id
- Session identifier of the session to load- Returns:
- the loaded Session instance
- Throws:
ClassNotFoundException
- if a deserialization error occursIOException
- if an input/output error occurs
-
remove
Remove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.- Parameters:
id
- Session identifier of the Session to be removed- Throws:
IOException
- if an input/output error occurs
-
clear
Remove all Sessions from this Store.- Throws:
IOException
- if an input/output error occurs
-
removePropertyChangeListener
Remove a property change listener from this component.- Parameters:
listener
- The listener to remove
-
save
Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.- Parameters:
session
- Session to be saved- Throws:
IOException
- if an input/output error occurs
-