SipXcapApiDocumentation

Version 1 (Saúl Ibarra Corretgé, 11/09/2012 01:21 pm)

1 1 Saúl Ibarra Corretgé
h1. XCAP API
2 1 Saúl Ibarra Corretgé
3 1 Saúl Ibarra Corretgé
4 1 Saúl Ibarra Corretgé
The @sipsimple.xcap@ module offers a high level API for managing XCAP resources to other parts of the middleware or to the applications built on top of the middleware. The XCAP resources
5 1 Saúl Ibarra Corretgé
which can be managed by means of this module are:
6 1 Saúl Ibarra Corretgé
* *contact list*, by means of the @resource-lists@ and @rls-services@ XCAP applications
7 1 Saúl Ibarra Corretgé
* *presence policies*, by means of the @org.openmobilealliance.pres-rules@ or @pres-rules@ XCAP applications
8 1 Saúl Ibarra Corretgé
* *dialoginfo policies*, by means of the @org.openxcap.dialog-rules@ XCAP application
9 1 Saúl Ibarra Corretgé
* *status icon*, by means of the @org.openmobilealliance.pres-content@ XCAP application
10 1 Saúl Ibarra Corretgé
* *offline status*, by means of the @pidf-manipulation@ XCAP application
11 1 Saúl Ibarra Corretgé
12 1 Saúl Ibarra Corretgé
The module works with OMA-compliant XCAP servers. Not all applications need to be available on the XCAP server, although it is obvious that only those that are will be managed. The required applications are: @org.openmobilealliance.pres-rules@, @resource-lists@ and @rls-services@. The central entity for XCAP resource management is the XCAPManager, whose API relies on a series of objects describing
13 1 Saúl Ibarra Corretgé
the resources stored on the XCAP server.
14 1 Saúl Ibarra Corretgé
15 1 Saúl Ibarra Corretgé
h2. Contact
16 1 Saúl Ibarra Corretgé
17 1 Saúl Ibarra Corretgé
18 1 Saúl Ibarra Corretgé
Implemented in source:"sipsimple/xcap/__init__.py"
19 1 Saúl Ibarra Corretgé
20 1 Saúl Ibarra Corretgé
A @Contact@ is the representation of a person, containing a list of URIs with additional information stored about them, central to the XCAP contact list management. Information about a contact is stored in the @resource-lists@, @rls-services@ and @org.openmobilealliance.pres-rules@ applications mainly.
21 1 Saúl Ibarra Corretgé
22 1 Saúl Ibarra Corretgé
23 1 Saúl Ibarra Corretgé
*attributes*
24 1 Saúl Ibarra Corretgé
25 1 Saúl Ibarra Corretgé
*id*
26 1 Saúl Ibarra Corretgé
>A unique identifier for the contact. Should be composed of a sufficiently random string across multiple instances.
27 1 Saúl Ibarra Corretgé
28 1 Saúl Ibarra Corretgé
*name*
29 1 Saúl Ibarra Corretgé
>A human-readable name which can be associated with the contact. This is stored using the @display-name@ standard @resource-lists@ element.
30 1 Saúl Ibarra Corretgé
31 1 Saúl Ibarra Corretgé
*uris*
32 1 Saúl Ibarra Corretgé
>A list of @sipsimple.account.xcap.ContactURI@ instances.
33 1 Saúl Ibarra Corretgé
34 1 Saúl Ibarra Corretgé
*dialog*
35 1 Saúl Ibarra Corretgé
> A @sipsimple.account.xcap.EventHandling@ instance which specifies the policy for this contact, and a boolean flag that indicates whether a subscription to the @dialog@ event is desired.
36 1 Saúl Ibarra Corretgé
37 1 Saúl Ibarra Corretgé
*presence*
38 1 Saúl Ibarra Corretgé
> A @sipsimple.account.xcap.EventHandling@ instance which specifies the policy for this contact, and a boolean flag that indicates whether a subscription to the @presence@ event is desired.
39 1 Saúl Ibarra Corretgé
40 1 Saúl Ibarra Corretgé
*attributes*
41 1 Saúl Ibarra Corretgé
>A dictionary containing additional name, value pairs which the middleware or the application can use to store any information regarding this contact. This is stored through a custom AG-Projects
42 1 Saúl Ibarra Corretgé
>extension to resource-lists.
43 1 Saúl Ibarra Corretgé
44 1 Saúl Ibarra Corretgé
45 1 Saúl Ibarra Corretgé
*methods*
46 1 Saúl Ibarra Corretgé
47 1 Saúl Ibarra Corretgé
48 1 Saúl Ibarra Corretgé
*<notextile>__init__</notextile>*(_self_, *id*, *name*, *uris*, *presence_handling=None*, *dialog_handling=None*, ***attributes*)
49 1 Saúl Ibarra Corretgé
>Initializes a new @Contact@ instance. If @presence_handling@ and @dialog_handling@ are set to None then defaults are created with a @default@ policy and the subscription boolean flag set to False.
50 1 Saúl Ibarra Corretgé
51 1 Saúl Ibarra Corretgé
52 1 Saúl Ibarra Corretgé
h2. Policy
53 1 Saúl Ibarra Corretgé
54 1 Saúl Ibarra Corretgé
55 1 Saúl Ibarra Corretgé
Implemented in source:"sipsimple/xcap/__init__.py"
56 1 Saúl Ibarra Corretgé
57 1 Saúl Ibarra Corretgé
A @Policy@ is similar to a @Contact@ but instead of representing a physical person, it represents a policy which is applied to a single URI.
58 1 Saúl Ibarra Corretgé
59 1 Saúl Ibarra Corretgé
60 1 Saúl Ibarra Corretgé
*attributes*
61 1 Saúl Ibarra Corretgé
62 1 Saúl Ibarra Corretgé
*id*
63 1 Saúl Ibarra Corretgé
>A unique identifier for the policy. Should be composed of a sufficiently random string across multiple instances.
64 1 Saúl Ibarra Corretgé
65 1 Saúl Ibarra Corretgé
*name*
66 1 Saúl Ibarra Corretgé
>A human-readable name which can be associated with the policy.
67 1 Saúl Ibarra Corretgé
68 1 Saúl Ibarra Corretgé
*uri*
69 1 Saúl Ibarra Corretgé
>A string object representing the URI of this policy.
70 1 Saúl Ibarra Corretgé
71 1 Saúl Ibarra Corretgé
*dialog*
72 1 Saúl Ibarra Corretgé
> A @sipsimple.account.xcap.EventHandling@ instance which specifies the policy for this policy, and a boolean flag that indicates whether a subscription to the @dialog@ event is desired.
73 1 Saúl Ibarra Corretgé
74 1 Saúl Ibarra Corretgé
*presence*
75 1 Saúl Ibarra Corretgé
> A @sipsimple.account.xcap.EventHandling@ instance which specifies the policy for this policy, and a boolean flag that indicates whether a subscription to the @presence@ event is desired.
76 1 Saúl Ibarra Corretgé
77 1 Saúl Ibarra Corretgé
*attributes*
78 1 Saúl Ibarra Corretgé
>A dictionary containing additional name, value pairs which the middleware or the application can use to store any information regarding this policy. This is stored through a custom AG-Projects
79 1 Saúl Ibarra Corretgé
>extension to resource-lists.
80 1 Saúl Ibarra Corretgé
81 1 Saúl Ibarra Corretgé
82 1 Saúl Ibarra Corretgé
*methods*
83 1 Saúl Ibarra Corretgé
84 1 Saúl Ibarra Corretgé
85 1 Saúl Ibarra Corretgé
*<notextile>__init__</notextile>*(_self_, *id*, *name*, *uri*, *presence_handling=None*, *dialog_handling=None*, ***attributes*)
86 1 Saúl Ibarra Corretgé
>Initializes a new @Policy@ instance. If @presence_handling@ and @dialog_handling@ are set to None then defaults are created with a @default@ policy and the subscription boolean flag set to False.
87 1 Saúl Ibarra Corretgé
88 1 Saúl Ibarra Corretgé
89 1 Saúl Ibarra Corretgé
h2. Group
90 1 Saúl Ibarra Corretgé
91 1 Saúl Ibarra Corretgé
92 1 Saúl Ibarra Corretgé
Implemented in source:"sipsimple/xcap/__init__.py"
93 1 Saúl Ibarra Corretgé
94 1 Saúl Ibarra Corretgé
A @Group@ is a toplevel element which represents a logical entity for grouping contacts together.
95 1 Saúl Ibarra Corretgé
96 1 Saúl Ibarra Corretgé
97 1 Saúl Ibarra Corretgé
*attributes*
98 1 Saúl Ibarra Corretgé
99 1 Saúl Ibarra Corretgé
*id*
100 1 Saúl Ibarra Corretgé
>A unique identifier for the group. Should be composed of a sufficiently random string across multiple instances.
101 1 Saúl Ibarra Corretgé
102 1 Saúl Ibarra Corretgé
*name*
103 1 Saúl Ibarra Corretgé
>A human-readable name which can be associated with the group.
104 1 Saúl Ibarra Corretgé
105 1 Saúl Ibarra Corretgé
*contacts*
106 1 Saúl Ibarra Corretgé
> A list of @Contact@ objects.
107 1 Saúl Ibarra Corretgé
108 1 Saúl Ibarra Corretgé
*attributes*
109 1 Saúl Ibarra Corretgé
>A dictionary containing additional name, value pairs which the middleware or the application can use to store any information regarding this policy. This is stored through a custom AG-Projects
110 1 Saúl Ibarra Corretgé
>extension to resource-lists.
111 1 Saúl Ibarra Corretgé
112 1 Saúl Ibarra Corretgé
113 1 Saúl Ibarra Corretgé
*methods*
114 1 Saúl Ibarra Corretgé
115 1 Saúl Ibarra Corretgé
116 1 Saúl Ibarra Corretgé
*<notextile>__init__</notextile>*(_self_, *id*, *name*, *contacts*, ***attributes*)
117 1 Saúl Ibarra Corretgé
>Initializes a new @Group@ instance.
118 1 Saúl Ibarra Corretgé
119 1 Saúl Ibarra Corretgé
h2. Addressbook
120 1 Saúl Ibarra Corretgé
121 1 Saúl Ibarra Corretgé
122 1 Saúl Ibarra Corretgé
Implemented in source:"sipsimple/xcap/__init__.py"
123 1 Saúl Ibarra Corretgé
124 1 Saúl Ibarra Corretgé
An @Adressbook@ is a collection of contacts, groups and policies.
125 1 Saúl Ibarra Corretgé
126 1 Saúl Ibarra Corretgé
127 1 Saúl Ibarra Corretgé
*attributes*
128 1 Saúl Ibarra Corretgé
129 1 Saúl Ibarra Corretgé
*contacts*
130 1 Saúl Ibarra Corretgé
> A list of @Contact@ objects.
131 1 Saúl Ibarra Corretgé
132 1 Saúl Ibarra Corretgé
*groups*
133 1 Saúl Ibarra Corretgé
> A list of @Group@ objects.
134 1 Saúl Ibarra Corretgé
135 1 Saúl Ibarra Corretgé
*policies*
136 1 Saúl Ibarra Corretgé
> A list of @Policy@ objects.
137 1 Saúl Ibarra Corretgé
138 1 Saúl Ibarra Corretgé
139 1 Saúl Ibarra Corretgé
*methods*
140 1 Saúl Ibarra Corretgé
141 1 Saúl Ibarra Corretgé
142 1 Saúl Ibarra Corretgé
*<notextile>__init__</notextile>*(_self_, *contacts*, *groups*, *policies*)
143 1 Saúl Ibarra Corretgé
>Initializes a new @Addressbook@ instance.
144 1 Saúl Ibarra Corretgé
145 1 Saúl Ibarra Corretgé
146 1 Saúl Ibarra Corretgé
h2. Icon
147 1 Saúl Ibarra Corretgé
148 1 Saúl Ibarra Corretgé
149 1 Saúl Ibarra Corretgé
Implemented in source:"sipsimple/xcap/__init__.py"
150 1 Saúl Ibarra Corretgé
151 1 Saúl Ibarra Corretgé
An @Icon@ instance represents a status icon stored using the @org.openmobilealliance.pres-content@ application.
152 1 Saúl Ibarra Corretgé
153 1 Saúl Ibarra Corretgé
154 1 Saúl Ibarra Corretgé
*attributes*
155 1 Saúl Ibarra Corretgé
156 1 Saúl Ibarra Corretgé
157 1 Saúl Ibarra Corretgé
*data*
158 1 Saúl Ibarra Corretgé
>The binary data of the image, as  a string.
159 1 Saúl Ibarra Corretgé
160 1 Saúl Ibarra Corretgé
*mime_type*
161 1 Saúl Ibarra Corretgé
>The MIME type of the image, one of @image/jpeg@, @image/gif@ or @image/png@.
162 1 Saúl Ibarra Corretgé
163 1 Saúl Ibarra Corretgé
*description*
164 1 Saúl Ibarra Corretgé
>An optional description of the icon.
165 1 Saúl Ibarra Corretgé
166 1 Saúl Ibarra Corretgé
*location*
167 1 Saúl Ibarra Corretgé
>An HTTP(S) URI which can be used by other users to download the status icon of the local user. If the XCAP server returns the custom X-Alternative-Location header in its GET and PUT
168 1 Saúl Ibarra Corretgé
>responses, that is used otherwise the XCAP URI of the icon is used.
169 1 Saúl Ibarra Corretgé
170 1 Saúl Ibarra Corretgé
171 1 Saúl Ibarra Corretgé
*methods*
172 1 Saúl Ibarra Corretgé
173 1 Saúl Ibarra Corretgé
174 1 Saúl Ibarra Corretgé
*<notextile>__init__</notextile>*(_self_, *data*, *mime_type*, *description*=@None@, *location*=@None@)
175 1 Saúl Ibarra Corretgé
>Initializes a new @Icon@ instance.
176 1 Saúl Ibarra Corretgé
177 1 Saúl Ibarra Corretgé
h2. OfflineStatus
178 1 Saúl Ibarra Corretgé
179 1 Saúl Ibarra Corretgé
180 1 Saúl Ibarra Corretgé
Implemented in source:"sipsimple/xcap/__init__.py"
181 1 Saúl Ibarra Corretgé
182 1 Saúl Ibarra Corretgé
An @OfflineStatus@ instance represents data stored using the @pidf-manipulation@ application.
183 1 Saúl Ibarra Corretgé
184 1 Saúl Ibarra Corretgé
185 1 Saúl Ibarra Corretgé
*attributes*
186 1 Saúl Ibarra Corretgé
187 1 Saúl Ibarra Corretgé
*pidf*
188 1 Saúl Ibarra Corretgé
>A @sipsimple.payloads.pidf.PIDF@ instance which is stored in XCAP.
189 1 Saúl Ibarra Corretgé
190 1 Saúl Ibarra Corretgé
191 1 Saúl Ibarra Corretgé
*methods*
192 1 Saúl Ibarra Corretgé
193 1 Saúl Ibarra Corretgé
194 1 Saúl Ibarra Corretgé
*<notextile>__init__</notextile>*(_self_, *pidf*)
195 1 Saúl Ibarra Corretgé
>Initializes a new @OfflineStatus@ instance.
196 1 Saúl Ibarra Corretgé
197 1 Saúl Ibarra Corretgé
h2. XCAPManager
198 1 Saúl Ibarra Corretgé
199 1 Saúl Ibarra Corretgé
200 1 Saúl Ibarra Corretgé
Implemented in source:"sipsimple/xcap/__init__.py"
201 1 Saúl Ibarra Corretgé
202 1 Saúl Ibarra Corretgé
The XCAPManager is the central entity used to manage resource via the XCAP protocol. It uses a storage factory provided by @SIPApplication@ through the @Storage API@. It has state machine as described in the following diagram:
203 1 Saúl Ibarra Corretgé
!{ align=center}xcap-manager-state.png!
204 1 Saúl Ibarra Corretgé
205 1 Saúl Ibarra Corretgé
The @load@ method needs to be called just once in order to load the data from the cache. Once this is done, the @start@ and @stop@ methods can be called as needed. Initially in the @stopped@ state,
206 1 Saúl Ibarra Corretgé
the start method will result in a transition to the @initializing@ state. While in the @initializing@ state, the XCAP manager will try to connect to the XCAP server and retrieve the
207 1 Saúl Ibarra Corretgé
capabilities (@xcap-caps@ application). It will then initiate a SUBSCRIBE for the @xcap-diff@ event and transition to the @fetching@ state. In the @fetching@ state, it
208 1 Saúl Ibarra Corretgé
will try retrieve all the documents from the XCAP server, also specifying the ETag of the last known version. If none of the documents changed and this is not the first fetch, it transitions to the
209 1 Saúl Ibarra Corretgé
@insync@ state. Otherwise, it inserts a @normalize@ operation at the beginning of the journal (described below) and transitions to the @updating@ state. In the @updating@ state, it
210 1 Saúl Ibarra Corretgé
applies the operations from the journal which were not applied yet on the currently known documents and tries to push the documents, specifying the Etag of the last known version. If an operation
211 1 Saúl Ibarra Corretgé
fails due to a document having been modified, it marks all the operations in the journal as not being applied and transitions to the @fetching@ state; if any other error occurs, the update is
212 1 Saúl Ibarra Corretgé
retried periodically. If the update succeeds, data is extracted from the documents and the @XCAPManagerDidReloadData@ notification is sent. The XCAPManager then transitions to the @insync@
213 1 Saúl Ibarra Corretgé
state. A call to the @stop@ method will result in a transition to the @stopping@ state, termination of any existing SUBSCRIBE dialog and a transition to the @stopped@ state.
214 1 Saúl Ibarra Corretgé
215 1 Saúl Ibarra Corretgé
Modifications to the settings which control the XCAPManager can result in either a transition to the @initializing@ state or the termination of any previous SUBSCRIBE dialog and creation of a new
216 1 Saúl Ibarra Corretgé
one.
217 1 Saúl Ibarra Corretgé
218 1 Saúl Ibarra Corretgé
The subscription to the @xcap-diff@ event allows the XCAPManager to be notified when the documents it manages are modified remotely. If the subscription fails, a fetch of all the documents is
219 1 Saúl Ibarra Corretgé
tried and the subscription is retried in some time. This allows the XCAPManager to reload the documents when they are modified remotely even if @xcap-diff@ event is not supported by the provider. If subscription for @xcap-diff@ event fails, a fetch of all the documents will be tried every 2 minutes.
220 1 Saúl Ibarra Corretgé
221 1 Saúl Ibarra Corretgé
The XCAPManager keeps the documents as they are stored on the XCAP server along with their ETags in an on-disk cache. All operations are made using the conditional @If-Match@ and
222 1 Saúl Ibarra Corretgé
@If-None-Match@ headers such that remote modifications the XCAPManager does not know about are not overwritten and bandwidth and processing power are not wasted by GET operations when a document
223 1 Saúl Ibarra Corretgé
is not modified.
224 1 Saúl Ibarra Corretgé
225 1 Saúl Ibarra Corretgé
Operations which the XCAPManager can be asked to apply to modify the documents are kept in a journal. This journal is saved to disk, such that operations which cannot be applied when requested due
226 1 Saúl Ibarra Corretgé
to server problems or lack of connectivity are retried even after application restarts. In addition, the high-level defined operations and the journal allow the modifications to be applied even if the
227 1 Saúl Ibarra Corretgé
document stored on the XCAP server are modified. Put differently, operations do depend on a specific version of the documents and the XCAPManager will try to apply them irrespective of the format
228 1 Saúl Ibarra Corretgé
of the document.
229 1 Saúl Ibarra Corretgé
230 1 Saúl Ibarra Corretgé
231 1 Saúl Ibarra Corretgé
*configuration*
232 1 Saúl Ibarra Corretgé
233 1 Saúl Ibarra Corretgé
234 1 Saúl Ibarra Corretgé
*Account.id*, *Account.auth.username*, *Account.auth.password*
235 1 Saúl Ibarra Corretgé
>These are used both for the @xcap-diff@ subscription and the XCAP server connection. 
236 1 Saúl Ibarra Corretgé
237 1 Saúl Ibarra Corretgé
*Account.sip.subscribe_interval*
238 1 Saúl Ibarra Corretgé
>This controls the Expires header used for the subscription, although a 423 response from the server can result in a larger Expires value being used.
239 1 Saúl Ibarra Corretgé
240 1 Saúl Ibarra Corretgé
*Account.xcap.xcap_root*
241 1 Saúl Ibarra Corretgé
>This specifies the XCAP root used for contacting the XCAP server and managing the resources. If this setting is @None@, a TXT DNS query is made for the @xcap@ subdomain of the SIP account's
242 1 Saúl Ibarra Corretgé
>domain. The result is interpreted as being an XCAP root. Example record for account alice@example.org:
243 1 Saúl Ibarra Corretgé
  <pre>
