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

#include <jinglesessionmanager.h>

Inheritance diagram for SessionManager:
Inheritance graph
[legend]

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

Note
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.

Author
Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
Since
1.0.5

Definition at line 59 of file jinglesessionmanager.h.

Constructor & Destructor Documentation

SessionManager ( ClientBase parent,
SessionHandler sh 
)

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

Parameters
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 ( )
virtual

Virtual destructor.

Definition at line 39 of file jinglesessionmanager.cpp.

Member Function Documentation

Session * createSession ( const JID callee,
SessionHandler handler 
)

Lets you create a new Jingle session.

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

Definition at line 59 of file jinglesessionmanager.cpp.

void discardSession ( Session session)

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

Parameters
sessionThe session to delete.

Definition at line 69 of file jinglesessionmanager.cpp.

bool handleIq ( const IQ iq)
virtual

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

Parameters
iqThe complete IQ stanza.
Returns
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.
Since
1.0

Implements IqHandler.

Definition at line 78 of file jinglesessionmanager.cpp.

virtual void handleIqID ( const IQ iq,
int  context 
)
inlinevirtual

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 positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.

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

Implements IqHandler.

Definition at line 101 of file jinglesessionmanager.h.

void registerPlugin ( Plugin plugin)

Registers an empty Plugin as a template with the manager.

Parameters
pluginThe plugin to register.

Definition at line 44 of file jinglesessionmanager.cpp.


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