This class offers ways to create new sessoins, stores all available sessions and provides access to them. More...
#include <session_manager.h>
Public Member Functions | |
| SessionManager () | |
| Constructor, initializes the array. | |
| virtual | ~SessionManager () |
| zmm::Ref< Session > | createSession (long timeout) |
| Creates a Session with a given timeout. | |
| zmm::Ref< Session > | getSession (zmm::String sessionID, bool doLock=true) |
| Returns the instance to a Session with a given sessionID. | |
| void | removeSession (zmm::String sessionID) |
| Removes a session. | |
| zmm::String | getUserPassword (zmm::String user) |
| void | containerChangedUI (int objectID) |
| Is called whenever a container changed in a way, so that it needs to be redrawn in the tree of the UI. notifies all active sessions. | |
| void | containerChangedUI (zmm::Ref< zmm::IntArray > objectIDs) |
| virtual void | timerNotify (zmm::Ref< zmm::Object > parameter) |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static zmm::Ref< SessionManager > | getInstance () |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Member Functions | |
| void | checkTimer () |
| virtual void | init () |
| virtual void | shutdown () |
| virtual void | registerSingleton () |
Protected Attributes | |
| zmm::Ref< zmm::Array< Session > > | sessions |
| This array is holding available sessions. | |
| zmm::Ref< Dictionary > | accounts |
| bool | timerAdded |
| mt_atomic_t | _ref_count |
Static Protected Attributes | |
| static zmm::Ref< Mutex > | mutex |
| static zmm::Ref< SessionManager > | instance |
| static bool | singletonActive |
This class offers ways to create new sessoins, stores all available sessions and provides access to them.
Definition at line 115 of file session_manager.h.
| SessionManager::SessionManager | ( | ) |
Constructor, initializes the array.
Definition at line 137 of file session_manager.cc.
References accounts, CFG_SERVER_UI_ACCOUNT_LIST, Singleton< SessionManager >::getInstance(), sessions, and timerAdded.
| virtual SessionManager::~SessionManager | ( | ) | [inline, virtual] |
Definition at line 130 of file session_manager.h.
References log_debug.
| void SessionManager::checkTimer | ( | ) | [protected] |
Definition at line 234 of file session_manager.cc.
References AS_TIMER_SUBSCRIBER_SINGLETON, Singleton< SessionManager >::getInstance(), SESSION_TIMEOUT_CHECK_INTERVAL, sessions, and timerAdded.
Referenced by createSession(), removeSession(), and timerNotify().
| void SessionManager::containerChangedUI | ( | zmm::Ref< zmm::IntArray > | objectIDs | ) |
Definition at line 220 of file session_manager.cc.
References AUTOLOCK, Singleton< SessionManager >::mutex, and sessions.
| void SessionManager::containerChangedUI | ( | int | objectID | ) |
Is called whenever a container changed in a way, so that it needs to be redrawn in the tree of the UI. notifies all active sessions.
| objectID |
Definition at line 206 of file session_manager.cc.
References AUTOLOCK, Singleton< SessionManager >::mutex, and sessions.
Creates a Session with a given timeout.
| timeout | Session timeout in milliseconds. |
Definition at line 146 of file session_manager.cc.
References _, _Exception, AUTOLOCK, checkTimer(), generate_random_id(), getSession(), Singleton< SessionManager >::mutex, nil, and sessions.
| static zmm::Ref<SessionManager > Singleton< SessionManager >::getInstance | ( | ) | [inline, static, inherited] |
Definition at line 62 of file singleton.h.
References _, _ServerShutdownException, AUTOLOCK, Singleton< T >::instance, Singleton< T >::mutex, nil, and Singleton< T >::singletonActive.
Referenced by WebRequestHandler::check_request(), checkTimer(), FileRequestHandler::open(), web::auth::process(), SessionManager(), and ContentManager::setAutoscanDirectory().
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| Ref< Session > SessionManager::getSession | ( | zmm::String | sessionID, | |
| bool | doLock = true | |||
| ) |
Returns the instance to a Session with a given sessionID.
| ID | of the Session. |
Definition at line 167 of file session_manager.cc.
References AUTOLOCK_NOLOCK, AUTORELOCK, Singleton< SessionManager >::mutex, nil, and sessions.
Referenced by createSession().
| String SessionManager::getUserPassword | ( | zmm::String | user | ) |
Definition at line 197 of file session_manager.cc.
| virtual void Singleton< SessionManager >::init | ( | ) | [inline, protected, virtual, inherited] |
Definition at line 87 of file singleton.h.
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| virtual void Singleton< SessionManager >::registerSingleton | ( | ) | [inline, protected, virtual, inherited] |
Definition at line 94 of file singleton.h.
References Singleton< T >::getInstance().
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| void SessionManager::removeSession | ( | zmm::String | sessionID | ) |
Removes a session.
Definition at line 181 of file session_manager.cc.
References AUTOLOCK, checkTimer(), Singleton< SessionManager >::mutex, and sessions.
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| virtual void Singleton< SessionManager >::shutdown | ( | ) | [inline, protected, virtual, inherited] |
Definition at line 88 of file singleton.h.
| void SessionManager::timerNotify | ( | zmm::Ref< zmm::Object > | parameter | ) | [virtual] |
Implements TimerSubscriber.
Definition at line 248 of file session_manager.cc.
References AUTOLOCK, checkTimer(), getDeltaMillis(), getTimespecNow(), log_debug, Singleton< SessionManager >::mutex, and sessions.
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
zmm::Ref<Dictionary> SessionManager::accounts [protected] |
Definition at line 121 of file session_manager.h.
Referenced by getUserPassword(), and SessionManager().
zmm::Ref<SessionManager > Singleton< SessionManager >::instance [static, protected, inherited] |
Definition at line 91 of file singleton.h.
zmm::Ref<Mutex> Singleton< SessionManager >::mutex [static, protected, inherited] |
Reimplemented from zmm::Object.
Definition at line 90 of file singleton.h.
Referenced by containerChangedUI(), createSession(), getSession(), removeSession(), and timerNotify().
zmm::Ref<zmm::Array<Session> > SessionManager::sessions [protected] |
This array is holding available sessions.
Definition at line 119 of file session_manager.h.
Referenced by checkTimer(), containerChangedUI(), createSession(), getSession(), removeSession(), SessionManager(), and timerNotify().
bool Singleton< SessionManager >::singletonActive [static, protected, inherited] |
Definition at line 92 of file singleton.h.
bool SessionManager::timerAdded [protected] |
Definition at line 124 of file session_manager.h.
Referenced by checkTimer(), and SessionManager().
1.6.1