Yate
Public Member Functions | Protected Member Functions | Protected Attributes
JBServerEngine Class Reference

A Jabber server engine. More...

#include <yatejabber.h>

Inheritance diagram for JBServerEngine:
JBEngine DebugEnabler Mutex GenObject Lockable

List of all members.

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)
JBServerStreamfindServerStream (const String &local, const String &remote, bool out, bool auth=true)
JBServerStreamcreateServerStream (const String &local, const String &remote, const char *dbId=0, const char *dbKey=0, bool dbOnly=false, const NamedList *params=0)
JBServerStreamcreateCompStream (const String &name, const String &local, const String &remote, const NamedList *params=0)
JBClusterStreamfindClusterStream (const String &remote, JBClusterStream *skip=0)
virtual JBClusterStreamcreateClusterStream (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
JBStreamSetListm_c2sReceive
JBStreamSetListm_c2sProcess
JBStreamSetListm_s2sReceive
JBStreamSetListm_s2sProcess
JBStreamSetListm_compReceive
JBStreamSetListm_compProcess
JBStreamSetListm_clusterReceive
JBStreamSetListm_clusterProcess

Detailed Description

A Jabber server engine.

This class implements a Jabber server engine


Constructor & Destructor Documentation

JBServerEngine ( const char *  name = "jbserverengine")

Constructor

Parameters:
nameEngine name

Destructor


Member Function Documentation

virtual void addStream ( JBStream stream) [protected, virtual]

Add a stream to one of the stream lists

Parameters:
streamThe stream to add

Reimplemented from JBEngine.

virtual void buildStreamName ( String name,
const JBStream stream 
) [inline, virtual]

Build an internal stream name

Parameters:
nameDestination buffer
streamStream requesting it

Reimplemented from JBEngine.

virtual void cleanup ( bool  final = false,
bool  waitTerminate = true 
) [virtual]

Terminate all streams. Stop all sets processors. Release memory if final

Parameters:
finalTrue if called from destructor
waitTerminateTrue 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

Parameters:
localLocal party domain
remoteRemote party domain
paramsOptional stream parameters
Returns:
Referenced JBClusterStream pointer or 0 if a stream already exists
JBServerStream* createCompStream ( const String name,
const String local,
const String remote,
const NamedList params = 0 
)

Create an outgoing comp stream.

Parameters:
nameStream name
localLocal party domain
remoteRemote party domain
paramsOptional stream parameters
Returns:
Referenced JBServerStream pointer or 0 if a stream already exists
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.

Parameters:
localLocal party domain
remoteRemote party domain
dbIdOptional dialback id (stream id)
dbKeyOptional dialback key to verify
dbOnlyTrue if this is a dialback only stream
paramsOptional stream parameters
Returns:
Referenced JBServerStream pointer or 0 if a stream already exists
JBClusterStream* findClusterStream ( const String remote,
JBClusterStream skip = 0 
)

Find a cluster stream by remote domain. This method is thread safe

Parameters:
remoteRemote jid
skipOptional stream to skip
Returns:
Referenced JBClusterStream pointer or 0
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

Parameters:
localLocal domain
remoteRemote domain
outTrue to find an outgoing stream, false to find an incoming one. Ignored for component streams
authCheck if the remote domain of an incoming s2s stream is authenticated
Returns:
Referenced JBServerStream pointer or 0
unsigned int getStreamIndex ( ) [inline, protected]

Increment and return the stream index counter

Returns:
Current stream index
virtual void getStreamList ( RefPointer< JBStreamSetList > &  list,
int  type 
) [protected, virtual]

Retrieve the list of streams of a given type

Parameters:
listThe destination list to set
typeStream type

Reimplemented from JBEngine.

virtual void getStreamListsType ( int  type,
RefPointer< JBStreamSetList > &  recv,
RefPointer< JBStreamSetList > &  process 
) [protected, virtual]

Retrieve the stream lists of a given type

Parameters:
typeStream type
recvReceive stream list to set
processProcess stream list to set
virtual void removeStream ( JBStream stream,
bool  delObj = true 
) [protected, virtual]

Remove a stream

Parameters:
streamThe stream to remove
delObjTrue 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

Parameters:
waitTerminateTrue 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

Parameters:
jidClient JID
errorOptional error to be sent to the client
reasonOptional error text to be sent to the client
Returns:
The number of stream terminated

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