SessionManager Class Reference

This class offers ways to create new sessoins, stores all available sessions and provides access to them. More...

#include <session_manager.h>

Inheritance diagram for SessionManager:
TimerSubscriberSingleton< SessionManager > TimerSubscriber Singleton< SessionManager > zmm::Object

Public Member Functions

 SessionManager ()
 Constructor, initializes the array.
virtual ~SessionManager ()
zmm::Ref< SessioncreateSession (long timeout)
 Creates a Session with a given timeout.
zmm::Ref< SessiongetSession (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< SessionManagergetInstance ()
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< Dictionaryaccounts
bool timerAdded
mt_atomic_t _ref_count

Static Protected Attributes

static zmm::Ref< Mutexmutex
static zmm::Ref< SessionManagerinstance
static bool singletonActive

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

void SessionManager::checkTimer (  )  [protected]
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.

Parameters:
objectID 

Definition at line 206 of file session_manager.cc.

References AUTOLOCK, Singleton< SessionManager >::mutex, and sessions.

Ref< Session > SessionManager::createSession ( long  timeout  ) 

Creates a Session with a given timeout.

Parameters:
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]
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.

Parameters:
ID of the Session.
Returns:
intance of the Session with a given ID or nil if no session with that ID was found.

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.

References accounts, and nil.

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]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

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]
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]
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]

Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]

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().

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().


The documentation for this class was generated from the following files:

Generated on Fri Mar 26 20:16:57 2010 for MediaTomb by  doxygen 1.6.1