244 1 Saúl Ibarra Corretgé
  xcap.example.org.    IN  TXT     "https://xcap.example.org/xcap-root"
245 1 Saúl Ibarra Corretgé
</pre>
246 1 Saúl Ibarra Corretgé
247 1 Saúl Ibarra Corretgé
*SIPSimpleSettings.sip.transport_list*
248 1 Saúl Ibarra Corretgé
>This controls the transports which can be used for the subscription.
249 1 Saúl Ibarra Corretgé
250 1 Saúl Ibarra Corretgé
251 1 Saúl Ibarra Corretgé
*methods*
252 1 Saúl Ibarra Corretgé
253 1 Saúl Ibarra Corretgé
254 1 Saúl Ibarra Corretgé
*<notextile>__init__</notextile>*(_self_, *account*)
255 1 Saúl Ibarra Corretgé
>Initializes an XCAPManager for the specified account.
256 1 Saúl Ibarra Corretgé
257 1 Saúl Ibarra Corretgé
*init*(_self_)
258 1 Saúl Ibarra Corretgé
>Initializes the XCAPManager before it can be started.
259 1 Saúl Ibarra Corretgé
260 1 Saúl Ibarra Corretgé
*start*(_self_)
261 1 Saúl Ibarra Corretgé
>Starts the XCAPManager. This will result in the subscription being started, the XCAP server being contacted and any operations in the journal being applied. This method must be called in a green
262 1 Saúl Ibarra Corretgé
>thread.
263 1 Saúl Ibarra Corretgé
264 1 Saúl Ibarra Corretgé
*stop*(_self_)
265 1 Saúl Ibarra Corretgé
>Stops the XCAPManager from performing any tasks. Waits until the @xcap-diff@ subscription, if any, is terminated. This method must be called in a green thread.
266 1 Saúl Ibarra Corretgé
267 1 Saúl Ibarra Corretgé
*transaction*(_self_)
268 1 Saúl Ibarra Corretgé
> Return as @XCAPTransaction@ context manager object for running a piece of code within a transaction.
269 1 Saúl Ibarra Corretgé
270 1 Saúl Ibarra Corretgé
*start_transaction*(_self_)
271 1 Saúl Ibarra Corretgé
>This allows multiple operations to be queued and not applied immediately. All operations queued after a call to this method will not be applied until the @commit_transaction@ method is called.
272 1 Saúl Ibarra Corretgé
>This does not have the same meaning as a relational database transaction, since there is no @rollback@ operation.
273 1 Saúl Ibarra Corretgé
274 1 Saúl Ibarra Corretgé
*commit_transaction*(_self_)
275 1 Saúl Ibarra Corretgé
>Applies the modifications queued after a call to @start_transaction@. This method needs to be called the exact same number of times the @start_transaction@ method was called. Does not have
276 1 Saúl Ibarra Corretgé
>any effect if @start_transaction@ was not previously called.
277 1 Saúl Ibarra Corretgé
278 1 Saúl Ibarra Corretgé
 The following methods results in XCAP operations being queued on the journal:
