class JBClientStream

A client to server stream. More...

Full nameTelEngine::JBClientStream
Definition#include <libs/yjabber/yatejabber.h>
InheritsTelEngine::JBStream [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

This class holds a client to server stream

 JBClientStream (JBEngine* engine, Socket* socket, bool ssl = false)

JBClientStream

Constructor. Build an incoming stream from a socket

Parameters:
engineEngine owning this stream
socketThe socket
sslTrue if the socket is already using SSL/TLS

 JBClientStream (JBEngine* engine, const JabberID& jid, const String& account, const NamedList& params, const char* name = 0)

JBClientStream

Constructor. Build an outgoing stream

Parameters:
engineEngine owning this stream
jidUser jid
accountAccount (stream) name
paramsStream parameters
nameOptional stream name

inline const String&  account ()

account

[const]

Retrieve stream's account

Returns: Stream account

inline GenObject*  userData ()

userData

Retrieve stream's user data

Returns: GenObject pointer or 0

inline void  userData (GenObject* data)

userData

Set stream's user data. Transfer data ownership to the stream This method is thread safe

Parameters:
dataData to set

JBClientStream*  clientStream ()

clientStream

[virtual]

Get a client stream from this one

Returns: JBClientStream pointer

Reimplemented from JBStream.

void  bind (const String& resource, const char* id, XMPPError::Type error = XMPPError::NoError)

bind

Bind a resource to an incoming stream. This method should be called after processing a Bind event This method is thread safe

Parameters:
resourceResource to bind. Empty on error
idReceived bind request id
errorFailure reason. Ignored on success

bool  requestRegister (bool data, bool set = true, const String& newPass = String::empty())

requestRegister

Request account register or change on outgoing stream. This method is thread safe

Parameters:
dataTrue to request registration/change, false to request info
setTrue to request new user registration, false to remove account from server
newPassNew password when requesting account setup on an already authenticated stream

Returns: True on success

bool  processRunning (XmlElement* xml, const JabberID& from, const JabberID& to)

processRunning

[protected virtual]

Process elements in Running state

Parameters:
xmlReceived element (will be consumed)
fromAlready parsed source JID
toAlready parsed destination JID

Returns: False if stream termination was initiated

Reimplemented from JBStream.

bool  processStart (const XmlElement* xml, const JabberID& from, const JabberID& to)

processStart

[protected virtual]

Process stream start elements while waiting for them

Parameters:
xmlReceived xml element
fromThe 'from' attribute
toThe 'to' attribute

Returns: False if stream termination was initiated

Reimplemented from JBStream.

bool  processAuth (XmlElement* xml, const JabberID& from, const JabberID& to)

processAuth

[protected virtual]

Process elements in Auth state

Parameters:
xmlReceived element (will be consumed)
fromAlready parsed source JID
toAlready parsed destination JID

Returns: False if stream termination was initiated

Reimplemented from JBStream.

bool  processRegister (XmlElement* xml, const JabberID& from, const JabberID& to)

processRegister

[protected virtual]

Process elements in Register state

Parameters:
xmlReceived element (will be consumed)
fromAlready parsed source JID
toAlready parsed destination JID

Returns: False if stream termination was initiated

Reimplemented from JBStream.

void  destroyed ()

destroyed

[protected virtual]

Release memory

Reimplemented from JBStream.

bool  startAuth ()

startAuth

[protected]

Start outgoing stream authentication

Returns: True on success

bool  bind ()

bind

[protected]

Start resource binding on outgoing stream

Returns: True on success


Generated by: paulc on bussard on Tue Apr 12 17:15:21 2011, using kdoc 2.0a54.