2 <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
3 <interface name="org.syncevolution.Server">
6 Server is the entry object for SyncEvolution client API. It
7 can be used to query information and to start and monitor
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
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.
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".
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
48 <method name="Attach">
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
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()
65 <method name="Detach">
68 Detaches an attached client. A client which disconnects
69 from D-Bus is automatically detached from the server.
74 <method name ="GetConfigs">
75 <doc:doc><doc:description>
76 Get an array of all configured servers (or templates)
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_<mac address>_<number>', where number
81 enumerates the templates created for the device.
83 Get these templates latter when calling GetConfig with additional new
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
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
97 </doc:summary></doc:doc>
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>
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>
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>
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/<source name>" 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
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.
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>
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>
152 <arg type="s" name="status" direction="out">
155 See Presence signal for details.
159 <arg type="as" name="transports" direction="out">
162 All currently available transports. See Presence signal for details.
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>
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>
181 <arg type="u" name="count" direction="in">
182 <doc:doc><doc:summary>
183 maximum number of returned reports
184 </doc:summary></doc:doc>
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'
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.
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>
213 <method name="GetDatabases">
216 Get list of available databases that can be synchronized
220 <arg type="s" name="server" direction="in">
221 <doc:doc><doc:summary>server name</doc:summary></doc:doc>
223 <arg type="s" name="source" direction="in">
226 name of the source configuration which defines
227 the backend ("type" property)
231 <arg type="a(ssb)" name="databases" direction="out">
232 <doc:doc><doc:summary>information about all available databases</doc:summary></doc:doc>
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
245 <method name="CheckSource">
247 <doc:description>Tests whether the source configuration
248 is correct. Raises the SourceUnusable exception if not.
251 <arg type="s" name="server" direction="in">
252 <doc:doc><doc:summary>server name</doc:summary></doc:doc>
254 <arg type="s" name="source" direction="in">
257 name of the source configuration which is to be tested
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>
272 <arg type="o" name="session" direction="out">
273 <doc:doc><doc:summary>session D-Bus object path</doc:summary></doc:doc>
277 <method name="Connect">
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.
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
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.
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.
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.
326 <arg type="a{ss}" name="peer" direction="in">
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
334 "description" - a description of the peer in a format and
335 language that is understood by the user.
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
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.
350 "transport_description" - could be used to describe the
351 version of the transport entity.
355 <arg type="b" name="must_authenticate" direction="in">
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
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.
378 <arg type="s" name="session" direction="in">
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.
388 <arg type="o" name="connection" direction="out">
391 The connection object created by SyncEvolution in response
392 to this connection request. Implements the
393 org.syncevolution.Connection interface.
399 <method name="GetSessions">
400 <doc:doc><doc:description>
401 Get currently existing sessions. This includes active and
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>
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>
415 <arg type="b" name="started">
416 <doc:doc><doc:summary>
417 TRUE if session was started and is active now (= ready for use),
419 </doc:summary></doc:doc>
423 <signal name="TemplatesChanged">
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.
433 <signal name="Presence">
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
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.
450 <arg type="s" name="server">
451 <doc:doc><doc:summary>
452 name of the server configuration
453 </doc:summary></doc:doc>
455 <arg type="s" name="status">
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.
466 <arg type="s" name="transport">
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...
477 <signal name="InfoRequest">
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.
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").
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
512 <arg type="s" name="id">
513 <doc:doc><doc:summary>unique ID for the request</doc:summary></doc:doc>
515 <arg type="o" name="session">
516 <doc:doc><doc:summary>the Session which is affected, may be empty</doc:summary></doc:doc>
518 <arg type="s" name="state">
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
527 <arg type="o" name="handler">
530 for state="waiting": the client which first replied
531 with InfoResponse("working")
535 <arg type="s" name="type">
538 Determines which information is needed. Currently only
539 "password" for interactive password requests is defined.
544 <arg type="a{ss}" name="parameters">
547 Auxiliary parameters which depend on the type.
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.
563 <method name="InfoResponse">
564 <doc:doc><doc:description>reply for a specific InfoRequest</doc:description></doc:doc>
566 <arg type="s" name="id">
567 <doc:doc><doc:summary>unique ID sent by InfoRequest</doc:summary></doc:doc>
569 <arg type="s" name="state">
572 "working" to indicate that a response will be sent later,
573 "response" for the actual reply
578 <arg type="a{ss}" name="response">
581 Response values, valid in state="response", depend on type.
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