279 1 Saúl Ibarra Corretgé
280 1 Saúl Ibarra Corretgé
*add_group*(_self_, *group*)
281 1 Saúl Ibarra Corretgé
>Add a group.
282 1 Saúl Ibarra Corretgé
283 1 Saúl Ibarra Corretgé
*update_group*(_self_, *group*, *attributes*)
284 1 Saúl Ibarra Corretgé
>Update the specified group with the given attributes.
285 1 Saúl Ibarra Corretgé
286 1 Saúl Ibarra Corretgé
*remove_group*(_self_, *group*)
287 1 Saúl Ibarra Corretgé
>Remove the specified group.
288 1 Saúl Ibarra Corretgé
289 1 Saúl Ibarra Corretgé
*add_contact*(_self_, *contact*)
290 1 Saúl Ibarra Corretgé
>Adds a new contact, described by a @Contact@ object. Requests to add a contact to some OMA reserved presence policies (@wp_prs_unlisted@, @wp_prs_allow_unlisted@, @wp_prs_block_anonymous@, @wp_prs_allow_own@) is ignored.
291 1 Saúl Ibarra Corretgé
292 1 Saúl Ibarra Corretgé
*update_contact*(_self_, *contact*, *attributes*)
293 1 Saúl Ibarra Corretgé
>Modifies a contact's properties. The keywords can be any of the @Contact@ attributes, with the same meaning. Requests to add a contact to some OMA reserved presence policies (@wp_prs_unlisted@, @wp_prs_allow_unlisted@, @wp_prs_block_anonymous@,  @wp_prs_allow_own@) is ignored.
294 1 Saúl Ibarra Corretgé
295 1 Saúl Ibarra Corretgé
*remove_contact*(_self_, *contact*)
296 1 Saúl Ibarra Corretgé
>Removes the specified contact.
297 1 Saúl Ibarra Corretgé
298 1 Saúl Ibarra Corretgé
*add_contact_uri*(_self_, *contact*, *uri*)
299 1 Saúl Ibarra Corretgé
> Add the specified URI to the specified contact.
300 1 Saúl Ibarra Corretgé
301 1 Saúl Ibarra Corretgé
*update_contact_uri*(_self_, *contact*, *uri*, *attributes*)
302 1 Saúl Ibarra Corretgé
> Update the specified URI.
303 1 Saúl Ibarra Corretgé
304 1 Saúl Ibarra Corretgé
*remove_contact_uri*(_self_, *contact*, *uri*)
305 1 Saúl Ibarra Corretgé
> Remove the specified URI from the specified contact.
306 1 Saúl Ibarra Corretgé
307 1 Saúl Ibarra Corretgé
*add_group_member*(_self_, *group*, *contact*)
308 1 Saúl Ibarra Corretgé
> Adds the specified contact to the specified group. A contact may be added to multiple groups.
309 1 Saúl Ibarra Corretgé
310 1 Saúl Ibarra Corretgé
*remove_group_member*(_self_, *group*, *contact*)
311 1 Saúl Ibarra Corretgé
> Removes the specified contact from the specified group.
312 1 Saúl Ibarra Corretgé
313 1 Saúl Ibarra Corretgé
*add_policy*(_self_, *policy*)
314 1 Saúl Ibarra Corretgé
>Adds a new policy, described by a @Policy@ object.
315 1 Saúl Ibarra Corretgé
316 1 Saúl Ibarra Corretgé
*update_policy*(_self_, *policy*, *attributes*)
317 1 Saúl Ibarra Corretgé
>Modifies a presence policy's properties. The keywords can be any of the @PresencePolicy@ attributes, with the same meaning. 
318 1 Saúl Ibarra Corretgé
319 1 Saúl Ibarra Corretgé
*remove_policy*(_self_, *policy*)
320 1 Saúl Ibarra Corretgé
>Removes the specified policy.
321 1 Saúl Ibarra Corretgé
322 1 Saúl Ibarra Corretgé
*set_status_icon*(_self_, *icon*)
323 1 Saúl Ibarra Corretgé
>Sets the status icon using the information from the @Icon@ object specified. The @location@ attribute is ignored. The MIME type must be one of @image/gif@, @image/png@ or @image/jpeg@. If the argument is @None@, the status icon is deleted.
324 1 Saúl Ibarra Corretgé
325 1 Saúl Ibarra Corretgé
*set_offline_status*(_self_, *status*)
326 1 Saúl Ibarra Corretgé
>Sets the offline status using the information from the @OfflineStatus@ object specified. If the argument is @None@, the offline status document is deleted.
327 1 Saúl Ibarra Corretgé
328 1 Saúl Ibarra Corretgé
329 1 Saúl Ibarra Corretgé
*notifications*
330 1 Saúl Ibarra Corretgé
331 1 Saúl Ibarra Corretgé
332 1 Saúl Ibarra Corretgé
*XCAPManagerWillStart*
333 1 Saúl Ibarra Corretgé
>This notification is sent just after calling the @start@ method.
334 1 Saúl Ibarra Corretgé
335 1 Saúl Ibarra Corretgé
*XCAPManagerDidStart*
336 1 Saúl Ibarra Corretgé
>This notification is sent after the XCAPManager has started doing its tasks (contacting the XCAP server, subscribing to @xcap-diff@ event). This notification does not mean that
337 1 Saúl Ibarra Corretgé
>any of these operations were successful, as the XCAPManager will retry them continuously should they fail.
338 1 Saúl Ibarra Corretgé
339 1 Saúl Ibarra Corretgé
*XCAPManagerWillEnd*
340 1 Saúl Ibarra Corretgé
>This notification is sent just after calling the @stop@ method.
341 1 Saúl Ibarra Corretgé
342 1 Saúl Ibarra Corretgé
*XCAPManagerDidEnd*
343 1 Saúl Ibarra Corretgé
>This notification is sent when the XCAPManager has stopped performing any tasks. This also means that any active @xcap-diff@ subscription has been terminated.
344 1 Saúl Ibarra Corretgé
345 1 Saúl Ibarra Corretgé
*XCAPManagerDidDiscoverServerCapabilities*
346 1 Saúl Ibarra Corretgé
>This notification is sent when the XCAPManager contacts an XCAP server for the first time or after the connection is reset due to configuration changes. The data of the notification contains
347 1 Saúl Ibarra Corretgé
>information about the server's capabilities (obtained using the @xcap-caps@ application).
348 1 Saúl Ibarra Corretgé
  
