Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

Session Class Reference

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

#include <jinglesession.h>

Inherits IqHandler.

Inheritance diagram for Session:

Inheritance graph
[legend]
List of all members.

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)

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

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@camaya.net>
Since:
1.1

Definition at line 84 of file jinglesession.h.


Member Enumeration Documentation

enum State
 

Session state.

Enumeration values:
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:
parent The ClientBase to use for communication.
callee The remote end of the session.
jsh The 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:
param The ClientBase to use for communication.
jingle The Jingle object to init the Session from.
jsh The 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:
content A 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:
iq The 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:
iq The complete IQ stanza.
context A 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:
action The type of message to send.
plugin The 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:
plugins A 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 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:
reason The 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:
Generated on Tue May 4 16:35:20 2010 for gloox by  doxygen 1.4.1