Chirpy! 0.3 API Documentation
Chirpy::UI::WebApp::Session::DataManager - Abstract data manager class specific to Chirpy::UI::WebApp::Session
If you wish to create an implementation of this class, the easiest way is to extend an existing Chirpy::DataManager implementation with this class's methods.
The class also has two non-abstract object method,
The former returns a list containing the IDs of the sessions that have expired and have consequently been removed.
The latter does the same,
but only every 24 hours; otherwise,
If you want to make your Chirpy::DataManager compatible with Chirpy::UI::WebApp::Session,
all you need to do is implement a few extra object methods for creating,
updating and deleting sessions.
You will probably also have to extend your
remove() methods accordingly.
The extra methods to implement are as follows:
- add_session($id, $data)
Stores the session with ID
$idand session data
$datais a hash reference, so you will probably have to serialize it. How you do that is up to you, but Data::Dumper makes it easy. Returns a true value upon success.
Returns a list containing the data hash for each session whose ID is contained in
@ids, or all sessions if
@idsis empty. If no sessions are found, returns an empty list (and not
- modify_session($id, $data)
Updates the existing session with ID
$idwith the data from the hash referred to by
Removes all sessions with an ID contained in
@idsfrom the system. Returns the number of removed sessions.
Tim De Pauw <email@example.com>
Copyright 2005-2007 Tim De Pauw. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.