349 1 Saúl Ibarra Corretgé
>+_auids_+:
350 1 Saúl Ibarra Corretgé
>>A list of string representing the AUIDs supported by the server.
351 1 Saúl Ibarra Corretgé
352 1 Saúl Ibarra Corretgé
*XCAPManagerDidReloadData*
353 1 Saúl Ibarra Corretgé
>This notification is sent when the XCAPManager synchronizes with the XCAP server. The data of the notification contains objects representing the data as it is stored on the XCAP server.
354 1 Saúl Ibarra Corretgé
  
355 1 Saúl Ibarra Corretgé
>+_addressbook_+:
356 1 Saúl Ibarra Corretgé
>>A @sipsimple.account.xcap.Addressbook@ object instance.
357 1 Saúl Ibarra Corretgé
  
358 1 Saúl Ibarra Corretgé
>+_presence_rules_+:
359 1 Saúl Ibarra Corretgé
>>A @sipsimple.account.xcap.PresenceRules@ object. Currently it only contains the default policy.
360 1 Saúl Ibarra Corretgé
 
361 1 Saúl Ibarra Corretgé
>+_dialog_rules_+:
362 1 Saúl Ibarra Corretgé
>>A @sipsimple.account.xcap.DialogRules@ object. Currently it only contains the default policy.
363 1 Saúl Ibarra Corretgé
  
364 1 Saúl Ibarra Corretgé
>+_status_icon_+:
365 1 Saúl Ibarra Corretgé
>>A @StatusIcon@ object if one is stored, @None@ otherwise.
366 1 Saúl Ibarra Corretgé
  
367 1 Saúl Ibarra Corretgé
>+_offline_status_+:
368 1 Saúl Ibarra Corretgé
>>A @OfflineStatus@ object if offline status information is stored, @None@ otherwise.
369 1 Saúl Ibarra Corretgé
370 1 Saúl Ibarra Corretgé
*XCAPManagerDidChangeState*
371 1 Saúl Ibarra Corretgé
>This notification is sent when the XCAPManager transitions from one state to another.
372 1 Saúl Ibarra Corretgé
  
373 1 Saúl Ibarra Corretgé
>+_prev_state_+:
374 1 Saúl Ibarra Corretgé
>>The old state of the XCAPManager, a string.
375 1 Saúl Ibarra Corretgé
376 1 Saúl Ibarra Corretgé
>+_state_+:
377 1 Saúl Ibarra Corretgé
>>The new state of the XCAPManager, a string.