summaryrefslogtreecommitdiff
path: root/spec/Connection_Interface_Requests.xml
blob: 0368cae115618472cdd370082a7305c891ff3e15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
<?xml version="1.0" ?>
<node name="/Connection_Interface_Requests"
  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
  >
  <tp:copyright>Copyright (C) 2008 Collabora Limited</tp:copyright>
  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
  <tp:license xmlns="http://www.w3.org/1999/xhtml">
    <p>This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
      License as published by the Free Software Foundation; either
      version 2.1 of the License, or (at your option) any later version.</p>

    <p>This library is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Lesser General Public License for more details.</p>

    <p>You should have received a copy of the GNU Lesser General Public
      License along with this library; if not, write to the Free Software
      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
      USA.</p>
  </tp:license>

  <interface name="im.telepathy.v1.Connection.Interface.Requests">
    <tp:requires interface="im.telepathy.v1.Connection"/>
    <tp:added version="0.17.11">(as stable API)</tp:added>

    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>An interface for channel requests and channel lists. Under
        normal circumstances, applications should deal with this
        interface via the <tp:dbus-ref
          namespace="imt1">ChannelDispatcher</tp:dbus-ref>,
        but lower-level Telepathy applications (such as the
        ChannelDispatcher itself) might need to use this interface
        directly.</p>

      <p>This interface is conceptually part of the core Connection
        interface, but is kept separate so that its properties will
        normally only need to be retrieved by the ChannelDispatcher,
        and its signals will normally only wake up the ChannelDispatcher.</p>
    </tp:docstring>

    <tp:struct name="Channel_Details" array-name="Channel_Details_List">
      <tp:added version="0.17.11">(as stable API)</tp:added>

      <tp:docstring>
        Enough details of a channel that clients can work out how to dispatch
        or handle it.
      </tp:docstring>

      <tp:member name="Channel" type="o">
        <tp:docstring>
          The object path of the channel.
        </tp:docstring>
      </tp:member>

      <tp:member name="Properties" type="a{sv}"
        tp:type="Qualified_Property_Value_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>Properties of the channel.</p>

          <p>Connection managers MUST NOT include properties in this mapping
            if their values can change. Clients MUST ignore properties
            that appear in this mapping if their values can change.</p>

          <tp:rationale>
            <p>If properties that could change were included, the following
              race condition would be likely to exist in some cases:</p>

            <ul>
              <li>NewChannel or Get("Channels") includes a property P with
                value V1</li>
              <li>Client creates a proxy object for the channel</li>
              <li>The value of P changes to V2</li>
              <li>Client connects to PChanged signal</li>
              <li>Client should call Get("P") or GetAll here, to avoid the
                race, but client's author has forgotten to do so</li>
              <li>Proxy object thinks P == V1, but actually P == V2</li>
            </ul>

            <p>We've taken the opportunity to make the API encourage the
              client author to get it right. Where possible, we intend that
              properties whose value will be used in channel dispatching
              or other "early" processing will be defined so that they are
              immutable (can never change).</p>
          </tp:rationale>

          <p>Each dictionary MUST contain the keys
            <tp:dbus-ref>im.telepathy.v1.Channel.ChannelType</tp:dbus-ref>,
            <tp:dbus-ref>im.telepathy.v1.Channel.TargetEntityType</tp:dbus-ref>,
            <tp:dbus-ref>im.telepathy.v1.Channel.TargetHandle</tp:dbus-ref>,
            <tp:dbus-ref>im.telepathy.v1.Channel.TargetID</tp:dbus-ref>
            and
            <tp:dbus-ref>im.telepathy.v1.Channel.Requested</tp:dbus-ref>.
          </p>

          <tp:rationale>
            <p>We expect these to be crucial to the channel-dispatching
              process.</p>
          </tp:rationale>
        </tp:docstring>
      </tp:member>
    </tp:struct>

    <method name="CreateChannel" tp:name-for-bindings="Create_Channel">
      <tp:added version="0.17.11">(as stable API)</tp:added>
      <tp:changed version="0.17.14">It is now guaranteed that
        CreateChannel returns the channel before NewChannel announces it
        (the reverse was previously guaranteed).</tp:changed>

      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Request that an entirely new channel is created.</p>
      </tp:docstring>

      <arg direction="in" name="Request" type="a{sv}"
        tp:type="Qualified_Property_Value_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>A dictionary containing desirable properties, which MUST include
            <tp:dbus-ref
              namespace="im.telepathy.v1.Channel">ChannelType</tp:dbus-ref>.
            Some properties
            are defined such that only an exact match makes sense, and
            connection managers MUST NOT satisfy a request with a channel
            where that property does not match; some properties are defined
            such that the connection manager MAY treat the request as merely
            a hint, and make a best-effort attempt to satisfy it. This is
            documented separately for each property.</p>

          <p>If this dictionary contains a property whose semantics
            are not known to the connection manager, this method MUST fail
            without side-effects (in particular it must not create a new
            channel).</p>

          <tp:rationale>
            <p>This is necessary if we want to be able to invent properties
              in future that, when used in a request, are hard requirements
              rather than just hints. A connection manager that did not know
              the semantics of those properties could incorrectly return a
              new channel that did not satisfy the requirements.</p>
          </tp:rationale>

          <p>The connection manager MUST NOT respond successfully,
            and SHOULD NOT create a new channel or cause any other
            side-effects, unless it can create a new channel that satisfies
            the client's requirements.</p>

          <p>Properties that will be set by this argument need not have write
            access after the channel has been created - indeed, it is
            expected that most will be read-only.</p>
        </tp:docstring>
      </arg>

      <arg name="Channel" direction="out" type="o">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The Channel object, which MUST NOT be signalled with
            <tp:member-ref>NewChannel</tp:member-ref> until after this method
            returns.</p>

          <tp:rationale>
            <p>This allows the requester to alter its handling of
              NewChannel by knowing whether the channel satisfied
              a request it made.</p>
          </tp:rationale>
        </tp:docstring>
      </arg>

      <arg name="Properties" direction="out" type="a{sv}"
        tp:type="Qualified_Property_Value_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>Properties of the channel that was produced, equivalent to
            the properties in <tp:type>Channel_Details</tp:type>.
            Connection managers MUST NOT include properties here whose
            values can change, for the same reasons as in
            <tp:type>Channel_Details</tp:type>.</p>
        </tp:docstring>
      </arg>

      <tp:possible-errors>
        <tp:error name="im.telepathy.v1.Error.Disconnected"/>
        <tp:error name="im.telepathy.v1.Error.NetworkError"/>
        <tp:error name="im.telepathy.v1.Error.NotImplemented">
          <tp:docstring>
            The channel request was one that can never succeed,
            such as requesting an unsupported channel type, or requesting
            a channel type which this connection manager does not support with
            the given target handle type.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.InvalidHandle">
          <tp:docstring>
            An invalid handle was requested as the value of a property whose
            value is a handle (like
            <tp:dbus-ref namespace="im.telepathy.v1">Channel.TargetHandle</tp:dbus-ref>),
            or a syntactically invalid identifier was requested as the value
            of a property whose value is the string corresponding to a handle
            (like <tp:dbus-ref
            namespace="im.telepathy.v1">Channel.TargetID</tp:dbus-ref>).
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.InvalidArgument">
          <tp:docstring>
            The request matched the fixed properties of a
            <tp:type>Requestable_Channel_Class</tp:type> in
            <tp:dbus-ref namespace="imt1.Connection">RequestableChannelClasses</tp:dbus-ref>, but the
            allowed arguments did not make sense; for example, a <tp:dbus-ref
              namespace="im.telepathy.v1.Channel.Type">RoomList1</tp:dbus-ref>
            was requested, but the <tp:dbus-ref
              namespace="im.telepathy.v1.Channel.Type.RoomList1">Server</tp:dbus-ref>
            property provided was not a valid DNS name.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.NotCapable">
          <tp:docstring>
            The requested channel cannot be created because the requested
            contact is using a client that lacks a particular feature.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.Offline">
          <tp:docstring>
            The requested channel cannot be created because the target is
            offline.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.NotAvailable">
          <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
            <p>The requested channel cannot be created, but in
              principle, a similar request might succeed in future.
              For instance, this might be because:</p>

            <ul>
              <li>a channel matching the request already exists and the
                protocol requires that only one such channel can exist at a
                time</li>
              <li>a channel matching the request has already been requested
                (by a previous call to CreateChannel,
                <tp:member-ref>EnsureChannel</tp:member-ref>,
                or similar) and the protocol requires that only one such
                channel can exist at a time</li>
            </ul>
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.Channel.Banned"/>
        <tp:error name="im.telepathy.v1.Error.Channel.Full"/>
        <tp:error name="im.telepathy.v1.Error.Channel.InviteOnly"/>
        <tp:error name="im.telepathy.v1.Error.PermissionDenied"/>
      </tp:possible-errors>
    </method>

    <method name="EnsureChannel" tp:name-for-bindings="Ensure_Channel">
      <tp:added version="0.17.12"/>
      <tp:changed version="0.17.14">It is now guaranteed that if
        the channel was created by this call to EnsureChannel, it's returned
        before NewChannel announces it (the reverse was previously
        guaranteed).</tp:changed>

      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Request that channels are ensured to exist.</p>

        <tp:rationale>
          <p>The connection manager is in the best position to determine which
            existing channels could satisfy which requests.</p>
        </tp:rationale>

      </tp:docstring>

      <arg direction="in" name="Request" type="a{sv}"
        tp:type="Qualified_Property_Value_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>A dictionary containing desirable properties, with the same
            semantics as the corresponding parameter to
            <tp:member-ref>CreateChannel</tp:member-ref>.</p>
        </tp:docstring>
      </arg>

      <arg name="Yours" direction="out" type="b">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>If false, the caller of EnsureChannel MUST assume that some
            other process is handling this channel; if true, the caller of
            EnsureChannel SHOULD handle it themselves or delegate it to another
            client.</p>

          <p>If the creation of a channel makes several calls to EnsureChannel
            (and no other requests) successful, exactly one of those calls MUST
            return a true value for this argument.</p>

          <p>If the creation of a channel makes other requests successful,
            the value returned for this argument MUST be such that exactly
            one of the clients making requests ends up responsible for the
            channel. In particular, if
            <tp:member-ref>CreateChannel</tp:member-ref> returns a channel
            <em>C</em>, any EnsureChannel calls that also return <em>C</em>
            MUST return a false value for this argument.</p>
        </tp:docstring>
      </arg>

      <arg name="Channel" direction="out" type="o">
        <tp:docstring>
          The Channel object. If it was created as a result of this method
          call, it MUST NOT be signalled by
          <tp:member-ref>NewChannel</tp:member-ref> until after this method
          returns.

          <tp:rationale>
            <p>This allows the requester to alter its handling of
              NewChannel by knowing whether the channel satisfied
              a request it made.</p>
          </tp:rationale>
        </tp:docstring>
      </arg>

      <arg name="Properties" direction="out" type="a{sv}"
        tp:type="Qualified_Property_Value_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>Properties of the channel that was produced, equivalent to
            the properties in <tp:type>Channel_Details</tp:type>.
            Connection managers MUST NOT include properties here whose
            values can change, for the same reasons as in
            <tp:type>Channel_Details</tp:type>.</p>
        </tp:docstring>
      </arg>

      <tp:possible-errors>
        <tp:error name="im.telepathy.v1.Error.Disconnected"/>
        <tp:error name="im.telepathy.v1.Error.NetworkError"/>
        <tp:error name="im.telepathy.v1.Error.NotImplemented">
          <tp:docstring>
            The channel request was one that can never succeed,
            such as requesting an unsupported channel type, or requesting
            a channel type which this connection manager does not support with
            the given target handle type.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.InvalidHandle">
          <tp:docstring>
            An invalid handle was requested as the value of a property whose
            value is a handle (like
            <tp:dbus-ref namespace="im.telepathy.v1">Channel.TargetHandle</tp:dbus-ref>),
            or a syntactically invalid identifier was requested as the value
            of a property whose value is the string corresponding to a handle
            (like <tp:dbus-ref
            namespace="im.telepathy.v1">Channel.TargetID</tp:dbus-ref>).
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.InvalidArgument">
          <tp:docstring>
            The request matched the fixed properties of a
            <tp:type>Requestable_Channel_Class</tp:type> in
            <tp:dbus-ref namespace="imt1.Connection">RequestableChannelClasses</tp:dbus-ref>, but the
            allowed arguments did not make sense; for example, a <tp:dbus-ref
              namespace="im.telepathy.v1.Channel.Type">RoomList1</tp:dbus-ref>
            was requested, but the <tp:dbus-ref
              namespace="im.telepathy.v1.Channel.Type.RoomList1">Server</tp:dbus-ref>
            property provided was not a valid DNS name.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.NotCapable">
          <tp:docstring>
            The requested channel cannot be created because the requested
            contact is using a client that lacks a particular feature.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.Offline">
          <tp:docstring>
            The requested channel cannot be created because the target is
            offline.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.NotAvailable">
          <tp:docstring>
            The requested channel cannot be created, but in
            principle, a similar request might succeed in future.
          </tp:docstring>
        </tp:error>
        <tp:error name="im.telepathy.v1.Error.Channel.Banned"/>
        <tp:error name="im.telepathy.v1.Error.Channel.Full"/>
        <tp:error name="im.telepathy.v1.Error.Channel.InviteOnly"/>
        <tp:error name="im.telepathy.v1.Error.PermissionDenied"/>
      </tp:possible-errors>
    </method>

    <signal name="NewChannel" tp:name-for-bindings="New_Channel">
      <tp:added version="0.99.7"/>

      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>A new channel has been created.</p>

        <p>Unlike in some previous Telepathy versions, the connection manager
          cannot emit a single signal for multiple channels.
          For example, joining a MUC Tube in XMPP requires joining the
          corresponding MUC (chatroom). Either the connection manager
          should announce a new <tp:dbus-ref
          namespace="imt1.Channel.Type">Text</tp:dbus-ref> channel
          separately, or not expose the Text channel on the bus
          until it's actually requested (or an incoming message
          appears).</p>

        <tp:rationale>
          <p>Signalling the creation of multiple channels together
            makes writing simple clients much more complicated, can
            result in lost messages, and isn't nearly as useful in
            practice as it sounds.</p>
        </tp:rationale>
      </tp:docstring>

      <arg name="Channel" type="o">
        <tp:docstring>
          The object path of the channel.
        </tp:docstring>
      </arg>

      <arg name="Properties" type="a{sv}"
        tp:type="Qualified_Property_Value_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The same properties of the channel that would appear in the
            <tp:type>Channel_Details</tp:type> struct.</p>
        </tp:docstring>
      </arg>
    </signal>

    <property name="Channels" tp:name-for-bindings="Channels"
      type="a(oa{sv})" access="read" tp:type="Channel_Details[]">
      <tp:added version="0.17.11">(as stable API)</tp:added>
      <tp:docstring>
        A list of all the channels which currently exist on this connection.
        Change notification is via the
        <tp:member-ref>NewChannel</tp:member-ref> and
        <tp:member-ref>ChannelClosed</tp:member-ref> signals.
      </tp:docstring>
    </property>

    <signal name="ChannelClosed" tp:name-for-bindings="Channel_Closed">
      <tp:added version="0.17.11">(as stable API)</tp:added>
      <tp:docstring>
        Emitted when a channel is closed and hence disappears from the
        <tp:member-ref>Channels</tp:member-ref> property.

        <tp:rationale>
          This is redundant with the <tp:dbus-ref
            namespace="im.telepathy.v1.Channel">Closed</tp:dbus-ref>
          signal on the channel itself, but it does provide full change
          notification for the Channels property.
        </tp:rationale>
      </tp:docstring>

      <arg name="Removed" type="o">
        <tp:docstring>
          The channel which has been removed from the Channels property
        </tp:docstring>
      </arg>
    </signal>

  </interface>
</node>
<!-- vim:set sw=2 sts=2 et ft=xml: -->