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
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
|
Network Working Group M. Rose
Request for Comments: 3343 Dover Beach Consulting, Inc.
Category: Experimental G. Klyne
Nine by Nine
D. Crocker
Brandenburg InternetWorking
April 2003
The Application Exchange (APEX) Presence Service
Status of this Memo
This memo defines an Experimental Protocol for the Internet
community. It does not specify an Internet standard of any kind.
Discussion and suggestions for improvement are requested.
Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2003). All Rights Reserved.
Abstract
This memo describes the Application Exchange (APEX) presence service,
addressed as the well-known endpoint "apex=presence". The presence
service is used to manage presence information for APEX endpoints.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Use and Management of Presence Information . . . . . . . . . . 3
2.1 Update of Presence Information . . . . . . . . . . . . . . . . 3
2.2 Distribution of Presence Information . . . . . . . . . . . . . 4
2.3 Distribution of Watcher Information . . . . . . . . . . . . . 7
3. Format of Presence Entries . . . . . . . . . . . . . . . . . . 10
4. The Presence Service . . . . . . . . . . . . . . . . . . . . . 11
4.1 Use of XML and MIME . . . . . . . . . . . . . . . . . . . . . 12
4.2 The Subscribe Operation . . . . . . . . . . . . . . . . . . . 13
4.3 The Watch Operation . . . . . . . . . . . . . . . . . . . . . 14
4.4 The Publish Operation . . . . . . . . . . . . . . . . . . . . 15
4.5 The Terminate Operation . . . . . . . . . . . . . . . . . . . 17
4.6 The Notify Operation . . . . . . . . . . . . . . . . . . . . . 17
4.7 The Reply Operation . . . . . . . . . . . . . . . . . . . . . 18
5. Registration: The Presence Service . . . . . . . . . . . . . . 18
6. The Presence Service DTD . . . . . . . . . . . . . . . . . . . 18
7. Security Considerations . . . . . . . . . . . . . . . . . . . 21
References . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Rose, et al. Experimental [Page 1]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 22
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 22
Full Copyright Statement . . . . . . . . . . . . . . . . . . . 23
1. Introduction
This memo describes a presence service that is built upon the APEX
[1] "relaying mesh". The APEX presence service is used to manage
presence information for APEX endpoints.
APEX, at its core, provides a best-effort datagram service. Within
an administrative domain, all relays must be able to handle messages
for any endpoint within that domain. APEX services are logically
defined as endpoints, but given their ubiquitous semantics they do
not necessarily need to be associated with a single physical
endpoint. As such, they may be provisioned co-resident with each
relay within an administrative domain, even though they are logically
provided on top of the relaying mesh, i.e.,
+----------+ +----------+ +----------+ +---------+
| APEX | | APEX | | APEX | | |
| access | | presence | | report | | ... |
| service | | service | | service | | |
+----------+ +----------+ +----------+ +---------+
| | | |
| | | |
+----------------------------------------------------------------+
| |
| APEX core |
| |
+----------------------------------------------------------------+
That is, applications communicate with an APEX service by exchanging
data with a "well-known endpoint" (WKE).
APEX applications communicate with the presence service by exchanging
data with the well-known endpoint "apex=presence" in the
corresponding administrative domain, e.g.,
"apex=presence@example.com" is the endpoint associated with the
presence service in the "example.com" administrative domain.
Note that within a single administrative domain, the presence service
makes use of the APEX access [3] service in order to determine if an
originator is allowed to view or manage presence information.
Rose, et al. Experimental [Page 2]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
2. Use and Management of Presence Information
Management of presence information falls into three categories:
o applications may update the presence information associated with
an endpoint;
o applications may subscribe to receive presence information
associated with an endpoint; and,
o applications may find out who is subscribed to receive presence
information.
Each is now described in turn.
2.1 Update of Presence Information
When an application wants to modify the presence information
associated with an endpoint, it sends a publish operation to the
service, e.g.,
+-------+ +-------+
| | -- data -------> | |
| appl. | | relay |
| | <--------- ok -- | |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='fred@example.com' />
<recipient identity='apex=presence@example.com' />
<data-content Name='Content'>
<publish publisher='fred@example.com' transID='1'
timeStamp='2000-05-14T13:30:00-08:00'>
<presence publisher='fred@example.com'
lastUpdate='2000-05-14T13:02:00-08:00'
publisherInfo='http://www.example.com/fred/'>
<tuple
destination='apex:fred/appl=im@example.com'
availableUntil='2000-05-14T14:02:00-08:00' />
<tuple destination='mailto:fred@flintstone.com'
availableUntil='2525-12-31T23:59:59-08:00' />
</presence>
</publish>
</data-content>
</data>
S: <ok />
Rose, et al. Experimental [Page 3]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
Note that this example uses the "subaddress" convention specified in
Section 2.2 of [1] (e.g., "fred/appl=im") to denote multiplexing of
traffic for a particular endpoint. Of course, popular applications
may have their own URI method assigned to them (e.g.,
"im:fred@example.com").
The service immediately responds with a reply operation containing
the same transaction-identifier, e.g.,
+-------+ +-------+
| | <------- data -- | |
| relay | | pres. |
| | -- ok ---------> | svc. |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='apex=presence@example.com' />
<recipient identity='fred@example.com' />
<data-content Name='Content'>
<reply code='250' transID='1' />
</data-content>
</data>
S: <ok />
2.2 Distribution of Presence Information
When an application wants to (periodically) receive the presence
information associated with an endpoint, it sends a subscribe
operation to the service, e.g.,
+-------+ +-------+
| | -- data -------> | |
| appl. | | relay |
| | <--------- ok -- | |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='wilma@example.com' />
<recipient identity='apex=presence@example.com' />
<data-content Name='Content'>
<subscribe publisher='fred@example.com' duration='86400'
transID='100' />
</data-content>
</data>
S: <ok />
Rose, et al. Experimental [Page 4]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
The service immediately responds with a publish operation containing
the same transaction-identifier, e.g.,
+-------+ +-------+
| | <------- data -- | |
| relay | | pres. |
| | -- ok ---------> | svc. |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='apex=presence@example.com' />
<recipient identity='wilma@example.com' />
<data-content Name='Content'>
<publish publisher='fred@example.com' transID='100'
timeStamp='2000-05-14T13:30:00-08:00'>
<presence publisher='fred@example.com'
lastUpdate='2000-05-14T13:02:00-08:00'
publisherInfo='http://www.example.com/fred/'>
<tuple
destination='apex:fred/appl=im@example.com'
availableUntil='2000-05-14T14:02:00-08:00' />
</presence>
</publish>
</data-content>
</data>
S: <ok />
Subsequently, for up to the specified "duration", the service sends
new publish operations whenever there are any changes to the
endpoint's presence information. If the "duration" is zero-valued, a
one time poll of the presence information is achieved; otherwise, at
the end of the "duration", a terminate operation is sent.
Note that Step 5 of Section 4.4 requires that the "lastUpdate"
attribute of a presence entry be supplied in order to update that
entry; accordingly, applications must successfully retrieve a
presence entry prior to trying to update that entry. This is usually
accomplished by subscribing with a zero-valued duration.
(Regardless, administrators should ensure that applications
authorized to update a presence entry are also authorized to retrieve
that entry.)
Rose, et al. Experimental [Page 5]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
Either the subscriber or the service may cancel a subscription by
sending a terminate operation, e.g.,
+-------+ +-------+
| | -- data -------> | |
| appl. | | relay |
| | <--------- ok -- | |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='wilma@example.com' />
<recipient identity='apex=presence@example.com' />
<data-content Name='Content'>
<terminate transID='100' />
</data-content>
</data>
S: <ok />
+-------+ +-------+
| | <------- data -- | |
| relay | | pres. |
| | -- ok ---------> | svc. |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='apex=presence@example.com' />
<recipient identity='wilma@example.com' />
<data-content Name='Content'>
<reply code='250' transID='100' />
</data-content>
</data>
S: <ok />
or
+-------+ +-------+
| | <------- data -- | |
| relay | | pres. |
| | -- ok ---------> | svc. |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='apex=presence@example.com' />
<recipient identity='wilma@example.com' />
<data-content Name='Content'>
<terminate transID='100' />
</data-content>
</data>
S: <ok />
Rose, et al. Experimental [Page 6]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
2.3 Distribution of Watcher Information
When an application wants to (periodically) receive notices about
endpoints that are subscribed to receive presence information, it
sends a watch operation to the service, e.g.,
+-------+ +-------+
| | -- data -------> | |
| appl. | | relay |
| | <--------- ok -- | |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='fred@example.com' />
<recipient identity='apex=presence@example.com' />
<data-content Name='Content'>
<watch publisher='fred@example.com' duration='86400'
transID='2' />
</data-content>
</data>
S: <ok />
The service immediately responds with a reply operation containing
the same transaction-identifier, e.g.,
+-------+ +-------+
| | <------- data -- | |
| relay | | pres. |
| | -- ok ---------> | svc. |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='apex=presence@example.com' />
<recipient identity='fred@example.com' />
<data-content Name='Content'
<reply code='250' transID='2' />
</data-content>
</data>
S: <ok />
Rose, et al. Experimental [Page 7]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
For each current subscriber, the service immediately sends a notify
operation containing the same transaction-identifier, e.g.,
+-------+ +-------+
| | <------- data -- | |
| relay | | pres. |
| | -- ok ---------> | svc. |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='apex=presence@example.com' />
<recipient identity='fred@example.com' />
<data-content Name='Content'>
<notify subscriber='wilma@example.com' transID='2'
duration='86000' action='subscribe' />
</data-content>
</data>
S: <ok />
Subsequently, for up to the specified "duration", the service sends
new notify operations whenever an application subscribes successfully
or a subscription is terminated. If the "duration" is zero-valued, a
one time poll of the watcher information is achieved; otherwise, at
the end of the "duration", a terminate operation is sent.
Rose, et al. Experimental [Page 8]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
Either the watcher or the service may cancel the request by sending a
terminate operation, e.g.,
+-------+ +-------+
| | -- data -------> | |
| appl. | | relay |
| | <--------- ok -- | |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='fred@example.com' />
<recipient identity='apex=presence@example.com' />
<data-content Name='Content'>
<terminate transID='2' />
</data-content>
</data>
S: <ok />
+-------+ +-------+
| | <------- data -- | |
| relay | | pres. |
| | -- ok ---------> | svc. |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='apex=presence@example.com' />
<recipient identity='fred@example.com' />
<data-content Name='Content'>
<reply code='250' transID='2' />
</data-content>
</data>
S: <ok />
or
+-------+ +-------+
| | <------- data -- | |
| relay | | pres. |
| | -- ok ---------> | svc. |
+-------+ +-------+
C: <data content='#Content'>
<originator identity='apex=presence@example.com' />
<recipient identity='fred@example.com' />
<data-content Name='Content'>
<terminate transID='2' />
</data-content>
</data>
S: <ok />
Rose, et al. Experimental [Page 9]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
3. Format of Presence Entries
Each administrative domain is responsible for maintaining a "presence
entry" for each of its endpoints (regardless of whether those
endpoints are currently attached to the relaying mesh).
Section 6 defines the syntax for presence entries. Each presence
entry has a "publisher" attribute, a "lastUpdate" attribute, a
"publisherInfo" attribute, and contains one or more "tuple" elements:
o the "publisher" attribute specifies the endpoint associated with
the presence entry;
o the "lastUpdate" attribute specifies the date and time that the
service last updated the presence entry;
o the "publisherInfo" attribute specifies arbitrary information
about the publisher (using a URI); and,
o each "tuple" element specifies information about an entity
associated with the endpoint.
Each "tuple" element has a "destination" attribute, an
"availableUntil" attribute, a "tupleInfo" attribute, and contains
zero or more "capability" elements:
o the "destination" attribute identifies the entity as a URI (e.g.,
"apex:fred/appl=im@example.com" or "mailto:fred@flintstone.com");
o the "availableUntil" attribute specifies the latest date and time
that the entity is capable of receiving messages;
o the "tupleInfo" attribute specifies arbitrary information about
the entity (using a URI); and,
o each "capability" element contains a specification as to the kinds
of content the entity is capable of receiving.
Each "capability" element contains arbitrary character data formatted
according to the standard indicated in the element's "baseline"
attribute.
Rose, et al. Experimental [Page 10]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
4. The Presence Service
Section 5 contains the APEX service registration for the presence
service:
o Within an administrative domain, the service is addressed using
the well-known endpoint of "apex=presence".
o Section 6 defines the syntax of the operations exchanged with the
service.
o A consumer of the service initiates communications by sending data
containing the subscribe, watch, or publish operation.
o In addition to replying to these operations, the service may also
initiate communications by sending data containing the terminate,
publish, or notify operations.
An implementation of the service must maintain information about both
presence entries and in-progress operations in persistent storage.
Consult Section 6.1.1 of [1] for a discussion on the properties of
long-lived transaction-identifiers.
Rose, et al. Experimental [Page 11]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
4.1 Use of XML and MIME
Section 4.1 of [1] describes how arbitrary MIME content is exchanged
as a BEEP [2] payload. For example, to transmit:
<data content='...'>
<originator identity='apex=presence@example.com' />
<recipient identity='fred@example.com' />
</data>
where "..." refers to: <reply code='250' transID='1' />
then the corresponding BEEP message might look like this:
C: MSG 1 1 . 42 1234
C: Content-Type: multipart/related; boundary="boundary";
C: start="<1@example.com>";
C: type="application/beep+xml"
C:
C: --boundary
C: Content-Type: application/beep+xml
C: Content-ID: <1@example.com>
C:
C: <data content='cid:2@example.com'>
C: <originator identity='fred@example.com' />
C: <recipient identity='apex=presence@example.com' />
C: </data>
C: --boundary
C: Content-Type: application/beep+xml
C: Content-ID: <2@example.com>
C:
C: <reply code='250' transID='1' />
C: --boundary--
C: END
or this:
C: MSG 1 1 . 42 1234
C: Content-Type: application/beep+xml
C:
C: <data content='#Content'>
C: <originator identity='fred@example.com' />
C: <recipient identity='apex=presence@example.com' />
C: <data-content Name='Content'>
C: <reply code='250' transID='1' />
C: </data-content>
C: </data>
C: END
Rose, et al. Experimental [Page 12]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
4.2 The Subscribe Operation
When an application wants to (periodically) receive the presence
information associated with an endpoint, it sends a "subscribe"
element to the service.
The "subscribe" element has a "publisher" attribute, a "duration"
attribute, a "transID" attribute, and no content:
o the "publisher" attribute specifies the endpoint associated with
the presence entry;
o the "transID" attribute specifies the transaction-identifier
associated with this operation; and,
o the "duration" attribute specifies the maximum number of seconds
for which the originator is interested in receiving updated
presence information.
When the service receives a "subscribe" element, we refer to the
"publisher" attribute of that element as the "subject", and the
service performs these steps:
1. If the subject is outside of this administrative domain, a "reply"
element having code 553 is sent to the originator.
2. If the subject does not refer to a valid endpoint, a "reply"
element having code 550 is sent to the originator.
3. If the subject's access entry does not contain a
"presence:subscribe" token for the originator, a "reply" element
having code 537 is sent to the originator.
4. If the originator already has an in-progress subscribe operation
for the subject, then the previous subscribe operation is silently
terminated, and processing continues.
5. If the "transID" attribute refers to an in-progress subscribe or
watch operation for the originator, a "reply" element having code
555 is sent to the originator.
6. Otherwise:
1. A "publish" element, corresponding to the subject's presence
entry, is immediately sent to the originator.
Rose, et al. Experimental [Page 13]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
2. For each endpoint currently watching subscribers to the
subject's presence information, a "notify" element is
immediately as sent (c.f., Step 6.3 of Section 4.6).
3. For up to the amount of time indicated by the "duration"
attribute of the "subscribe" element, if the subject's presence
entry changes, an updated "presence" element is sent to the
originator using the publish operation (Section 4.4). Finally,
when the amount of time indicated by the "duration" attribute
expires, a terminate operation (Section 4.5) is sent to the
originator.
Note that if the duration is zero-valued, then the subscribe
operation is making a one-time poll of the presence information.
Accordingly, Step 6.3 above does not occur.
Regardless of whether a "publish" or "reply" element is sent to the
originator, the "transID" attribute is identical to the value found
in the "subscribe" element sent by the originator.
4.3 The Watch Operation
When an application wants to (periodically) receive notices about
endpoints that are subscribed to receive presence entry, it sends a
"watch" element to the service.
The "watch" element has a "publisher" attribute, a "duration"
attribute, a "transID" attribute, and no content:
o the "publisher" attribute specifies the endpoint associated with
the presence entry;
o the "transID" attribute specifies the transaction-identifier
associated with this operation; and,
o the "duration" attribute specifies the maximum number of seconds
for which the originator is interested in watching subscribers.
When the service receives a "watch" element, we refer to the
"publisher" attribute of that element as the "subject", and the
service performs these steps:
1. If the subject is outside of this administrative domain, a "reply"
element having code 553 is sent to the originator.
2. If the subject does not refer to a valid endpoint, a "reply"
element having code 550 is sent to the originator.
Rose, et al. Experimental [Page 14]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
3. If the subject's access entry does not contain a "presence:watch"
token for the originator, a "reply" element having code 537 is
sent to the originator.
4. If the originator already has an in-progress watch operation for
the subject, then the previous watch operation is silently
terminated, and processing continues.
5. If the "transID" attribute refers to an in-progress subscribe or
watch operation for the originator, a "reply" element having code
555 is sent to the originator.
6. Otherwise:
1. A "reply" element having code 250 is sent to the originator.
2. For each endpoint currently subscribing to the subject's
presence information, a "notify" element is immediately sent to
the originator (c.f., Section 4.6).
3. For up to the amount of time indicated by the "duration"
attribute of the "watch" element, whenever a subscribe
operation succeeds or a subscription is terminated, a "notify"
element is sent to the originator. Finally, when the amount of
time indicated by the "duration" attribute expires, a terminate
operation (Section 4.5) is sent to the originator.
Note that if the duration is zero-valued, then the watch operation
is making a one-time poll of the presence information.
Accordingly, Step 6.3 above does not occur.
Regardless of whether a "notify" or "reply" element is sent to the
originator, the "transID" attribute is identical to the value found
in the "presence" element sent by the originator.
4.4 The Publish Operation
When an application wants to modify the presence entry associated
with an endpoint, it sends a "publish" element to the service. In
addition, the service sends a "publish" element to endpoints that
have subscribed to see presence information (c.f., Section 4.2).
The "publish" element has a "publisher" attribute, a "transID"
attribute, a "timeStamp" attribute, and contains a "presence"
element:
o the "publisher" attribute specifies the endpoint to be associated
with the presence entry;
Rose, et al. Experimental [Page 15]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
o the "transID" attribute specifies the transaction-identifier
associated with this operation;
o the "timeStamp" attribute specifies the application's notion of
the current date and time; and,
o the "presence" element contains the desired presence entry for the
endpoint.
When the service sends a "publish" element, the "transID" attribute
specifies the transaction-identifier associated with the subscribe
operation that caused this "publish" element to be sent, and the
"timeStamp" attribute specifies the service's notion of the current
date and time. No reply is sent by the receiving endpoint.
When the service receives a "publish" element, we refer to the
"publisher" attribute of that element as the "subject", and the
service performs these steps:
1. If the "publisher" attribute of the "publish" element doesn't
match the "publisher" attribute of the "presence" element
contained in the "publish" element, a "reply" element having code
503 is sent to the originator.
2. If the subject is outside of this administrative domain, a "reply"
element having code 553 is sent to the originator.
3. If the subject does not refer to a valid endpoint, a "reply"
element having code 550 is sent to the originator.
4. If the subject's access entry does not contain a
"presence:publish" token for the originator, a "reply" element
having code 537 is sent to the originator.
5. If the "lastUpdate" attribute of the "publish" element is not
semantically identical to the "lastUpdate" attribute of the
subject's presence entry, a "reply" element having code 555 is
sent to the originator. (This allows a simple mechanism for
atomic updates.)
6. Otherwise:
1. The subject's presence entry is updated from the "publish"
element.
2. The "lastUpdate" attribute of the presence entry is set to the
service's notion of the current date and time.
Rose, et al. Experimental [Page 16]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
3. A "reply" element having code 250 is sent to the originator.
When sending the "reply" element, the "transID" attribute is
identical to the value found in the "publish" element sent by the
originator.
4.5 The Terminate Operation
When an application no longer wishes to subscribe to presence
information or to watch endpoints that are subscribed to receive
presence information, it sends a "terminate" element to the service;
similarly, when the service no longer considers an application to be
subscribing or watching, a "terminate" element is sent to the
application.
The "terminate" element contains only a "transID" attribute that
specifies the transaction-identifier associated an in-progress
subscribe or watch operation. Section 9.1 of [1] defines the syntax
for the "terminate" element.
When the service receives a "terminate" element, it performs these
steps:
1. If the transaction-identifier does not refer to a previous
subscribe or watch operation for the originator, an "error"
element having code 550 is returned.
2. Otherwise, the previous subscribe or watch operation for the
originator is terminated, and a "reply" element having code 250 is
sent to the originator.
Note that following a terminate operation, the originator may receive
further presence or watcher updates. Although the service will send
no further updates after processing a terminate operation and sending
the reply operation, earlier updates may be in transit.
4.6 The Notify Operation
The service sends a "notify" element to endpoints that are watching
other endpoints subscribed to presence information (c.f., Section
4.3).
The "notify" element has a "subscriber" attribute, a "transID"
attribute, a "duration" attribute, an "action" attribute, and no
content:
o the "subscriber" attribute specifies the endpoint that is
subscribed to presence information; and,
Rose, et al. Experimental [Page 17]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
o the "transID" attribute specifies the transaction-identifier
associated with the watch operation that caused this "notify"
element to be sent;
o the "action" attribute specifies whether a subscription or its
termination has occurred; and,
o if a subscription is being reported, the "duration" attribute
specifies the requested duration of the subscription.
No reply is sent by the receiving endpoint.
4.7 The Reply Operation
While processing operations, the service may respond with a "reply"
element. Consult Sections 10.2 and 6.1.2 of [1], respectively, for
the definition and an exposition of the syntax of the reply element.
5. Registration: The Presence Service
Well-Known Endpoint: apex=presence
Syntax of Messages Exchanged: c.f., Section 6
Sequence of Messages Exchanged: c.f., Section 4
Access Control Tokens: presence:subscribe, presence:watch,
presence:publish
Contact Information: c.f., the "Authors' Addresses" section of this
memo
6. The Presence Service DTD
<!--
DTD for the APEX presence service, as of 2001-05-08
Refer to this DTD as:
<!ENTITY % APEXPRESENCE PUBLIC "-//IETF//DTD APEX PRESENCE//EN"
"">
%APEXPRESENCE;
-->
<!ENTITY % APEXCORE PUBLIC "-//IETF//DTD APEX CORE//EN" "">
%APEXCORE;
Rose, et al. Experimental [Page 18]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
<!--
Synopsis of the APEX presence service
service WKE: apex=presence
message exchanges:
consumer initiates service replies
================== ================
subscribe publish or reply
terminate reply
watch reply
publish reply
service initiates consumer replies
================= ================
terminate (nothing)
publish (nothing)
notify (nothing)
access control:
token target
================== ======
presence:subscribe for "publisher" of "subscribe" element
presence:watch for "publisher" of "watch" element
presence:publish for "publisher" of "publish" element
-->
<!ELEMENT subscribe EMPTY>
<!ATTLIST subscribe
publisher %ENDPOINT; #REQUIRED
transID %UNIQID; #REQUIRED
duration %SECONDS; #REQUIRED>
<!ELEMENT watch EMPTY>
<!ATTLIST watch
publisher %ENDPOINT; #REQUIRED
transID %UNIQID; #REQUIRED
duration %SECONDS; #REQUIRED>
<!-- publisher attributes must match in publish and presence -->
<!ELEMENT publish (presence)>
<!ATTLIST publish
publisher %ENDPOINT; #REQUIRED
transID %UNIQID; #REQUIRED
timeStamp %TIMESTAMP; #REQUIRED>
Rose, et al. Experimental [Page 19]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
<!ELEMENT notify EMPTY>
<!ATTLIST notify
subscriber %ENDPOINT; #REQUIRED
transID %UNIQID; #REQUIRED
duration %SECONDS; "0"
action (subscribe|terminate)
"subscribe">
<!--
presence entries
-->
<!ELEMENT presence (tuple+)>
<!ATTLIST presence
publisher %ENDPOINT; #REQUIRED
lastUpdate %TIMESTAMP; #REQUIRED
publisherInfo
%URI; "">
<!ELEMENT tuple (capability*)>
<!ATTLIST tuple
destination %URI; #REQUIRED
availableUntil
%TIMESTAMP; #REQUIRED
tupleInfo %URI; "">
<!-- e.g., baseline='urn:ietf:rfc:rfc2533' -->
<!ELEMENT capability (#PCDATA)>
<!ATTLIST capability
baseline %URI #REQUIRED>
Rose, et al. Experimental [Page 20]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
7. Security Considerations
Consult [1]'s Section 11 for a discussion of security issues.
In addition, timestamps issued by the the presence service may
disclose location information. If this information is considered
sensitive, the special timezone value "-00:00" may be used (after
converting the local time accordingly).
References
[1] Rose, M., Klyne, G. and D. Crocker, "The Application Exchange
Core", RFC 3340, July 2002.
[2] Rose, M., "The Blocks Extensible Exchange Protocol Core", RFC
3080, March 2001.
[3] Rose, M., Klyne, G. and D. Crocker, "The Application Exchange
(APEX) Access Service", RFC 3341, July 2002.
Rose, et al. Experimental [Page 21]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
Acknowledgements
The authors gratefully acknowledge the contributions of: Neil Cook,
Eric Dixon, Darren New, Scott Pead, and Bob Wyman.
Authors' Addresses
Marshall T. Rose
Dover Beach Consulting, Inc.
POB 255268
Sacramento, CA 95865-5268
US
Phone: +1 916 483 8878
EMail: mrose@dbc.mtview.ca.us
Graham Klyne
Nine by Nine
EMail: gk@ninebynine.org
David H. Crocker
Brandenburg InternetWorking
675 Spruce Drive
Sunnyvale, CA 94086
US
Phone: +1 408 246 8253
EMail: dcrocker@brandenburg.com
URI: http://www.brandenburg.com/
Rose, et al. Experimental [Page 22]
^L
RFC 3343 The Application Exchange (APEX) Presence April 2003
Full Copyright Statement
Copyright (C) The Internet Society (2003). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Rose, et al. Experimental [Page 23]
^L
|