# class JBEntityCapsList | Entity capability list manager. More...
Full name | `TelEngine::JBEntityCapsList`
Definition | `#include <libs/yjabber/yatejabber.h>`
Inherits | TelEngine::Mutex [public ], TelEngine::ObjList [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- inline JBEntityCapsList ()
- inline JBEntityCaps* findCaps (const String& id)
- void expire (u_int64_t msecNow = Time::msecNow())
- bool processRsp (XmlElement* rsp, const String& id, bool ok)
- void requestCaps (JBStream* stream, const char* from, const char* to, const String& id, char version, const char* node, const char* data)
- XmlDocument* toDocument (const char* rootName = "entitycaps")
- void fromDocument (XmlDocument& doc, const char* rootName = "entitycaps")
- virtual bool processCaps (String& capsId, XmlElement* xml, JBStream* stream, const char* from, const char* to)
- inline void addCaps (NamedList& list, const String& id)
- virtual void addCaps (NamedList& list, JBEntityCaps& caps)
- bool loadXmlDoc (const char* file, DebugEnabler* enabler = 0)
- bool saveXmlDoc (const char* file, DebugEnabler* enabler = 0)

#### Public Static Methods

- static bool decodeCaps (const XmlElement& xml, char& version, String*& node, String*& ver, String*& ext)

#### Public Members

- bool m_enable

#### Protected Methods

- virtual void capsAdded (JBEntityCaps* caps)

#### Protected Members

- unsigned int m_reqIndex
- String m_reqPrefix
- ObjList m_requests

## Detailed Description

This class holds data and offer entity capability services. Implements XEP 0115 support

inline JBEntityCapsList () | ### JBEntityCapsList

Constructor

inline JBEntityCaps* findCaps (const String& id) | ### findCaps

Retrieve an entity caps object. This method is not thread safe

Parameters:

id | The id to find

Returns: JBEntityCaps pointer or 0

void expire (u_int64_t msecNow = Time::msecNow()) | ### expire

Expire pending requests. This method is thread safe

Parameters:

msecNow | Current time

bool processRsp (XmlElement* rsp, const String& id, bool ok) | ### processRsp

Process a response. This method is thread safe

Parameters:

rsp | The element to process
id | The element's id
ok | True if the response is a result one, false if it's an error

Returns: True if the element was processed (handled)

void requestCaps (JBStream* stream, const char* from, const char* to, const String& id, char version, const char* node, const char* data) | ### requestCaps

Request entity capabilities. This method is thread safe

Parameters:

stream | The stream to send the request
from | The 'from' attribute
to | The 'to' attribute
id | Entity caps id
version | Entity caps version
node | Entity node
data | Entity caps data

XmlDocument* toDocument (const char* rootName = "entitycaps") | ### toDocument

Build an XML document from this list. This method is thread safe

Parameters:

rootName | Document root element name

Returns: XmlDocument pointer

void fromDocument (XmlDocument& doc, const char* rootName = "entitycaps") | ### fromDocument

Build this list from an XML document. This method is thread safe

Parameters:

doc | Document to build from
rootName | Document root element name (it will be checked if set)

Returns: XmlDocument pointer

bool processCaps (String& capsId, XmlElement* xml, JBStream* stream, const char* from, const char* to) | ### processCaps

[virtual]

Process an element containing an entity capabily child. Request capabilities if not found in the list. This method is thread safe

Parameters:

capsId | String to be filled with entity caps object id (empty if an entity caps child is not found in element )
xml | XML element to process
stream | The stream used to request capabilities
from | The 'from' attribute of the request stanza
to | The 'to' attribute of the request stanza

Returns: True if processed (already found, added or request sent)

inline void addCaps (NamedList& list, const String& id) | ### addCaps

Add capabilities to a list. This method is thread safe

Parameters:

list | Destination list
id | Entity caps id

void addCaps (NamedList& list, JBEntityCaps& caps) | ### addCaps

[virtual]

Add capabilities to a list. This method is not thread safe

Parameters:

list | Destination list
caps | Entity caps to add

bool loadXmlDoc (const char* file, DebugEnabler* enabler = 0) | ### loadXmlDoc

Load (reset) this list from an XML document file. This method is thread safe

Parameters:

file | The file to load
enabler | The debug enabler used to output messages

Returns: True on success

bool saveXmlDoc (const char* file, DebugEnabler* enabler = 0) | ### saveXmlDoc

Save this list to an XML document file. This method is thread safe

Parameters:

file | The file to save
enabler | The debug enabler used to output messages

Returns: True on success

bool decodeCaps (const XmlElement& xml, char& version, String*& node, String*& ver, String*& ext) | ### decodeCaps

[static]

Check if an XML element has a 'c' entity capability child and decode it

Parameters:

xml | The element to process
version | Entity caps version
node | Entity node attribute
ver | Entity ver attribute
ext | Entity ext attribute if version is less the 1.4

Returns: True if a child was succesfully decoded

bool m_enable | ### m_enable

void capsAdded (JBEntityCaps* caps) | ### capsAdded

[protected virtual]

Caps list item add notification for descendants. This method is called when processing responses with the list locked

Parameters:

caps | Changed caps object. 0 if none specified

unsigned int m_reqIndex | ### m_reqIndex

[protected]

String m_reqPrefix | ### m_reqPrefix

[protected]

ObjList m_requests | ### m_requests

[protected]

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.