[Standards-JIG] JEP-0079 (AMP): conditions reversed?

Peter Saint-Andre stpeter at jabber.org
Tue May 31 20:50:31 UTC 2005


On Tue, May 31, 2005 at 12:57:16PM +0200, Ralph Meijer wrote:

>     Example 10. Sending a message for reliable data transport
> 
>     <message to='francisco at hamlet.lit/pda'
>              from='bernardo at hamlet.lit/elsinore'
>              id='ibb1'>
>       <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'>
>         qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ
>         WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu
>         IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P
>         AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH
>         kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA
>       </data>
>       <amp xmlns='http://jabber.org/protocol/amp' per-hop='true'>
>         <rule condition='expire-at' value='2004-09-10T08:33:14Z'
>     action='error'/>
>         <rule condition='match-resource' value='exact' action='error'/>
>       </amp>
>     </message>
>         
>     In the above case, the sender would receive an error reply if the
>     message could not be delivered specifically to
>     "francisco at hamlet.lit/pda" within 500 seconds.
> 
>     Example 11. Failed reliable data transport message
> 
>     <message from='hamlet.lit'
>              to='bernardo at hamlet.lit/elsinore'
>              id='ibb1'>
>       <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'>
>         qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ
>         WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu
>         IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P
>         AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH
>         kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA
>       </data>
>       <amp xmlns='http://jabber.org/protocol/amp'
>           from='bernardo at hamlet.lit/elsinore'
>           to='francisco at hamlet.lit/pda'>
>         <rule condition='match-resource' value='exact' action='error'/>
>       </amp>
>       <error type='modify' code='500'>
>         <undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
>         <failed-rules xmlns='http://jabber.org/protocol/amp#errors'>
>           <rule condition='match-resource' value='exact' action='error'/>
>         </failed-rules>
>       </error>
>     </message>
> 
> As I see it, the condition match-resource, using the value 'exact',
> would only match if the resource *did* match. So, if it could be
> delivered, the message would get dropped?

We probably need more narrative text to explain these examples.

In Example 10, the sender specified two rules:

  1. Deliver the message by 2004-09-10T08:33:14Z, but if you can't then
     send me an error report:

     <rule condition='expire-at' 
           value='2004-09-10T08:33:14Z'
           action='error'/>

  2. Deliver the message only to <francisco at hamlet.lit/pda>, but if you
     can't then send me an error report:

     <rule condition='match-resource' 
           value='exact' 
           action='error'/>

Example 11 is intended to illustrate what would happen if rule 2 were
matched (e.g., the "pda" resource went offline) -- the server would send
a message error to the sender.

I see what you mean about this seeming to be counter-intuitive -- you'd
prefer the rule to be "send me an error if the resource is other" rather
than "deliver to that exact resource, otherwise send me an error". But
the two work out to be the same thing, no?

> Also, what happens in the case when the default action is offline
> storage? Does the resource still match?

Let's say that the sender in Example 10 wanted the message to be
delivered only to that exact resource, otherwise the message is to be
dropped. The rule would specify a condition of "deliver", a value of
"direct", and an action of "drop":

     <rule condition='deliver' 
           value='direct' 
           action='drop'/>

Which means: deliver the message directly to the 'to' address, otherwise
drop it. It doesn't mean "if you can deliver the message directly to
that address, then drop the message" -- that wouldn't make any sense.
;-)

> I think only the expire-at condition is correctly defined, and that the
> others should be reversed in their meaning.

I think these are two ways of looking at the same thing. But I might be 
wrong. Perhaps the primary author could shed some light on the matter...

/psa




More information about the Standards mailing list