class JBServerStream

A server to server stream. More...

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

Public Methods

Protected Methods

Protected Members


Detailed Description

This class holds a server to server stream

 JBServerStream (JBEngine* engine, Socket* socket, bool component = false)

JBServerStream

Constructor. Build an incoming stream from a socket

Parameters:
engineEngine owning this stream
socketThe socket
componentTrue to build an external component stream

 JBServerStream (JBEngine* engine, const JabberID& local, const JabberID& remote, const char* dbId = 0, const char* dbKey = 0, bool dbOnly = false, const NamedList* params = 0)

JBServerStream

Constructor. Build an outgoing stream

Parameters:
engineEngine owning this stream
localLocal party jabber id
remoteRemote party jabber id
dbIdOptional dialback id (stream id)
dbKeyOptional dialback key to verify
dbOnlyTrue if this is a dialback only stream
paramsOptional stream parameters

inline bool  dialback ()

dialback

[const]

Check if this is an outgoing dialback stream

Returns: True if this stream is an outgoing dialback one

inline const NamedList&  remoteDomains ()

remoteDomains

[const]

Retrieve the list of remote domains. This method is not thread safe

Returns: The list of remote domains

inline bool  hasRemoteDomain (const String& domain, bool auth = true)

hasRemoteDomain

Check if this stream has an already authenticated remote domain. This method is not thread safe

Parameters:
domainDomain to check
authCheck if the domain is authenticated

Returns: True if a domain was found

inline NamedString*  takeDb ()

takeDb

Take the dialback key from this stream

Returns: NamedString pointer or 0 if there is no dialback key held by this stream

JBServerStream*  serverStream ()

serverStream

[virtual]

Get a server stream from this one

Returns: JBServerStream pointer

Reimplemented from JBStream.

bool  sendDbVerify (const char* from, const char* to, const char* id, XMPPError::Type rsp = XMPPError::NoError)

sendDbVerify

Send a dialback verify response

Parameters:
fromThe 'from' attribute
toThe 'to' attribute
idThe 'id' attribute
rspThe response as enumeration: set it to NoError if valid, NotAuthorized if invalid or any other error to send a db:verify error type

Returns: True on success

bool  sendDbResult (const JabberID& from, const JabberID& to, XMPPError::Type rsp = XMPPError::NoError)

sendDbResult

Send a dialback key response. Update the remote domains list. Terminate the stream if there are no more remote domains

Parameters:
fromThe 'from' attribute
toThe 'to' attribute
rspThe response as enumeration: set it to NoError if valid, NotAuthorized if invalid or any other error to send a db:result error type

Returns: True on success

bool  sendDialback ()

sendDialback

Send dialback data (key/verify)

Returns: False if stream termination was initiated

bool  startComp (const String& local, const String& remote)

startComp

Start a component stream (reply to received stream start)

Parameters:
localLocal domain
remoteRemote domain

Returns: True on success

void  destroyed ()

destroyed

[protected virtual]

Release memory

Reimplemented from JBStream.

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.

XmlElement*  buildStreamStart ()

buildStreamStart

[protected virtual]

Build a stream start XML element

Returns: XmlElement pointer

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  processDbResult (XmlElement* xml, const JabberID& from, const JabberID& to)

processDbResult

[protected]

Process dialback key (db:result) requests

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

Returns: False if stream termination was initiated

inline void  adjustDbRsp (XMPPError::Type& rsp)

adjustDbRsp

[protected]

Adjust a dialback response to avoid sending XEP 0220 'error' to a party not advertising rfc3920 version=1 (might not support it)

Parameters:
rspThe response to adjust

NamedList m_remoteDomains

m_remoteDomains

[protected]


Generated by: paulc on bussard on Fri Apr 1 18:17:10 2011, using kdoc 2.0a54.