gloox  1.1-svn
Classes | Public Types | Public Member Functions | List of all members
Session Class Reference

#include <jinglesession.h>

Inheritance diagram for Session:
Inheritance graph
[legend]

Classes

class  Jingle
 This is an abstraction of the XEP-0166 (Jingle) <jingle> element as a StanzaExtension. More...
class  Reason
 An abstraction of a terminate reason. More...

Public Types

enum  State { Ended, Pending, Active }

Public Member Functions

 Session (ClientBase *parent, const JID &callee, SessionHandler *jsh)
 Session (ClientBase *parent, const Session::Jingle *jingle, SessionHandler *jsh)
virtual ~Session ()
bool initiate (const PluginList &plugins)
bool accept (const Content *content)
bool inform (Action action, const Plugin *plugin)
bool terminate (Reason *reason)
State state () const
const std::string & sid () const
virtual bool handleIq (const IQ &iq)
virtual void handleIqID (const IQ &iq, int context)
- Public Member Functions inherited from IqHandler
virtual ~IqHandler ()

Detailed Description

This is an implementation of a Jingle Session (XEP-0166).

Beware! The classes in the Jingle namespace implement the signaling part of Jingle only. At this point, there is no support for actually establishing any connection to a remote entity, nor for transfering any media in any way whatsoever.

XEP Version: 0.33

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
1.1

Definition at line 84 of file jinglesession.h.

Member Enumeration Documentation

enum State

Session state.

Enumerator:
Ended 

The session has ended or was not active yet.

Pending 

The session has been initiated but has not yet been accepted by the remote party.

Active 

The session is empty.

Definition at line 91 of file jinglesession.h.

Constructor & Destructor Documentation

Session ( ClientBase parent,
const JID callee,
SessionHandler jsh 
)

Creates a new Jingle Session.

Parameters
parentThe ClientBase to use for communication.
calleeThe remote end of the session.
jshThe handler to receive events and results.

Definition at line 216 of file jinglesession.cpp.

Session ( ClientBase parent,
const Session::Jingle jingle,
SessionHandler jsh 
)

Creates a new Session from the incoming Jingle object. This is a NOOP for Jingles that have an action() different from SessionInitiate.

Parameters
paramThe ClientBase to use for communication.
jingleThe Jingle object to init the Session from.
jshThe handler to receive events and results.

Definition at line 230 of file jinglesession.cpp.

~Session ( )
virtual

Virtual Destructor.

Definition at line 244 of file jinglesession.cpp.

Member Function Documentation

bool accept ( const Content content)

Accepts an incoming session with the given content.

Parameters
contentA pair of Description and Transport that describe the accepted session parameters.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 264 of file jinglesession.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, a 'error' will be sent.
Since
1.0

Implements IqHandler.

Definition at line 306 of file jinglesession.cpp.

void handleIqID ( const IQ iq,
int  context 
)
virtual

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 378 of file jinglesession.cpp.

bool inform ( Action  action,
const Plugin plugin 
)

Sends an informational message (DescriptionInfo, TransportInfo, SessionInfo) to the remote party.

Parameters
actionThe type of message to send.
pluginThe payload. May be 0.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 278 of file jinglesession.cpp.

bool initiate ( const PluginList plugins)

Initiates a session with a remote entity.

Parameters
pluginsA list of Content-derived objects.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 250 of file jinglesession.cpp.

const std::string& sid ( ) const
inline

Returns the session's ID.

Returns
The session's ID.

Definition at line 357 of file jinglesession.h.

State state ( ) const
inline

Returns the session's state.

Returns
The session's state.

Definition at line 351 of file jinglesession.h.

bool terminate ( Session::Reason reason)

Terminates the current session, if it is at least in Pending state, with the given reason. The sid parameter is ignored unless the reason is AlternativeSession.

Parameters
reasonThe reason for terminating the session.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 292 of file jinglesession.cpp.


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