Yate
Public Member Functions | Protected Member Functions | Friends

JBClientStream Class Reference

A Jabber client to server stream. More...

#include <yatejabber.h>

Inheritance diagram for JBClientStream:
JBStream RefObject GenObject

List of all members.

Public Member Functions

virtual ~JBClientStream ()
XMPPUserRosterroster ()
JIDResourcegetResource ()
virtual void * getObject (const String &name) const
XMPPUsergetRemote (const JabberID &jid)
virtual Error sendStanza (XMLElement *stanza, const char *senderId=0)

Protected Member Functions

 JBClientStream (JBEngine *engine, XMPPServerInfo &info, const JabberID &jid, const NamedList &params)
 JBClientStream (JBEngine *engine, const JabberID &jid, const String &password, const SocketAddr &address, bool autoRestart, unsigned int maxRestart, u_int64_t incRestartInterval, bool allowPlainAuth=false, bool outgoing=true)
virtual void streamRunning ()
virtual void processRunning (XMLElement *xml)
virtual bool checkDestination (XMLElement *xml, bool &respond)

Friends

class JBEngine

Detailed Description

A Jabber client to server stream.

This class holds a Jabber client stream used to connect an user to its server


Constructor & Destructor Documentation

virtual ~JBClientStream ( ) [virtual]

Destructor

JBClientStream ( JBEngine engine,
XMPPServerInfo info,
const JabberID jid,
const NamedList params 
) [protected]

Constructor. Build an outgoing stream

Parameters:
engineThe engine that owns this stream
infoStructure containing data used to connect to remote server
jidClient's full Jabber ID
paramsOther stream parameters
JBClientStream ( JBEngine engine,
const JabberID jid,
const String password,
const SocketAddr address,
bool  autoRestart,
unsigned int  maxRestart,
u_int64_t  incRestartInterval,
bool  allowPlainAuth = false,
bool  outgoing = true 
) [protected]

Constructor

Parameters:
engineThe engine that owns this stream
jidUser's JID
passwordPassword used for authentication
addressThe remote address to connect to
autoRestartTrue to auto restart the stream
maxRestartThe maximum restart attempts allowed
incRestartIntervalThe interval to increase the restart counter
allowPlainAuthAllow plain text password authentication
outgoingStream direction

Member Function Documentation

virtual bool checkDestination ( XMLElement xml,
bool &  respond 
) [protected, virtual]

Check the 'to' attribute of a received element against the local jid. Accept empty or bare/full jid match. Set the 'to' attribute to local jid if empty

Parameters:
xmlThe received element
respondAction to be taken if not accepted. Always false on exit
Returns:
False to reject it

Reimplemented from JBStream.

virtual void* getObject ( const String name) const [virtual]

Get an object from this stream

Parameters:
nameThe name of the object to get
Returns:
Pointer to the object or 0 if not found

Reimplemented from JBStream.

XMPPUser* getRemote ( const JabberID jid)

Get a remote user from roster

Parameters:
jidThe user's bare jid
Returns:
Referenced XMPPUser object or 0 if not found
JIDResource* getResource ( ) [inline]

Get the client's resource

Returns:
The client's resource
virtual void processRunning ( XMLElement xml) [protected, virtual]

Process a received stanza in Running state

Parameters:
xmlValid XMLElement pointer

Reimplemented from JBStream.

XMPPUserRoster* roster ( ) [inline]

Get the roster of this stream's client

Returns:
Valid XMPPUserRoster
virtual Error sendStanza ( XMLElement stanza,
const char *  senderId = 0 
) [virtual]

Send a stanza. This method is thread safe

Parameters:
stanzaElement to send
senderIdOptional sender's id. Used for notification events
Returns:
The result of posting the stanza

Reimplemented from JBStream.

virtual void streamRunning ( ) [protected, virtual]

Notification from parent when steam is authenticated: get roster from server

Reimplemented from JBStream.


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