OPAL
Version 3.10.10
|
#include <pres_ent.h>
Data Structures | |
struct | AuthorisationRequest |
struct | BuddyInfo |
Public Member Functions | |
virtual void | SetAOR (const PURL &aor) |
void | Internal_SendMessageToCommand (const OpalSendMessageToCommand &cmd) |
Initialisation | |
virtual bool | Open () |
virtual bool | IsOpen () const |
virtual bool | Close () |
Protected Member Functions | |
OpalPresentityCommand * | InternalCreateCommand (const char *cmdName) |
Protected Attributes | |
OpalManager * | m_manager |
PGloballyUniqueID | m_guid |
PURL | m_aor |
PStringOptions | m_attributes |
AuthorisationRequestNotifier | m_onAuthorisationRequestNotifier |
PresenceChangeNotifier | m_onPresenceChangeNotifier |
ReceivedMessageNotifier | m_onReceivedMessageNotifier |
PAtomicBoolean | m_open |
PMutex | m_notificationMutex |
bool | m_temporarilyUnavailable |
OpalPresenceInfo::State | m_localState |
our presentity state More... | |
PString | m_localStateNote |
Additional note attached to the. More... | |
Construction | |
OpalPresentity () | |
Construct the presentity class. More... | |
OpalPresentity (const OpalPresentity &other) | |
~OpalPresentity () | |
static OpalPresentity * | Create (OpalManager &manager, const PURL &url, const PString &scheme=PString::Empty()) |
Attributes | |
PStringOptions & | GetAttributes () |
< Get the attributes for this presentity. More... | |
virtual PStringArray | GetAttributeNames () const =0 |
Get all attribute types for this presentity class. More... | |
virtual PStringArray | GetAttributeTypes () const =0 |
const PURL & | GetAOR () const |
static const PCaselessString & | AuthNameKey () |
Key for authentication name attribute. More... | |
static const PCaselessString & | AuthPasswordKey () |
Key for authentication password attribute. More... | |
static const PCaselessString & | TimeToLiveKey () |
Key for Time-To-Live attribute, in seconds for underlying protocol. More... | |
Commands | |
enum | Authorisation { AuthorisationPermitted, AuthorisationDenied, AuthorisationDeniedPolitely, AuthorisationConfirming, AuthorisationRemove, NumAuthorisations } |
Authorisation modes for SetPresenceAuthorisation() More... | |
virtual bool | SubscribeToPresence (const PURL &presentity, bool subscribe=true, const PString ¬e=PString::Empty()) |
virtual bool | UnsubscribeFromPresence (const PURL &presentity) |
virtual bool | SetPresenceAuthorisation (const PURL &presentity, Authorisation authorisation) |
virtual bool | SetLocalPresence (OpalPresenceInfo::State state, const PString ¬e=PString::Empty()) |
virtual bool | GetLocalPresence (OpalPresenceInfo::State &state, PString ¬e) |
template<class cls > | |
__inline cls * | CreateCommand () |
virtual bool | SendCommand (OpalPresentityCommand *cmd) |
Indications (callbacks) | |
typedef PNotifierTemplate < const AuthorisationRequest & > | AuthorisationRequestNotifier |
typedef PNotifierTemplate < const OpalPresenceInfo & > | PresenceChangeNotifier |
virtual void | OnAuthorisationRequest (const AuthorisationRequest &request) |
void | SetAuthorisationRequestNotifier (const AuthorisationRequestNotifier ¬ifier) |
Set the notifier for the OnAuthorisationRequest() function. More... | |
virtual void | OnPresenceChange (const OpalPresenceInfo &info) |
void | SetPresenceChangeNotifier (const PresenceChangeNotifier ¬ifier) |
Set the notifier for the OnPresenceChange() function. More... | |
Instant Messaging | |
typedef PNotifierTemplate < const OpalIM & > | ReceivedMessageNotifier |
virtual bool | SendMessageTo (const OpalIM &message) |
virtual void | OnReceivedMessage (const OpalIM &message) |
void | SetReceivedMessageNotifier (const ReceivedMessageNotifier ¬ifier) |
Set the notifier for the OnPresenceChange() function. More... | |
Representation of a presence identity. This class contains an abstraction of the functionality for "presence" using a URL string as the "identity". The concrete class depends on the scheme of the identity URL.
The general architecture is that commands will be sent to the preentity concrete class via concrete versions of OpalPresentityCommand class. These may be protocol specific or one of the abstracted versions.
typedef PNotifierTemplate<const AuthorisationRequest &> OpalPresentity::AuthorisationRequestNotifier |
typedef std::list<BuddyInfo> OpalPresentity::BuddyList |
typedef PNotifierTemplate<const OpalPresenceInfo &> OpalPresentity::PresenceChangeNotifier |
typedef PNotifierTemplate<const OpalIM &> OpalPresentity::ReceivedMessageNotifier |
Authorisation modes for SetPresenceAuthorisation()
Enumerator | |
---|---|
AuthorisationPermitted | |
AuthorisationDenied | |
AuthorisationDeniedPolitely | |
AuthorisationConfirming | |
AuthorisationRemove | |
NumAuthorisations |
|
protected |
Construct the presentity class.
|
protected |
OpalPresentity::~OpalPresentity | ( | ) |
|
static |
Key for authentication name attribute.
|
static |
Key for authentication password attribute.
|
virtual |
Close the presentity.
|
static |
Create a concrete class based on the scheme of the URL provided.
manager | Manager for presentity |
url | URL for presence identity |
scheme | Overide the url scheme |
|
inline |
Low level function to create a command. As commands have protocol specific implementations, we use a factory to create them.
References InternalCreateCommand().
|
inlinevirtual |
References BuddyStatus_OK, and DeleteBuddyEx().
|
virtual |
Delete a buddy to the buddy list.
Referenced by DeleteBuddy().
|
inlinevirtual |
References BuddyStatus_OK, and DeleteBuddyListEx().
|
virtual |
Delete the buddy list.
Referenced by DeleteBuddyList().
|
inline |
Get the address-of-record for the presentity. This is typically a URL which represents our local identity in the presense system.
References m_aor.
|
pure virtual |
Get all attribute types for this presentity class.
|
inline |
< Get the attributes for this presentity.
Get all attribute names for this presentity class.
|
pure virtual |
|
inlinevirtual |
References BuddyStatus_OK, and GetBuddyEx().
|
virtual |
Get a specific buddy from the buddy list. Note the buddy.m_presentity field must be preset to the URI to search the buddy list for.
Referenced by GetBuddy().
|
inlinevirtual |
buddies | List of buddies |
References BuddyStatus_OK, and GetBuddyListEx().
|
virtual |
|
virtual |
Get our presence state
void OpalPresentity::Internal_SendMessageToCommand | ( | const OpalSendMessageToCommand & | cmd) |
|
protected |
Referenced by CreateCommand().
|
inlinevirtual |
Indicate if the presentity has been successfully opened.
References m_open.
|
virtual |
Callback when another presentity requests access to our presence. It is expected that the handler will call SetPresenceAuthorisation with whatever policy is appropriate.
Default implementation calls m_onRequestPresenceNotifier if non-NULL otherwise will authorise the request.
request | Authorisation request information |
|
virtual |
Callback when presentity has changed its state. Note if the m_entity and m_target fields of the OpalPresenceInfo structure are the same, then this indicates that the local presentity itself has successfully "registered" itself with the presence agent server.
Default implementation calls m_onPresenceChangeNotifier.
info | Info on other presentity that changed state |
|
virtual |
Callback when presentity receives a message
Default implementation calls m_onReceivedMessageNotifier.
message | incoming message |
|
virtual |
Open the presentity handler. This will perform whatever is required to allow this presentity to access servers etc for the underlying protocol. It may start open network channels, start threads etc.
Note that a return value of true does not necessarily mean that the presentity has successfully been indicated as "present" on the server only that the underlying system can do so at some time.
|
virtual |
Lowlevel function to send a command to the presentity handler. All commands are asynchronous. They will usually initiate an action for which an indication (callback) will give a result.
Note that the command is typically created by the CreateCommand() function and is subsequently deleted by this function.
Returns true if the command was queued. Note that this does not mean the command succeeded, only that the underlying protocol is processing commands.
cmd | Command to be processed |
Reimplemented in OpalPresentityWithCommandThread.
|
virtual |
|
virtual |
Used to set the AOR after the presentity is created This override allows the descendant class to convert the internal URL into a real AOR, usually by changing the scheme.
void OpalPresentity::SetAuthorisationRequestNotifier | ( | const AuthorisationRequestNotifier & | notifier) |
Set the notifier for the OnAuthorisationRequest() function.
notifier | Notifier to be called by OnAuthorisationRequest() |
|
inlinevirtual |
References BuddyStatus_OK, and SetBuddyEx().
|
virtual |
Set/Add a buddy to the buddy list.
Referenced by SetBuddy().
|
inlinevirtual |
buddies | List of buddies |
References BuddyStatus_OK, and SetBuddyListEx().
|
virtual |
|
virtual |
Set our presence state. This function is a wrapper and the OpalSetLocalPresenceCommand command.
Returns true if the command was queued. Note that this does not mean the command succeeded, only that the underlying protocol is capabable of the action.
state | New state for our presentity |
note | Additional note attached to the state change |
|
virtual |
Called to allow/deny another presentity access to our presence information.
This function is a wrapper and the OpalAuthorisationRequestCommand command.
Returns true if the command was queued. Note that this does not mean the command succeeded, only that the underlying protocol is capabable of the action.
presentity | Remote presentity to be authorised |
authorisation | Authorisation mode |
void OpalPresentity::SetPresenceChangeNotifier | ( | const PresenceChangeNotifier & | notifier) |
Set the notifier for the OnPresenceChange() function.
notifier | Notifier to be called by OnPresenceChange() |
void OpalPresentity::SetReceivedMessageNotifier | ( | const ReceivedMessageNotifier & | notifier) |
Set the notifier for the OnPresenceChange() function.
notifier | Notifier to be called by OnReceivedMessage() |
|
inlinevirtual |
References BuddyStatus_OK, and SubscribeBuddyListEx().
|
virtual |
Subscribe to buddy list. Send a subscription for the presence of every presentity in the current buddy list. This might cause multiple calls to SubscribeToPresence() or if the underlying protocol allows a single call for all.
Referenced by SubscribeBuddyList().
|
virtual |
Subscribe to presence state of another presentity. This function is a wrapper and the OpalSubscribeToPresenceCommand command.
Returns true if the command was queued. Note that this does not mean the command succeeded, only that the underlying protocol is capabable of the action.
presentity | Other presentity to monitor |
subscribe | true if to subscribe, else unsubscribe |
note | Optional extra note attached to subscription request |
|
static |
Key for Time-To-Live attribute, in seconds for underlying protocol.
|
inlinevirtual |
References BuddyStatus_OK, and UnsubscribeBuddyListEx().
|
virtual |
Unsubscribe to buddy list. Send an unsubscription for the presence of every presentity in the current buddy list. This might cause multiple calls to UnsubscribeFromPresence() or if the underlying protocol allows a single call for all.
Referenced by UnsubscribeBuddyList().
|
virtual |
Unsubscribe to presence state of another presentity. This function is a wrapper and the OpalSubscribeToPresenceCommand command.
Returns true if the command was queued. Note that this does not mean the command succeeded, only that the underlying protocol is capabable of the action.
presentity | Other presentity to monitor |
|
protected |
Referenced by GetAOR().
|
protected |
|
protected |
|
protected |
our presentity state
|
protected |
Additional note attached to the.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by IsOpen().
|
protected |