#include <sm.h>
Public Member Functions |
| SM (Router &router, ConfigManager &cm, const gloox::LogSink &logInstance, RosterProvider *rp, bool threading=false, const gloox::JID &name=gloox::JID("sm."+GLOOXD_DOMAIN)) |
virtual | ~SM () |
void | run () |
bool | createSession (gloox::JID &jid, const std::string &id) |
bool | removeSession (const std::string &id) |
void | addPlugin (Plugin *p) |
void | dispatchPresence (const gloox::Tag *pres) |
bool | dispatchMessage (const gloox::Tag *msg) |
virtual void | handleDomainAdded (const std::string &domain) |
virtual void | handleDomainRemoved (const std::string &domain) |
virtual void | handleShutdown () |
| ComponentBase (Router &_router, ConfigManager &cm, const gloox::JID &_name, const gloox::LogSink &_logInstance) |
virtual | ~ComponentBase () |
const gloox::JID & | name () const |
Public Member Functions inherited from TagHandler |
virtual | ~TagHandler () |
Public Member Functions inherited from ConfigHandler |
virtual | ~ConfigHandler () |
virtual bool | handleC2SInterfaceAdded (const std::string &interface, int port) |
virtual bool | handleC2SInterfaceRemoved (const std::string &interface, int port) |
Detailed Description
Implements a client session manager.
- Author
- Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Definition at line 45 of file sm.h.
Constructor & Destructor Documentation
SM |
( |
Router & |
router, |
|
|
ConfigManager & |
cm, |
|
|
const gloox::LogSink & |
logInstance, |
|
|
RosterProvider * |
rp, |
|
|
bool |
threading = false , |
|
|
const gloox::JID & |
name = gloox::JID( "sm." + GLOOXD_DOMAIN ) |
|
) |
| |
Creates a new SessionManager.
- Parameters
-
router | The local Router. |
cm | The local ConfigManager. |
logInstance | The LogSink to use for logging. |
rp | A RosterProvider derived object that will provide the roster. |
threading | Whether this instance runs in its own thread. |
name | An internal name by which this SM is known. Default: sm. |
Definition at line 36 of file sm.cpp.
Virtual destructor.
Definition at line 44 of file sm.cpp.
Member Function Documentation
Adds a protocol handling plugin to this SM instance.
- Parameters
-
Definition at line 99 of file sm.h.
bool createSession |
( |
gloox::JID & |
jid, |
|
|
const std::string & |
id |
|
) |
| |
Checks whether a new session for the given JID can be created, and creates it if possible. A unique resource identifier will be assigned if none is given.
- Parameters
-
jid | The JID to create a session for. It may be modified (ie. the resource may be updated). |
id | The client's connection's ID. |
- Returns
- True if the session could be created successfully, false otherwise.
Definition at line 72 of file sm.cpp.
bool dispatchMessage |
( |
const gloox::Tag * |
msg | ) |
|
Sends message packets to their destinations.
- Parameters
-
msg | The message Tag to send. |
- Returns
- True if the message could be sent (i.e. if there's an open session for the recipient, false otherwise.
Definition at line 228 of file sm.cpp.
void dispatchPresence |
( |
const gloox::Tag * |
pres | ) |
|
Sends broadcast and unicast presence packets to their destinations.
- Parameters
-
pres | The presence Tag to send. |
Definition at line 157 of file sm.cpp.
void handleDomainAdded |
( |
const std::string & |
domain | ) |
|
|
virtual |
This function is called if a new domain has been added that the server supports.
- Parameters
-
Implements ConfigHandler.
Definition at line 293 of file sm.cpp.
void handleDomainRemoved |
( |
const std::string & |
domain | ) |
|
|
virtual |
This function is called if a domain has been removed.
- Parameters
-
domain | The removed domain. |
Implements ConfigHandler.
Definition at line 301 of file sm.cpp.
This function is called to prepare a server shutdown.
Implements ConfigHandler.
Definition at line 309 of file sm.cpp.
bool removeSession |
( |
const std::string & |
id | ) |
|
Removes the session (identified by its ID).
- Parameters
-
id | The ID of the session to be removed. |
- Returns
- True if a session was found and removed, false otherwise.
Definition at line 140 of file sm.cpp.
Starts processing incoming events. Blocks if the threading
parameter to the constructor is true.
Definition at line 56 of file sm.cpp.
The documentation for this class was generated from the following files: