0fee97e9da37a0d5905134a28ce41c190ba5d1c1
[platform/upstream/syncevolution.git] / src / dbus / interfaces / syncevo-server-full.xml
1 <?xml version="1.0"?>
2 <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
3   <interface name="org.syncevolution.Server">
4     <doc:doc>
5       <doc:para>
6         Server is the entry object for SyncEvolution client API. It
7         can be used to query information and to start and monitor
8         sessions.
9       </doc:para>
10
11       <doc:para>
12         Sessions are required to modify the state of SyncEvolution and
13         to synchronize data. They are implemented by additional
14         objects, which exist as long as they are needed (= have
15         clients) or are executing (for example, running a sync
16         session).
17       </doc:para>
18
19       <doc:para>
20         A session must be active before it can be used. If there are
21         multiple conflicting session requests, they will be queued and
22         started one after the other. At the moment, SyncEvolution
23         will only run one session at a time, although the API would
24         allow concurrent sessions.
25       </doc:para>
26
27       <doc:para>
28         To be notified when a session is ready for use, subscribe to
29         the SessionChanged signal before asking for a session. It
30         may fire before the request to create a session returns. Either
31         handle that or use Session.GetStatus() to check whether the
32         session is still "queueing".
33       </doc:para>
34
35       <doc:para>
36         Method calls may fail with the following errors:
37         "org.syncevolution.Exception" - catch-all error condition.
38         "org.syncevolution.NoSuchConfig" - server configuration name is invalid
39         "org.syncevolution.NoSuchSource" - source name is invalid
40         "org.syncevolution.SourceUnusable" - CheckSource() may return this
41         if source is not usable (for various possible reasons).
42         "org.syncevolution.InvalidCall" - a call is (perhaps no longer) allowed
43         or suitable in the current situation, like Detach() when the client
44         is not attached.
45       </doc:para>
46     </doc:doc>
47
48     <method name="Attach">
49       <doc:doc>
50         <doc:description>
51           With no client attached, the server will shut down after a
52           certain period of inactivity. Attaching to the server
53           prevents that. Attaching is not necessary to invoke methods.
54           The main purpose is to keep the server running while clients
55           are around and listen for signals, in particular the
56           Presence signal.
57           Each attach has to be matched by one detach, so that one client has
58           the capability to attach to the server many times in different
59           modules. The behavior of calling Detach() more often than Attach()
60           is undefined.
61         </doc:description>
62       </doc:doc>
63     </method>
64
65     <method name="Detach">
66       <doc:doc>
67         <doc:description>
68           Detaches an attached client. A client which disconnects
69           from D-Bus is automatically detached from the server.
70         </doc:description>
71       </doc:doc>
72     </method>
73
74     <method name ="GetConfigs">
75       <doc:doc><doc:description>
76         Get an array of all configured servers (or templates)
77
78         In getting templates mode, the dbus server checks the paired devices
79         from bluez and returns the matched templates. Templates for each device
80         are re-named with 'Bluetooth_&lt;mac address&gt;_&lt;number&gt;', where number
81         enumerates the templates created for the device.
82
83         Get these templates latter when calling GetConfig with additional new
84         properties: 
85             description - the description for the template
86             score - the calculated score based on the device name and template
87             deviceName - the device name that the template is for
88             fingerPrint - the fingerPrint of the template, used for dbus
89                           clients to re-match with user input device info
90         Also a property value is changed: 'syncURL' is replaced with the device 
91         mac address.
92       </doc:description></doc:doc>
93       <arg type="b" name="template" direction="in">
94         <doc:doc><doc:summary>
95           if TRUE, will return template names, otherwise will return 
96           configured servers
97         </doc:summary></doc:doc>
98       </arg>
99       <arg type="as" name="servers" direction="out">
100         <doc:doc><doc:summary>
101           array of configured server (or template) names
102         </doc:summary></doc:doc>
103       </arg>
104     </method>
105
106     <method name="GetConfig">
107       <doc:doc><doc:description>
108         Get the configuration of a specific server (or template)
109       </doc:description></doc:doc>
110       <arg type="s" name="server" direction="in">
111         <doc:doc><doc:summary>server name</doc:summary></doc:doc>
112       </arg>
113       <arg type="b" name="template" direction="in">
114         <doc:doc><doc:summary>
115           if TRUE, will return a matching template configuration, otherwise
116           will return a matching server configuration
117         </doc:summary></doc:doc>
118       </arg>
119       <arg type="a{sa{ss}}" name="configuration" direction="out">
120         <doc:doc><doc:summary>
121           server (or template) configuration
122         </doc:summary></doc:doc>
123         <doc:doc><doc:description>
124           The dictionary keys are "source/&lt;source name&gt;" for
125           sources and the empty string for the main server
126           configuration. More keys might be added in the future. The
127           values are "configuration dictionaries" which contain keys
128           and values matching those in the SyncEvolution server 
129           configuration files. 
130           Properties which are not set are also not present in the
131           configuration dictionaries. The semantic difference between
132           "not set" and "empty" or "set to default" is that unset
133           values will always use the default value, even after that
134           changed during a software update. Properties that are set
135           always use the chosen value.
136
137           Note that property keys are case insensitive. The D-Bus
138           interface specification would allow to send two
139           properties whose keys only differ in case to the
140           server. The result is undefined.
141         </doc:description></doc:doc>
142       </arg>
143     </method>
144
145     <method name="CheckPresence">
146       <doc:doc><doc:description>
147         Checks whether a sync with a particular server can start.
148       </doc:description></doc:doc>
149       <arg type="s" name="server" direction="in">
150         <doc:doc><doc:summary>server name</doc:summary></doc:doc>
151       </arg>
152       <arg type="s" name="status" direction="out">
153         <doc:doc>
154           <doc:summary>
155             See Presence signal for details.
156           </doc:summary>
157         </doc:doc>
158       </arg>
159       <arg type="as" name="transports" direction="out">
160         <doc:doc>
161           <doc:summary>
162             All currently available transports. See Presence signal for details.
163           </doc:summary>
164         </doc:doc>
165       </arg>
166     </method>      
167
168     <method name="GetReports">
169       <doc:doc><doc:description>
170         Get synchronization reports for a specific server
171       </doc:description></doc:doc>
172       <arg type="s" name="server" direction="in">
173         <doc:doc><doc:summary>server name</doc:summary></doc:doc>
174       </arg>
175       <arg type="u" name="start" direction="in">
176         <doc:doc><doc:summary>
177           index of the first (newest) report that will be returned;
178           reports are number starting with zero for the newest
179         </doc:summary></doc:doc>
180       </arg>
181       <arg type="u" name="count" direction="in">
182         <doc:doc><doc:summary>
183           maximum number of returned reports
184         </doc:summary></doc:doc>
185       </arg>
186       <arg type="aa{ss}" name="reports" direction="out">
187         <doc:doc><doc:summary>synchronization reports</doc:summary></doc:doc>
188         <doc:doc><doc:description>The array contains report dictionaries. The dictionary keys can be defined by below BNFs:
189                 Key ::= 'dir' | 'peer' | 'start' | 'end' | 'status' | 'error' | SourceKey
190                 SourceKey ::= SourcePrefix SourcePart
191                 SourcePrefix ::= 'source' Sep SourceName
192                 SourceName ::= character+ 
193                 SourcePart ::= Sep ('mode' | 'first' | 'resume' | 'status' | 'backup-before' 
194                                | 'backup-after' | StatPart)
195                 StatPart ::= 'stat' Sep LocName Sep StateName Sep ResultName
196                 LocName ::= 'local' | 'remote'
197                 StateName ::= 'added' | 'updated' | 'removed' | 'any'
198                 ResultName ::= 'total' | 'reject' | 'match' | 'conflict_server_won' | 'conflict_client_won' 
199                                 | 'conflict_duplicated' | 'sent' | 'received'
200                 Sep ::= '-'
201
202                 If SourceName has characters '_' and '-', they will be
203                 escaped with '__' and '_+' respectively. This means
204                 that a key can be split at '-' before replacing these
205                 escape sequences in the source name.
206
207                 For a key which contains StatPart, if its value is 0,
208                 its pair-value won't be included in the dictionary.
209         </doc:description></doc:doc>
210       </arg>
211     </method>
212
213     <method name="GetDatabases">
214       <doc:doc>
215         <doc:description>
216           Get list of available databases that can be synchronized
217           by a source backend.
218         </doc:description>
219       </doc:doc>
220       <arg type="s" name="server" direction="in">
221         <doc:doc><doc:summary>server name</doc:summary></doc:doc>
222       </arg>
223       <arg type="s" name="source" direction="in">
224         <doc:doc>
225           <doc:summary>
226             name of the source configuration which defines
227             the backend ("type" property)
228           </doc:summary>
229         </doc:doc>
230       </arg>
231       <arg type="a(ssb)" name="databases" direction="out">
232         <doc:doc><doc:summary>information about all available databases</doc:summary></doc:doc>
233         <doc:doc>
234           <doc:description>
235             each entry contains in this order:
236             an optional name that can be shown to the user
237             (already localized or chosen by the user, empty if unavailable),
238             a unique value for the "evolutionSource" property,
239             a boolean which is true at most once for the default source
240           </doc:description>
241         </doc:doc>
242       </arg>
243     </method>
244
245     <method name="CheckSource">
246       <doc:doc>
247         <doc:description>Tests whether the source configuration
248           is correct. Raises the SourceUnusable exception if not.
249         </doc:description>
250       </doc:doc>
251       <arg type="s" name="server" direction="in">
252         <doc:doc><doc:summary>server name</doc:summary></doc:doc>
253       </arg>
254       <arg type="s" name="source" direction="in">
255         <doc:doc>
256           <doc:summary>
257             name of the source configuration which is to be tested
258           </doc:summary>
259         </doc:doc>
260       </arg>
261     </method>
262
263     <method name="StartSession">
264       <doc:doc><doc:description>
265         Start a session. The object is created instantly but will not be
266         ready for method calls until status changes from "queueing" to "idle".
267         The Detach() method can be called before that.
268       </doc:description></doc:doc>
269       <arg type="s" name="server" direction="in">
270         <doc:doc><doc:summary>server name</doc:summary></doc:doc>
271       </arg>
272       <arg type="o" name="session" direction="out">
273         <doc:doc><doc:summary>session D-Bus object path</doc:summary></doc:doc>
274       </arg>
275     </method>
276
277     <method name="Connect">
278       <doc:doc>
279         <doc:description>
280           <doc:para>
281             Establishes a connection between SyncEvolution and a peer
282             (SyncML client or server). That peer might contact
283             SyncEvolution via D-Bus directly (local sync) or via a
284             SyncEvolution server stub that acts as gateway between a
285             peer that is connected to the stub via some other
286             transport mechanism (remote sync). For SyncEvolution this
287             difference is almost completely transparent.
288           </doc:para>
289
290           <doc:para>
291             In contrast to connections established by SyncEvolution
292             itself, the peer has to send the first message and
293             SyncEvolution replies. If the first message is a normal
294             SyncML message, then SyncEvolution acts as SyncML server.
295             Alternatively, a Notification message can be sent to
296             request that SyncEvolution initiates a SyncML session as
297             client.
298           </doc:para>
299
300           <doc:para>
301             In the later case, SyncEvolution may or may not use the
302             connection established by Connect(), depending on the
303             content of that first message.
304           </doc:para>
305
306           <doc:para>
307             The result of Connect() is an object that implements the
308             org.syncevolution.Connection interface. It has to be used
309             for sending at least one message to start the sync. If
310             SyncEvolution needs to abort the connection, it will issue
311             the Close-signal and remove the object. A peer needs to
312             subscribe to that signal before starting to wait for a
313             reply. In addition, the client should also watch out for
314             SyncEvolution quitting unexpectedly.
315           </doc:para>
316
317           <doc:para>
318             SyncEvolution supports re-establishing a connection that was
319             interrupted. This only works when the peer is a SyncML
320             client, supports resending messages, and the non-D-Bus
321             message transport supports sending the session number as
322             part of the meta information.
323           </doc:para>
324         </doc:description>
325       </doc:doc>
326       <arg type="a{ss}" name="peer" direction="in">
327         <doc:doc>
328           <doc:summary>
329             Various information about the peer who initiated the
330             connection. All of it is optional unless explicitly
331             specified otherwise. Short, single line strings are
332             preferred.
333
334             "description" - a description of the peer in a format and
335             language that is understood by the user.
336
337             "id" - a unique ID for this particular peer, in a format
338             that is specific to the transport. The ID only has to be
339             unique among peers using that transport at the current
340             point in time.
341
342             "transport" - a string identifying the entity which talks
343             directly to SyncEvolution (peer or transport stub). If
344             available, this should be a D-Bus interface name, like
345             "org.openobex.obexd". The main purpose right now is for
346             informing the user and debugging.  Later it might also be
347             used to call methods in that interface or for choosing a
348             local configuration for the peer based on its ID.
349
350             "transport_description" - could be used to describe the
351             version of the transport entity.
352           </doc:summary>
353         </doc:doc>
354       </arg>
355       <arg type="b" name="must_authenticate" direction="in">
356         <doc:doc>
357           <doc:summary>
358             <doc:para>
359               If false, then the peer is trusted and shall be given
360               access to SyncEvolution without further checks by
361               SyncEvolution itself. This is useful for peers which
362               already run as local user processes with same access
363               rights to the data as SyncEvolution or for transports that
364               authenticate and authorize access via their own
365               mechanisms.
366             </doc:para>
367
368             <doc:para>
369               If true, then a SyncML client peer must provide valid
370               credentials as part of the SyncML session. For a server,
371               a valid configuration must exist. SyncEvolution searches
372               for such a configuration by matching the sync URL in
373               the Notification with sync URLs in the configurations.
374             </doc:para>
375           </doc:summary>
376         </doc:doc>
377       </arg>
378       <arg type="s" name="session" direction="in">
379         <doc:doc>
380           <doc:summary>
381             If this is a reconnect for an older session,
382             then pass the session ID here. Otherwise
383             pass an empty string. New session IDs are created in
384             response to the initial message, see Reply signal.
385           </doc:summary>
386         </doc:doc>
387       </arg>      
388       <arg type="o" name="connection" direction="out">
389         <doc:doc>
390           <doc:summary>
391             The connection object created by SyncEvolution in response
392             to this connection request. Implements the
393             org.syncevolution.Connection interface.
394           </doc:summary>
395         </doc:doc>
396       </arg>
397     </method>
398
399     <method name="GetSessions">
400       <doc:doc><doc:description>
401         Get currently existing sessions. This includes active and
402         queueing sessions.
403       </doc:description></doc:doc>
404       <arg type="ao" name="sessions" direction="out">
405         <doc:doc><doc:summary>array of session D-Bus object paths,
406             in the order in which they will run, running ones first</doc:summary></doc:doc>
407       </arg>
408     </method>
409
410     <signal name="SessionChanged">
411       <doc:doc><doc:description>Session start or end</doc:description></doc:doc>
412       <arg type="o" name="session">
413         <doc:doc><doc:summary>session D-Bus object path</doc:summary></doc:doc>
414       </arg>
415       <arg type="b" name="started">
416         <doc:doc><doc:summary>
417           TRUE if session was started and is active now (= ready for use),
418           FALSE if it ended
419         </doc:summary></doc:doc>
420       </arg>
421     </signal>
422
423     <signal name="TemplatesChanged">
424       <doc:doc>
425         <doc:description>
426           Template added or removed, for example because a Bluetooth
427           peer was paired resp. removed. To find out more, request
428           list of templates anew.
429       </doc:description>
430       </doc:doc>
431     </signal>
432
433     <signal name="Presence">
434       <doc:doc>
435         <doc:description>
436           Indicates whether a server can be reached right now.  This
437           signal can be used by GUIs to prevent starting a sync when
438           it is known to fail, for example because the network is
439           currently down.
440
441           At the moment, the SyncEvolution server can only monitor
442           network connectivity, which is a cheap local operation and
443           thus done unconditionally while the server runs (see
444           Attach()). Detecting the presence of non-HTTP-based peers
445           might be more costly. Additional APIs might be added to turn
446           that on only when needed. The CheckPresence() method will
447           always force a check.
448         </doc:description>
449       </doc:doc>
450       <arg type="s" name="server">
451         <doc:doc><doc:summary>
452           name of the server configuration
453         </doc:summary></doc:doc>
454       </arg>
455       <arg type="s" name="status">
456         <doc:doc>
457           <doc:summary>
458             "no transport" - the transport necessary to reach the server is not working.
459             "not present" - the server is known to be down or unreachable.
460             "" - the server might be usable. Syncs can still fail.
461             Other non-empty strings might be added in the future. They always
462             indicate a condition which prevents syncing.
463           </doc:summary>
464         </doc:doc>
465       </arg>
466       <arg type="s" name="transport">
467         <doc:doc>
468           <doc:summary>
469             If the server can be reached via multiple transports, this
470             is the one which triggered the signal. Content of the
471             string to be decided...
472           </doc:summary>
473         </doc:doc>
474       </arg>
475     </signal>
476
477     <signal name="InfoRequest">
478       <doc:doc>
479         <doc:description>
480           <doc:para>
481             Emitted whenever the server needs information that only a
482             client can provide. Because the server does not know whether
483             clients are monitoring it (attaching to the server is
484             optional) and/or which of the attached clients are able to
485             handle the request, it broadcasts the request.
486           </doc:para>
487
488           <doc:para>
489             Clients react by calling InfoResponse.  The flow is this:
490             information needed, InfoRequest("request"),
491             InfoResponse("working") + dialog is opened (if necessary),
492             InfoRequest("waiting"), information becomes available,
493             InfoResponse("response"), InfoRequest("done").
494           </doc:para>
495
496           <doc:para>
497             Clients should work on those requests that they support,
498             unless another client was faster (InfoRequest("waiting")).
499             Because there is a race condition, multiple dialogs might
500             be opened. The user only has to enter data in one of them.
501             A client can close his dialog upon InfoRequest("done")
502             and/or InfoRequest("waiting") with a 'handler' parameter
503             which is some other client. If the server does not get a
504             InfoResponse("working") soon enough (in the range of
505             minutes, not seconds), it has to assume that no client can
506             provide the information and fall back to some default or
507             abort.
508           </doc:para>
509         </doc:description>
510       </doc:doc>
511
512       <arg type="s" name="id">
513         <doc:doc><doc:summary>unique ID for the request</doc:summary></doc:doc>
514       </arg>
515       <arg type="o" name="session">
516         <doc:doc><doc:summary>the Session which is affected, may be empty</doc:summary></doc:doc>
517       </arg>
518       <arg type="s" name="state">
519         <doc:doc>
520           <doc:summary>
521             "request" for a new request,
522             "waiting" for one which is being serviced by some client,
523             "done" for a request which was resolved or timed out
524           </doc:summary>
525         </doc:doc>
526       </arg>
527       <arg type="o" name="handler">
528         <doc:doc>
529           <doc:summary>
530             for state="waiting": the client which first replied
531             with InfoResponse("working")
532           </doc:summary>
533         </doc:doc>
534       </arg>
535       <arg type="s" name="type">
536         <doc:doc>
537           <doc:summary>
538             Determines which information is needed. Currently only
539             "password" for interactive password requests is defined.
540           </doc:summary>
541         </doc:doc>
542       </arg>
543
544       <arg type="a{ss}" name="parameters">
545         <doc:doc>
546           <doc:summary>
547             Auxiliary parameters which depend on the type.
548
549             For "password" the following keys are used:
550             "name" - name of the password property in the config.
551             "description" - unique English description of the required password.
552             Content is determined by the individual password property, so this
553             may change. Currently used are "SyncML Server", "proxy",
554             "'source name' backend" (with 'source name' replaced by the same
555             names also used for the corresponding config entry).
556             "user", "server", "domain", "object", "protocol", "authtype", "port" -
557             optional keys as they would be used in the GNOME keyring.
558           </doc:summary>
559         </doc:doc>
560       </arg>
561     </signal>
562
563     <method name="InfoResponse">
564       <doc:doc><doc:description>reply for a specific InfoRequest</doc:description></doc:doc>
565
566       <arg type="s" name="id">
567         <doc:doc><doc:summary>unique ID sent by InfoRequest</doc:summary></doc:doc>
568       </arg>
569       <arg type="s" name="state">
570         <doc:doc>
571           <doc:summary>
572             "working" to indicate that a response will be sent later,
573             "response" for the actual reply
574           </doc:summary>
575         </doc:doc>
576       </arg>
577
578       <arg type="a{ss}" name="response">
579         <doc:doc>
580           <doc:summary>
581             Response values, valid in state="response", depend on type.
582
583             For "password" the following keys are used:
584             "password" - the password text, optional, do not set the key if the
585             user cancelled the request
586           </doc:summary>
587         </doc:doc>
588       </arg>
589     </method>
590
591   </interface>
592 </node>