Yate
|
A Jabber server engine. More...
#include <yatejabber.h>
Public Member Functions | |
JBServerEngine (const char *name="jbserverengine") | |
~JBServerEngine () | |
virtual void | cleanup (bool final=false, bool waitTerminate=true) |
virtual void | buildStreamName (String &name, const JBStream *stream) |
JBServerStream * | findServerStream (const String &local, const String &remote, bool out, bool auth=true) |
JBServerStream * | createServerStream (const String &local, const String &remote, const char *dbId=0, const char *dbKey=0, bool dbOnly=false, const NamedList *params=0) |
JBServerStream * | createCompStream (const String &name, const String &local, const String &remote, const NamedList *params=0) |
JBClusterStream * | findClusterStream (const String &remote, JBClusterStream *skip=0) |
virtual JBClusterStream * | createClusterStream (const String &local, const String &remote, const NamedList *params=0) |
unsigned int | terminateClientStreams (const JabberID &jid, XMPPError::Type error=XMPPError::NoError, const char *reason=0) |
Protected Member Functions | |
virtual void | addStream (JBStream *stream) |
virtual void | removeStream (JBStream *stream, bool delObj=true) |
virtual void | stopStreamSets (bool waitTerminate=true) |
virtual void | getStreamList (RefPointer< JBStreamSetList > &list, int type) |
virtual void | getStreamListsType (int type, RefPointer< JBStreamSetList > &recv, RefPointer< JBStreamSetList > &process) |
unsigned int | getStreamIndex () |
Protected Attributes | |
unsigned int | m_streamIndex |
JBStreamSetList * | m_c2sReceive |
JBStreamSetList * | m_c2sProcess |
JBStreamSetList * | m_s2sReceive |
JBStreamSetList * | m_s2sProcess |
JBStreamSetList * | m_compReceive |
JBStreamSetList * | m_compProcess |
JBStreamSetList * | m_clusterReceive |
JBStreamSetList * | m_clusterProcess |
A Jabber server engine.
This class implements a Jabber server engine
JBServerEngine | ( | const char * | name = "jbserverengine" | ) |
Constructor
name | Engine name |
~JBServerEngine | ( | ) |
Destructor
Add a stream to one of the stream lists
stream | The stream to add |
Reimplemented from JBEngine.
virtual void buildStreamName | ( | String & | name, |
const JBStream * | stream | ||
) | [inline, virtual] |
virtual void cleanup | ( | bool | final = false , |
bool | waitTerminate = true |
||
) | [virtual] |
Terminate all streams. Stop all sets processors. Release memory if final
final | True if called from destructor |
waitTerminate | True to wait for all streams to terminate |
Reimplemented from JBEngine.
virtual JBClusterStream* createClusterStream | ( | const String & | local, |
const String & | remote, | ||
const NamedList * | params = 0 |
||
) | [virtual] |
Create an outgoing cluster stream. This method is thread safe
local | Local party domain |
remote | Remote party domain |
params | Optional stream parameters |
JBServerStream* createCompStream | ( | const String & | name, |
const String & | local, | ||
const String & | remote, | ||
const NamedList * | params = 0 |
||
) |
Create an outgoing comp stream.
name | Stream name |
local | Local party domain |
remote | Remote party domain |
params | Optional stream parameters |
JBServerStream* createServerStream | ( | const String & | local, |
const String & | remote, | ||
const char * | dbId = 0 , |
||
const char * | dbKey = 0 , |
||
bool | dbOnly = false , |
||
const NamedList * | params = 0 |
||
) |
Create an outgoing s2s stream.
local | Local party domain |
remote | Remote party domain |
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 |
JBClusterStream* findClusterStream | ( | const String & | remote, |
JBClusterStream * | skip = 0 |
||
) |
Find a cluster stream by remote domain. This method is thread safe
remote | Remote jid |
skip | Optional stream to skip |
JBServerStream* findServerStream | ( | const String & | local, |
const String & | remote, | ||
bool | out, | ||
bool | auth = true |
||
) |
Find a server to server or component stream by local/remote domain. Skip over outgoing dialback only streams This method is thread safe
local | Local domain |
remote | Remote domain |
out | True to find an outgoing stream, false to find an incoming one. Ignored for component streams |
auth | Check if the remote domain of an incoming s2s stream is authenticated |
unsigned int getStreamIndex | ( | ) | [inline, protected] |
Increment and return the stream index counter
virtual void getStreamList | ( | RefPointer< JBStreamSetList > & | list, |
int | type | ||
) | [protected, virtual] |
virtual void getStreamListsType | ( | int | type, |
RefPointer< JBStreamSetList > & | recv, | ||
RefPointer< JBStreamSetList > & | process | ||
) | [protected, virtual] |
Retrieve the stream lists of a given type
type | Stream type |
recv | Receive stream list to set |
process | Process stream list to set |
virtual void removeStream | ( | JBStream * | stream, |
bool | delObj = true |
||
) | [protected, virtual] |
Remove a stream
stream | The stream to remove |
delObj | True to release the stream, false to remove it from list without releasing it |
Reimplemented from JBEngine.
virtual void stopStreamSets | ( | bool | waitTerminate = true | ) | [protected, virtual] |
Stop all stream sets
waitTerminate | True to wait for all streams to terminate |
Reimplemented from JBEngine.
unsigned int terminateClientStreams | ( | const JabberID & | jid, |
XMPPError::Type | error = XMPPError::NoError , |
||
const char * | reason = 0 |
||
) |
Terminate all incoming c2s streams matching a given JID This method is thread safe
jid | Client JID |
error | Optional error to be sent to the client |
reason | Optional error text to be sent to the client |