JBMessage Class Reference

A Jabber message service. More...

#include <yatejabber.h>

Inheritance diagram for JBMessage:

JBService JBThreadList DebugEnabler Mutex GenObject

List of all members.

Public Types

enum  MsgType {
  Chat, GroupChat, HeadLine, Normal,
  Error, None
}

Public Member Functions

 JBMessage (JBEngine *engine, const NamedList *params, int prio=0)
virtual ~JBMessage ()
virtual void initialize (const NamedList &params)
JBEventgetMessage ()
virtual void processMessage (JBEvent *event)

Static Public Member Functions

static XMLElementcreateMessage (MsgType type, const char *from, const char *to, const char *id, const char *message)
static MsgType msgType (const char *text)
static const char * msgText (MsgType msg)

Static Public Attributes

static TokenDict s_msg []

Protected Member Functions

virtual bool accept (JBEvent *event, bool &processed, bool &insert)


Detailed Description

A Jabber message service.

This class is a message receiver service for the Jabber engine


Member Enumeration Documentation

enum MsgType

Message type enumeration


Constructor & Destructor Documentation

JBMessage ( JBEngine engine,
const NamedList params,
int  prio = 0 
) [inline]

Constructor. Constructs a Jabber message service

Parameters:
engine The Jabber engine
params Service's parameters
prio The priority of this service

References JBThreadList::setOwner().

virtual ~JBMessage (  )  [inline, virtual]

Destructor. Cancel private thread(s)


Member Function Documentation

virtual bool accept ( JBEvent event,
bool &  processed,
bool &  insert 
) [protected, virtual]

Accept an event from the engine and process it if configured to do that

Parameters:
event The event to accept
processed Set to true on exit to signal that the event was already processed
insert Set to true if accepted to insert on top of the event queue
Returns:
False if not accepted, let the engine try another service

Reimplemented from JBService.

static XMLElement* createMessage ( MsgType  type,
const char *  from,
const char *  to,
const char *  id,
const char *  message 
) [static]

Create a 'message' element

Parameters:
type Message type as enumeration
from The 'from' attribute
to The 'to' attribute
id The 'id' attribute
message The message body
Returns:
A valid XMLElement pointer

Referenced by JGSession::sendMessage().

JBEvent* getMessage (  )  [inline]

Get a message from queue

Returns:
JBEvent pointer or 0 if no messages

virtual void initialize ( const NamedList params  )  [virtual]

Initialize the service

Parameters:
params Service's parameters

Reimplemented from JBService.

static const char* msgText ( MsgType  msg  )  [inline, static]

Get the text from a message type

Parameters:
msg The message type
Returns:
The associated text or 0

References TelEngine::lookup().

static MsgType msgType ( const char *  text  )  [inline, static]

Get the type of a 'message' stanza

Parameters:
text The text to check
Returns:
Message type as enumeration

References TelEngine::lookup().

virtual void processMessage ( JBEvent event  )  [virtual]

Message processor. The derived classes must override this method to process received messages

Parameters:
event The event to process


Member Data Documentation

TokenDict s_msg[] [static]

Keep the types of 'message' stanzas


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

Generated on Sun Dec 7 21:36:13 2008 for Yate by  doxygen 1.5.7.1