class XMPPUser

An XMPP remote user. More...

Full nameTelEngine::XMPPUser
Definition#include <libs/yjingle/yatejabber.h>
InheritsTelEngine::Mutex [public ], TelEngine::RefObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

This class holds a remote XMPP user along with his resources and subscribe state.

 XMPPUser (XMPPUserRoster* local, const char* node, const char* domain, XMPPDirVal sub, bool subTo = true, bool sendProbe = true)

XMPPUser

Create a remote user.

Parameters:
localThe local (owner) user peer.
nodeThe node (username) of the remote peer.
domainThe domain of the remote peer.
subThe subscription state.
subToTrue to force a subscribe request to remote peer if not subscribed.
sendProbeTrue to probe the new user.

 ~XMPPUser ()

~XMPPUser

[virtual]

Destructor. Send unavailable if not already done.

inline const JabberID&  jid ()

jid

[const]

Get the jid of this user.

Returns: The jid of this user.

inline XMPPUserRoster*  local ()

local

[const]

Get the roster this user belongs to.

Returns: Pointer to the roster this user belongs to.

inline XMPPDirVal&  subscription ()

subscription

Get the subscription state of this user

Returns: The subscription state of this user

inline JIDResourceList&  localRes ()

localRes

Get the local resource list

Returns: The local resource list

inline JIDResourceList&  remoteRes ()

remoteRes

Get the remote resource list

Returns: The remote resource list

bool  addLocalRes (JIDResource* resource, bool send = true)

addLocalRes

Add a local resource to the list. Send presence if the remote peer is subscribed to the local one. This method is thread safe.

Parameters:
resourceThe resource to add.
sendTrue to send presence from the resource if it is a new one

Returns: False if the the resource already exists in the list.

void  removeLocalRes (JIDResource* resource)

removeLocalRes

Remove a local resource from the list. Send unavailable if the remote peer is subscribed to the local one. This method is thread safe.

Parameters:
resourceThe resource to remove.

void  clearLocalRes ()

clearLocalRes

Remove all local resources. Send unavailable if the remote peer is subscribed to the local one. This method is thread safe.

bool  addRemoteRes (JIDResource* resource)

addRemoteRes

Add a remote resource to the list. This method is thread safe.

Parameters:
resourceThe resource to add

Returns: False if the the resource already exists in the list

void  removeRemoteRes (JIDResource* resource)

removeRemoteRes

Remove a remote resource from the list. This method is thread safe.

Parameters:
resourceThe resource to remove

inline JIDResource*  getAudio (bool local, bool availableOnly = true)

getAudio

Get the first remote resource with audio capability.

Parameters:
localTrue to request a local resource, false for a remote one.
availableOnlyTrue to get only if available.

Returns: A pointer to the resource or 0.

void  processError (JBEvent* event)

processError

Process received error elements. This method is thread safe.

Parameters:
eventThe event with the element.

void  processProbe (JBEvent* event, const String* resName = 0)

processProbe

Process received probe from remote peer. This method is thread safe.

Parameters:
eventThe event with the element.
resNameThe probed resource if any.

bool  processPresence (JBEvent* event, bool available)

processPresence

Process received presence from remote peer. This method is thread safe.

Parameters:
eventThe event with the element.
availableThe availability of the user.

Returns: False if remote user has no more resources available.

void  processSubscribe (JBEvent* event, JBPresence::Presence type)

processSubscribe

Process received subscription from remote peer. This method is thread safe.

Parameters:
eventThe event with the element.
typeThe subscription type: subscribe/unsubscribe/subscribed/unsubscribed.

bool  probe (JBStream* stream, u_int64_t time = Time::msecNow())

probe

Probe the remote user. This method is thread safe.

Parameters:
streamOptional stream to use to send the request.
timeProbe time.

Returns: True if send succeedded.

bool  sendSubscribe (JBPresence::Presence type, JBStream* stream)

sendSubscribe

Send subscription to remote peer. This method is thread safe.

Parameters:
typeThe subscription type: subscribe/unsubscribe/subscribed/unsubscribed.
streamOptional stream to use to send the data.

Returns: True if send succeedded.

bool  sendUnavailable (JBStream* stream)

sendUnavailable

Send unavailable to remote peer. This method is thread safe.

Parameters:
streamOptional stream to use to send the data.

Returns: True if send succeedded.

bool  sendPresence (JIDResource* resource, JBStream* stream = 0, bool force = false)

sendPresence

Send presence to remote peer. This method is thread safe.

Parameters:
resourceThe resource to send from.
streamOptional stream to use to send the data.
forceTrue to send even if we've already sent presence from this resource.

Returns: True if send succeedded.

bool  timeout (u_int64_t time)

timeout

Check if this user sent us any presence data for a given interval. This method is thread safe.

Parameters:
timeCurrent time.

Returns: True if the user timed out.

void  notifyResource (bool remote, const String& name, JBStream* stream = 0, bool force = false)

notifyResource

Notify the state of a resource. This method is thread safe.

Parameters:
remoteTrue for a remote resource: notify the presence engine. False for a local resource: send presence to remote user.
nameResource name.
streamOptional stream to use to send the data if remote is false.
forceTrue to send even if we've already sent presence from this resource.

void  notifyResources (bool remote, JBStream* stream = 0, bool force = false)

notifyResources

Notify the state of all resources. This method is thread safe.

Parameters:
remoteTrue for remote resources: notify the presence engine. False for local resources: send presence to remote user.
streamOptional stream to use to send the data if remote is false.
forceTrue to send even if we've already sent presence from a resource.

void  updateSubscription (bool from, bool value, JBStream* stream)

updateSubscription

[protected]

Update subscription state.

Parameters:
fromTrue for subscription from remote user. False for subscription to the remote user.
valueTrue if subscribed. False is unsubscribed.
streamOptional stream to use to send presence if subscription from remote user changed to true.

void  updateTimeout (bool from, u_int64_t time = Time::msecNow())

updateTimeout

[protected]

Update user timeout data.

Parameters:
fromTrue if the update is made on incoming data. False if timeout is made on outgoing probe.
timeCurrent time.


Generated by: paulc on bussard on Mon Mar 8 12:18:15 2010, using kdoc 2.0a54.