gloox  1.0.9
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 Jingle's (XEP-0166) <jingle> element as a StanzaExtension. More...
class  Reason
 An abstraction of a Jingle (XEP-0166) session terminate reason. More...

Public Types

enum  State { Ended, Pending, Active }

Public Member Functions

virtual ~Session ()
bool contentAccept (const Content *content)
bool contentAdd (const Content *content)
bool contentAdd (const PluginList &contents)
bool contentModify (const Content *content)
bool contentReject (const Content *content)
bool contentRemove (const Content *content)
bool descriptionInfo (const Plugin *info)
bool securityInfo (const Plugin *info)
bool sessionAccept (const Content *content)
bool sessionInfo (const Plugin *info)
bool sessionInitiate (const Content *content)
bool sessionInitiate (const PluginList &plugins)
bool sessionTerminate (Session::Reason *reason)
bool transportAccept (const Content *content)
bool transportInfo (const Plugin *info)
bool transportReject (const Content *content)
bool transportReplace (const Content *content)
State state () const
void setSID (const std::string &sid)
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).

See Jingle::SessionManager for info on how to use Jingle in gloox.

XEP Version: 1.1

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

Definition at line 80 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 active.

Definition at line 89 of file jinglesession.h.

Constructor & Destructor Documentation

~Session ( )
virtual

Virtual Destructor.

Definition at line 251 of file jinglesession.cpp.

Member Function Documentation

bool contentAccept ( const Content content)

Sends a 'content-accept' notification.

Parameters
contentThe accepted content.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 257 of file jinglesession.cpp.

bool contentAdd ( const Content content)

Sends a 'content-add' request.

Parameters
contentThe proposed content to be added.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 265 of file jinglesession.cpp.

bool contentAdd ( const PluginList contents)

Sends a 'content-add' request.

Parameters
contentsA list of proposed content to be added.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 273 of file jinglesession.cpp.

bool contentModify ( const Content content)

Sends a 'content-modify' request.

Parameters
contentThe proposed content type to be modified.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 281 of file jinglesession.cpp.

bool contentReject ( const Content content)

Sends a 'content-reject' reply.

Parameters
contentThe rejected content.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 289 of file jinglesession.cpp.

bool contentRemove ( const Content content)

Sends a 'content-remove' request.

Parameters
contentThe content type to be removed.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 297 of file jinglesession.cpp.

bool descriptionInfo ( const Plugin info)

Sends a 'description-info' notice.

Parameters
infoThe payload.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 305 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, an 'error' will be sent.
Since
1.0

Implements IqHandler.

Definition at line 417 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 447 of file jinglesession.cpp.

bool securityInfo ( const Plugin info)

Sends a 'security-info' notice.

Parameters
infoA security pre-condition.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 313 of file jinglesession.cpp.

bool sessionAccept ( const Content content)

Accepts an incoming session with the given content.

Parameters
contentA pair of application description and transport method wrapped in a Content that describes the accepted session parameters.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 321 of file jinglesession.cpp.

bool sessionInfo ( const Plugin info)

Sends a 'session-info' notice.

Parameters
infoThe payload.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 330 of file jinglesession.cpp.

bool sessionInitiate ( const Content content)

Initiates a session with a remote entity.

Parameters
contentA Content object. You may use initiate( const PluginList& contents ) for more than one Content.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 338 of file jinglesession.cpp.

bool sessionInitiate ( const PluginList plugins)

Initiates a session with a remote entity.

Parameters
pluginsA list of Content objects. It is important to pass a (list of) Content objects here. Even though e.g. Jingle::ICEUDP are Plugin-derived, too, using anything other than Content here will result in erroneous behaviour at best. You may use sessionInitiate( const Content* content ) for just one Content.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 347 of file jinglesession.cpp.

bool sessionTerminate ( 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 356 of file jinglesession.cpp.

void setSID ( const std::string &  sid)
inline

Sets the session's ID.

Parameters
sidThe session's id.

Definition at line 458 of file jinglesession.h.

const std::string& sid ( ) const
inline

Returns the session's ID.

Returns
The session's ID.

Definition at line 464 of file jinglesession.h.

State state ( ) const
inline

Returns the session's state.

Returns
The session's state.

Definition at line 452 of file jinglesession.h.

bool transportAccept ( const Content content)

Sends a 'transport-accept' reply.

Parameters
contentThe accepted transport wrapped in a Content.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 366 of file jinglesession.cpp.

bool transportInfo ( const Plugin info)

Sends a 'transport-info' notice.

Parameters
infoThe payload.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 374 of file jinglesession.cpp.

bool transportReject ( const Content content)

Sends a 'transport-reject' reply.

Parameters
contentThe rejected transport wrapped in a Content.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 382 of file jinglesession.cpp.

bool transportReplace ( const Content content)

Sends a 'transport-replace' request.

Parameters
contentThe proposed transport to be replaced wrapped in a Content.
Returns
False if a prerequisite is not met, true otherwise.

Definition at line 390 of file jinglesession.cpp.


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