|
|
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:
engine | Engine owning this stream |
socket | The socket |
component | True 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:
engine | Engine owning this stream |
local | Local party jabber id |
remote | Remote party jabber id |
dbId | Optional dialback id (stream id) |
dbKey | Optional dialback key to verify |
dbOnly | True if this is a dialback only stream |
params | Optional 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:
domain | Domain to check |
auth | Check 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:
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
rsp | The 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:
from | The 'from' attribute |
to | The 'to' attribute |
rsp | The 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:
local | Local domain |
remote | Remote 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:
xml | Received element (will be consumed) |
from | Already parsed source JID |
to | Already 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:
xml | Received xml element |
from | The 'from' attribute |
to | The '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:
xml | Received element (will be consumed) |
from | Already parsed source JID |
to | Already 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:
xml | Received element (will be consumed) |
from | Already parsed source JID |
to | Already 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:
rsp | The response to adjust |
NamedList m_remoteDomains | m_remoteDomains |
[protected]
Generated by: paulc on bussard on Tue Apr 12 17:15:21 2011, using kdoc 2.0a54. |