📄 rfc 3343 the application exchange (apex) presence service.htm
字号:
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
</PRE>
<P>or this:
<P><PRE> 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
</PRE>
<P></P>
<DT>
<HR>
<EM><A name=page-13>Page 13</A></EM>
<DD>
<P></P>
<DT><STRONG><A name=sec-4.2>4.2</A> The Subscribe Operation</STRONG>
<DD>
<P>When an application wants to (periodically) receive the presence
information associated with an endpoint, it sends a "subscribe" element to the
service.
<P>The "subscribe" element has a "publisher" attribute, a "duration"
attribute, a "transID" attribute, and no content:
<P>
<UL>
<LI>the "publisher" attribute specifies the endpoint associated with the
presence entry;
<P></P>
<LI>the "transID" attribute specifies the transaction-identifier associated
with this operation; and,
<P></P>
<LI>the "duration" attribute specifies the maximum number of seconds for
which the originator is interested in receiving updated presence
information. </LI></UL>
<P>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:
<P></P>
<DT><STRONG><A name=sec-1>1</A> If the subject is outside of this
administrative domain, a "reply"</STRONG>
<DD>element having code 553 is sent to the originator.
<P></P>
<DT><STRONG><A name=sec-2>2</A> If the subject does not refer to a valid
endpoint, a "reply"</STRONG>
<DD>element having code 550 is sent to the originator.
<P></P>
<DT><STRONG><A name=sec-3>3</A> If the subject's access entry does not contain
a</STRONG>
<DD>"presence:subscribe" token for the originator, a "reply" element having
code 537 is sent to the originator.
<P></P>
<DT><STRONG><A name=sec-4>4</A> If the originator already has an in-progress
subscribe operation</STRONG>
<DD>for the subject, then the previous subscribe operation is silently
terminated, and processing continues.
<P></P>
<DT><STRONG><A name=sec-5>5</A> If the "transID" attribute refers to an
in-progress subscribe or</STRONG>
<DD>watch operation for the originator, a "reply" element having code 555 is
sent to the originator.
<P></P>
<DT><STRONG><A name=sec-6>6</A> Otherwise:</STRONG>
<DD>
<P></P>
<DT><STRONG><A name=sec-1>1</A> A "publish" element, corresponding to the
subject's presence</STRONG>
<DD>entry, is immediately sent to the originator.
<P></P>
<DT>
<HR>
<EM><A name=page-14>Page 14</A></EM>
<DD>
<P></P>
<DT><STRONG><A name=sec-2>2</A> For each endpoint currently watching
subscribers to the</STRONG>
<DD>subject's presence information, a "notify" element is immediately as sent
(c.f., Step 6.3 of <A
href="http://www.apps.ietf.org/rfc/rfc3343.html#sec-4.6">Section 4.6</A>).
<P></P>
<DT><STRONG><A name=sec-3>3</A> For up to the amount of time indicated by the
"duration"</STRONG>
<DD>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 (<A
href="http://www.apps.ietf.org/rfc/rfc3343.html#sec-4.4">Section 4.4</A>).
Finally, when the amount of time indicated by the "duration" attribute
expires, a terminate operation (<A
href="http://www.apps.ietf.org/rfc/rfc3343.html#sec-4.5">Section 4.5</A>) is
sent to the originator.
<P>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.
<P>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.
<P></P>
<DT><STRONG><A name=sec-4.3>4.3</A> The Watch Operation</STRONG>
<DD>
<P>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.
<P>The "watch" element has a "publisher" attribute, a "duration" attribute, a
"transID" attribute, and no content:
<P>
<UL>
<LI>the "publisher" attribute specifies the endpoint associated with the
presence entry;
<P></P>
<LI>the "transID" attribute specifies the transaction-identifier associated
with this operation; and,
<P></P>
<LI>the "duration" attribute specifies the maximum number of seconds for
which the originator is interested in watching subscribers. </LI></UL>
<P>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:
<P></P>
<DT><STRONG><A name=sec-1>1</A> If the subject is outside of this
administrative domain, a "reply"</STRONG>
<DD>element having code 553 is sent to the originator.
<P></P>
<DT><STRONG><A name=sec-2>2</A> If the subject does not refer to a valid
endpoint, a "reply"</STRONG>
<DD>element having code 550 is sent to the originator.
<P></P>
<DT>
<HR>
<EM><A name=page-15>Page 15</A></EM>
<DD>
<P></P>
<DT><STRONG><A name=sec-3>3</A> If the subject's access entry does not contain
a "presence:watch"</STRONG>
<DD>token for the originator, a "reply" element having code 537 is sent to the
originator.
<P></P>
<DT><STRONG><A name=sec-4>4</A> If the originator already has an in-progress
watch operation for</STRONG>
<DD>the subject, then the previous watch operation is silently terminated, and
processing continues.
<P></P>
<DT><STRONG><A name=sec-5>5</A> If the "transID" attribute refers to an
in-progress subscribe or</STRONG>
<DD>watch operation for the originator, a "reply" element having code 555 is
sent to the originator.
<P></P>
<DT><STRONG><A name=sec-6>6</A> Otherwise:</STRONG>
<DD>
<P></P>
<DT><STRONG><A name=sec-1>1</A> A "reply" element having code 250 is sent to
the originator.</STRONG>
<DD>
<P></P>
<DT><STRONG><A name=sec-2>2</A> For each endpoint currently subscribing to the
subject's</STRONG>
<DD>presence information, a "notify" element is immediately sent to the
originator (c.f., <A
href="http://www.apps.ietf.org/rfc/rfc3343.html#sec-4.6">Section 4.6</A>).
<P></P>
<DT><STRONG><A name=sec-3>3</A> For up to the amount of time indicated by the
"duration"</STRONG>
<DD>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 (<A
href="http://www.apps.ietf.org/rfc/rfc3343.html#sec-4.5">Section 4.5</A>) is
sent to the originator.
<P>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.
<P>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.
<P></P>
<DT><STRONG><A name=sec-4.4>4.4</A> The Publish Operation</STRONG>
<DD>
<P>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., <A
href="http://www.apps.ietf.org/rfc/rfc3343.html#sec-4.2">Section 4.2</A>).
<P>The "publish" element has a "publisher" attribute, a "transID" attribute, a
"timeStamp" attribute, and contains a "presence" element:
<P>
<UL>
<LI>the "publisher" attribute specifies the endpoint to be associated with
the presence entry; </LI></UL>
<P></P>
<DT>
<HR>
<EM><A name=page-16>Page 16</A></EM>
<DD>
<P>
<UL>
<LI>the "transID" attribute specifies the transaction-identifier associated
with this operation;
<P></P>
<LI>the "timeStamp" attribute specifies the application's notion of the
current date and time; and,
<P></P>
<LI>the "presence" element contains the desired presence entry for the
endpoint. </LI></UL>
<P>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.
<P>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:
<P></P>
<DT><STRONG><A name=sec-1>1</A> If the "publisher" attribute of the "publish"
element doesn't</STRONG>
<DD>match the "publisher" attribute of the "presence" element contained in the
"publish" element, a "reply" element having code 503 is sent to the
originator.
<P></P>
<DT><STRONG><A name=sec-2>2</A> If the subject is outside of this
administrative domain, a "reply"</STRONG>
<DD>element having code 553 is sent to the originator.
<P></P>
<DT><STRONG><A name=sec-3>3</A> If the subject does not refer to a valid
endpoint, a "reply"</STRONG>
<DD>element having code 550 is sent to the originator.
<P></P>
<DT><STRONG><A name=sec-4>4</A> If the subject's access entry does not contain
a</STRONG>
<DD>"presence:publish" token for the originator, a "reply" element having code
537 is sent to the originator.
<P></P>
<DT><STRONG><A name=sec-5>5</A> If the "lastUpdate" attribute of the "publish"
element is not</STRONG>
<DD>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.)
<P></P>
<DT><STRONG><A name=sec-6>6</A> Otherwise:</STRONG>
<DD>
<P></P>
<DT><STRONG><A name=sec-1>1</A> The subject's presence entry is updated from
the "publish"</STRONG>
<DD>element.
<P></P>
<DT><STRONG><A name=sec-2>2</A> The "lastUpdate" attribute of the presence
entry is set to the</STRONG>
<DD>service's notion of the current date and time.
<P></P>
<DT>
<HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -