Yate
Public Member Functions | Protected Member Functions | Friends
JBClientStream Class Reference

A client to server stream. More...

#include <yatejabber.h>

Inheritance diagram for JBClientStream:
JBStream RefObject DebugEnabler Mutex GenObject Lockable

List of all members.

Public Member Functions

 JBClientStream (JBEngine *engine, Socket *socket, bool ssl=false)
 JBClientStream (JBEngine *engine, const JabberID &jid, const String &account, const NamedList &params, const char *name=0, const char *serverHost=0)
const Stringaccount () const
GenObjectuserData ()
void userData (GenObject *data)
virtual JBClientStreamclientStream ()
void bind (const String &resource, const char *id, XMPPError::Type error=XMPPError::NoError)
bool requestRegister (bool data, bool set=true, const String &newPass=String::empty())

Protected Member Functions

virtual bool processRunning (XmlElement *xml, const JabberID &from, const JabberID &to)
virtual bool processStart (const XmlElement *xml, const JabberID &from, const JabberID &to)
virtual bool processAuth (XmlElement *xml, const JabberID &from, const JabberID &to)
virtual bool processRegister (XmlElement *xml, const JabberID &from, const JabberID &to)
virtual void destroyed ()
bool startAuth ()
bool bind ()

Friends

class JBStream

Detailed Description

A client to server stream.

This class holds a client to server stream


Constructor & Destructor Documentation

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

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,
const char *  serverHost = 0 
)

Constructor. Build an outgoing stream

Parameters:
engineEngine owning this stream
jidUser jid
accountAccount (stream) name
paramsStream parameters
nameOptional stream name
serverHostOptional server host to use instead of jid domain

Member Function Documentation

const String& account ( ) const [inline]

Retrieve stream's account

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

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 bind ( ) [protected]

Start resource binding on outgoing stream

Returns:
True on success
virtual JBClientStream* clientStream ( ) [inline, virtual]

Get a client stream from this one

Returns:
JBClientStream pointer

Reimplemented from JBStream.

virtual void destroyed ( ) [protected, virtual]

Release memory

Reimplemented from JBStream.

virtual bool processAuth ( XmlElement xml,
const JabberID from,
const JabberID to 
) [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.

virtual bool processRegister ( XmlElement xml,
const JabberID from,
const JabberID to 
) [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.

virtual bool processRunning ( XmlElement xml,
const JabberID from,
const JabberID to 
) [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.

virtual bool processStart ( const XmlElement xml,
const JabberID from,
const JabberID to 
) [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 requestRegister ( bool  data,
bool  set = true,
const String newPass = String::empty() 
)

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 startAuth ( ) [protected]

Start outgoing stream authentication

Returns:
True on success
GenObject* userData ( ) [inline]

Retrieve stream's user data

Returns:
GenObject pointer or 0
void userData ( GenObject data) [inline]

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

Parameters:
dataData to set

References TelEngine::destruct().


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