gloox  1.0.24
Classes | Public Types | Public Member Functions | List of all members
AMP Class Reference

#include <amp.h>

Inheritance diagram for AMP:
Inheritance graph
[legend]

Classes

class  Rule
 

Public Types

enum  ConditionType { ConditionDeliver, ConditionExpireAt, ConditionMatchResource, ConditionInvalid }
 
enum  ActionType {
  ActionAlert, ActionError, ActionDrop, ActionNotify,
  ActionInvalid
}
 
enum  DeliverType {
  DeliverDirect, DeliverForward, DeliverGateway, DeliverNone,
  DeliverStored, DeliverInvalid
}
 
enum  MatchResourceType { MatchResourceAny, MatchResourceExact, MatchResourceOther, MatchResourceInvalid }
 
enum  Status { StatusAlert, StatusNotify, StatusInvalid }
 
typedef std::list< const Rule * > RuleList
 

Public Member Functions

 AMP (bool perhop=false)
 
 AMP (const Tag *tag)
 
void addRule (const Rule *rule)
 
const RuleListrules () const
 
virtual ~AMP ()
 
virtual const std::string & filterString () const
 
virtual StanzaExtensionnewInstance (const Tag *tag) const
 
virtual Tagtag () const
 
virtual StanzaExtensionclone () const
 
- Public Member Functions inherited from StanzaExtension
 StanzaExtension (int type)
 
virtual ~StanzaExtension ()
 
virtual StanzaembeddedStanza () const
 
virtual TagembeddedTag () const
 
int extensionType () const
 

Detailed Description

This is an implementation of XEP-0079 (Advanced Message Processing) as a StanzaExtension.

XEP Version: 1.2

Author
Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
Vincent Thomasset
Since
1.0

Definition at line 39 of file amp.h.

Member Typedef Documentation

◆ RuleList

typedef std::list<const Rule*> RuleList

A list of AMP rules.

Definition at line 175 of file amp.h.

Member Enumeration Documentation

◆ ActionType

enum ActionType

Possible actions to take when the corresponding condition is met.

Enumerator
ActionAlert 

Sends back a message stanza with an 'alert' status

ActionError 

Sends back a message stanza with an error type

ActionDrop 

Silently ignore the message

ActionNotify 

Sends back a message stanza with a 'notify' status

ActionInvalid 

Invalid action

Definition at line 57 of file amp.h.

◆ ConditionType

Possible types for a rule's condition.

Enumerator
ConditionDeliver 

Ensures (non-)delivery of the message

ConditionExpireAt 

Ensures delivery only before a certain time (UTC)

ConditionMatchResource 

Ensures delivery only to a specific resource type

ConditionInvalid 

Invalid condition

Definition at line 46 of file amp.h.

◆ DeliverType

Possible delivery rules.

Enumerator
DeliverDirect 

The message would be immediately delivered to the intended recipient or routed to the next hop.

DeliverForward 

The message would be forwarded to another XMPP address or account.

DeliverGateway 

The message would be sent through a gateway to an address or account on a non-XMPP system.

DeliverNone 

The message would not be delivered at all (e.g., because the intended recipient is offline and message storage is not enabled).

DeliverStored 

The message would be stored offline for later delivery to the intended recipient.

DeliverInvalid 

Invalid deliver value

Definition at line 70 of file amp.h.

◆ MatchResourceType

Possible resource matching rules.

Enumerator
MatchResourceAny 

Destination resource matches any value, effectively ignoring the intended resource.

MatchResourceExact 

Destination resource exactly matches the intended resource.

MatchResourceOther 

Destination resource matches any value except for the intended resource.

MatchResourceInvalid 

Invalid match-resource value

Definition at line 89 of file amp.h.

◆ Status

enum Status

Available Stati.

Enumerator
StatusAlert 

The message is a reply to a Alert rule.

StatusNotify 

The message is a reply to a Notify rule.

StatusInvalid 

Invalid status.

Definition at line 103 of file amp.h.

Constructor & Destructor Documentation

◆ AMP() [1/2]

AMP ( bool  perhop = false)

Constructs a new object.

Parameters
perhopIndicates whether the ruleset should be applied to all hops, or at the edge servers only. Default: false (edge servers only)

Definition at line 121 of file amp.cpp.

◆ AMP() [2/2]

AMP ( const Tag tag)

Constructs a new object from the given Tag.

Parameters
tagThe AMP Tag to parse.

Definition at line 127 of file amp.cpp.

Member Function Documentation

◆ addRule()

void addRule ( const Rule rule)

Adds the given rule to the list of rules.

Parameters
ruleThe rule to add.

Definition at line 155 of file amp.cpp.

◆ clone()

virtual StanzaExtension* clone ( ) const
inlinevirtual

Returns an identical copy of the current StanzaExtension.

Returns
An identical copy of the current StanzaExtension.

Implements StanzaExtension.

Definition at line 220 of file amp.h.

◆ filterString()

const std::string & filterString ( ) const
virtual

Returns an XPath expression that describes a path to child elements of a stanza that an extension handles.

Returns
The extension's filter string.

Implements StanzaExtension.

Definition at line 161 of file amp.cpp.

◆ newInstance()

virtual StanzaExtension* newInstance ( const Tag tag) const
inlinevirtual

Returns a new Instance of the derived type. Usually, for a derived class FooExtension, the implementation of this function looks like:

StanzaExtension* FooExtension::newInstance( const Tag* tag ) const
{
return new FooExtension( tag );
}
Returns
The derived extension's new instance.

Implements StanzaExtension.

Definition at line 211 of file amp.h.

◆ rules()

const RuleList& rules ( ) const
inline

Returns the current list of rules for inspection.

Returns
The current list of rules.

Definition at line 200 of file amp.h.

◆ tag()

Tag * tag ( ) const
virtual

Returns a Tag representation of the extension.

Returns
A Tag representation of the extension.

Implements StanzaExtension.

Definition at line 167 of file amp.cpp.


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