gloox  1.0.27
Public Member Functions | List of all members
SessionManager Class Reference

#include <jinglesessionmanager.h>

Inheritance diagram for SessionManager:
Inheritance graph

Public Member Functions

 SessionManager (ClientBase *parent, SessionHandler *sh)
virtual ~SessionManager ()
void registerPlugin (Plugin *plugin)
SessioncreateSession (const JID &callee, SessionHandler *handler)
void discardSession (Session *session)
virtual bool handleIq (const IQ &iq)
virtual void handleIqID (const IQ &, int)
- Public Member Functions inherited from IqHandler
virtual ~IqHandler ()

Detailed Description

The SessionManager is responsible for creating and destroying Jingle sessions, as well as for delegating incoming IQs to their respective sessions. This is part of Jingle (XEP-0166).

The classes in the Jingle namespace implement the signaling part of Jingle only. Establishing connections to a remote entity or transfering data outside the XMPP channel is out of scope of gloox.

To use Jingle with gloox you should first instantiate a Jingle::SessionManager. The SessionManager will let you create new Jingle sessions and notify the respective handler about incoming Jingle session requests. It will also announce generic Jingle support via Disco. You have to register any Jingle plugins you want to use using registerPlugin(). These will automatically announce any additional features via Disco.

Use createSession() to create a new Session.

Implement SessionHandler::handleIncomingSession() to receive incoming session requests.

Use discardSession() to get rid of a session. Do not delete a session manually.

There is no limit to the number of concurrent sessions.

Jakob Schröter

Definition at line 59 of file jinglesessionmanager.h.

Constructor & Destructor Documentation

◆ SessionManager()

SessionManager ( ClientBase parent,
SessionHandler sh 

Creates new instance. There should be only one SessionManager per ClientBase.

parentA ClientBase instance used for sending and receiving.
shA session handler that will be notified about incoming session requests. Only handleIncomingSession() will be called in that handler.

Definition at line 28 of file jinglesessionmanager.cpp.

◆ ~SessionManager()

~SessionManager ( )

Virtual destructor.

Definition at line 39 of file jinglesessionmanager.cpp.

Member Function Documentation

◆ createSession()

Session * createSession ( const JID callee,
SessionHandler handler 

Lets you create a new Jingle session.

calleeThe remote entity's JID.
handlerThe handler responsible for handling events assicoated with the new session.
The new session.
You should not delete a session yourself. Instead, pass it to discardSession().

Definition at line 59 of file jinglesessionmanager.cpp.

◆ discardSession()

void discardSession ( Session session)

Removes a given session from the nternal queue and deletes it.

sessionThe session to delete.

Definition at line 69 of file jinglesessionmanager.cpp.

◆ handleIq()

bool handleIq ( const IQ iq)

Reimplement this function if you want to be notified about incoming IQs.

iqThe complete IQ stanza.
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, an 'error' will be sent back.

Implements IqHandler.

Definition at line 78 of file jinglesessionmanager.cpp.

◆ handleIqID()

virtual void handleIqID ( const IQ iq,
int  context 

Reimplement this function if you want to be notified about incoming IQs with a specific value of the id attribute. You have to enable tracking of those IDs using Client::trackID(). This is usually useful for IDs that generate a empty positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.

iqThe complete IQ stanza.
contextA value to restore context, stored with ClientBase::trackID().
Only IQ stanzas of type 'result' or 'error' can arrive here.

Implements IqHandler.

Definition at line 101 of file jinglesessionmanager.h.

◆ registerPlugin()

void registerPlugin ( Plugin plugin)

Registers an empty Plugin as a template with the manager.

pluginThe plugin to register.

Definition at line 44 of file jinglesessionmanager.cpp.

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