Store (Catalina Internal API Documentation)

org.apache.catalina
Interface Store

All Known Implementing Classes:
FileStore, JDBCStore, 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.

Version:
$Revision: 1.4 $ $Date: 2001/07/22 20:13:30 $
Author:
Craig R. McClanahan

Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a property change listener to this component.
 void clear()
          Remove all Sessions from this Store.
 java.lang.String getInfo()
          Return descriptive information about this Store implementation and the corresponding version number, in the format <description>/<version>.
 Manager getManager()
          Return the Manager instance associated with this Store.
 int getSize()
          Return the number of Sessions present in this Store.
 java.lang.String[] keys()
          Return an array containing the session identifiers of all Sessions currently saved in this Store.
 Session load(java.lang.String id)
          Load and return the Session associated with the specified session identifier from this Store, without removing it.
 void remove(java.lang.String id)
          Remove the Session with the specified session identifier from this Store, if present.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a property change listener from this component.
 void save(Session session)
          Save the specified Session into this Store.
 void setManager(Manager manager)
          Set the Manager associated with this Store.
 

Method Detail

getInfo


public java.lang.String getInfo()
Return descriptive information about this Store implementation and the corresponding version number, in the format <description>/<version>.


getManager


public Manager getManager()
Return the Manager instance associated with this Store.


setManager


public void setManager(Manager manager)
Set the Manager associated with this Store.

Parameters:
manager - The Manager which will use this Store.

getSize


public int getSize()
            throws java.io.IOException
Return the number of Sessions present in this Store.

Throws:
java.io.IOException - if an input/output error occurs

addPropertyChangeListener


public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component.

Parameters:
listener - The listener to add

keys


public java.lang.String[] keys()
                        throws java.io.IOException
Return 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:
java.io.IOException - if an input/output error occurred

load


public Session load(java.lang.String id)
             throws java.lang.ClassNotFoundException,
                    java.io.IOException
Load and return the Session associated with the specified session identifier from this Store, without removing it. If there is no such stored Session, return null.

Parameters:
id - Session identifier of the session to load
Throws:
java.lang.ClassNotFoundException - if a deserialization error occurs
java.io.IOException - if an input/output error occurs

remove


public void remove(java.lang.String id)
            throws java.io.IOException
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:
java.io.IOException - if an input/output error occurs

clear


public void clear()
           throws java.io.IOException
Remove all Sessions from this Store.

java.io.IOException

removePropertyChangeListener


public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component.

Parameters:
listener - The listener to remove

save


public void save(Session session)
          throws java.io.IOException
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:
java.io.IOException - if an input/output error occurs


Copyright © 2000-2001 Apache Software Foundation. All Rights Reserved.