discovery-api/Overview.src.html
author Rich Tibbett <richt@opera.com>
Tue, 02 Oct 2012 14:51:33 +0200
changeset 238 65e14f8dc95d
parent 232 32487cf058c5
child 239 7e34654692fc
permissions -rw-r--r--
Editorial changes to Service Discovery spec
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     1
<!DOCTYPE html>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     2
<html>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     3
  <head>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     4
    <title>Networked Service Discovery and Messaging</title>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     5
    <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     6
    <script type="text/javascript" class='remove'>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     7
      var respecConfig = {
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
     8
          specStatus:   "ED",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
     9
          //publishDate:  "2012-08-22",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    10
          shortName:    "discovery-api",
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
    11
          edDraftURI:   "http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html",
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    12
          previousMaturity: "WD",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    13
          previousPublishDate: "2012-08-07",
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    14
          editors: [
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    15
            {
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    16
              name:       "Rich Tibbett",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    17
              //url:        "http://richt.me/",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    18
              company:    "Opera Software ASA",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    19
              companyURL: "http://opera.com/"
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    20
            },
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    21
            {
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    22
              name:       "Clarke Stevens",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    23
              //url:      "",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    24
              company:    "CableLabs",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    25
              companyURL: "http://cablelabs.com/"
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    26
            }
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    27
          ],
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    28
          noIDLIn:      true,
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    29
          wg:           "Device APIs and Policy Working Group",
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    30
          wgURI:        "http://www.w3.org/2009/dap/",
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    31
          wgPublicList: "public-device-apis",
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    32
          wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/43696/status"
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    33
      };
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    34
    </script>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    35
182
Robin Berjon <robin@berjon.com>
parents: 181
diff changeset
    36
    <script src='http://www.w3.org/Tools/respec/respec-w3c-common' type="text/javascript" class='remove' async></script>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    37
    <style type="text/css">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    38
      /* Custom CSS optimizations (Richard Tibbett) */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    39
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    40
      /* Add better spacing to sections */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    41
      section, .section { margin-bottom: 2em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    42
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    43
      /* Reduce note & issue render size */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    44
      .note, .issue { font-size:0.8em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    45
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    46
      /* Add addition spacing to <ol> and <ul> for rule definition */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    47
      ol.rule li, ul.rule li { padding:0.6em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    48
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    49
      pre.widl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; position: relative; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    50
      pre.widl :link, pre.widl :visited { color: #000; background: transparent; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    51
      pre.widl:before { content: "IDL"; font: bold small sans-serif; padding: 0.5em; background: white; position: absolute; top: 0; margin: -1px 0 0 -4em; width: 1.5em; border: thin solid; border-radius: 0 0 0 0.5em }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    52
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    53
      div.example { border: solid thin red; background: #F7DFE5; color: black; padding: 0.5em 1em; position: relative; margin: 1em 0 1em 4.6em; width: auto; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    54
      div.example:before { content: "EXAMPLE"; font: bold small sans-serif; padding: 0.5em; background: red; color: white; position: absolute; top: 0; margin: -1px 0 0 -7.6em; width: 5em; border: thin solid red; border-radius: 0 0 0 0.5em }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    55
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    56
      dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    57
      hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    58
      dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    59
      dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    60
      dl.domintro dd p { margin: 0.5em 0; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    61
      dl.domintro code {font-size: inherit; font-style: italic; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    62
      dl.domintro:before { display: table; margin: -1em -0.5em 0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: red; border: solid 2px; background: white; padding: 0 0.25em; }
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    63
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    64
      table { border-collapse:collapse; border-style:hidden hidden none hidden }
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    65
      table thead { border-bottom:solid }
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    66
      table tbody th:first-child { border-left:solid }
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    67
      table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    68
    </style>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    69
  </head>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    70
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    71
  <body>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    72
    <section id='abstract'>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    73
      <p>
185
ef42cb5f9a60 validity errors
Robin Berjon <robin@berjon.com>
parents: 183
diff changeset
    74
        This specification defines a mechanism for an HTML document to discover and subsequently communicate with <abbr title="Hypertext Transfer Protocol">HTTP</abbr>-based services
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    75
        advertised via common discovery protocols within a user's network.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    76
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    77
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    78
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    79
    <section id='sotd'>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    80
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    81
        This document represents the early consensus of the group on the scope and features of the proposed
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    82
        API.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    83
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    84
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    85
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    86
    <section class="informative">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    87
      <h3>Introduction</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    88
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    89
      <p>To enable Web pages to connect and communicate with Local-networked Services provided over HTTP, this specification introduces the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    90
      <a href="#navigatornetworkservice"><code>NavigatorNetworkService</code></a> interface.</p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    91
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    92
      <p>
185
ef42cb5f9a60 validity errors
Robin Berjon <robin@berjon.com>
parents: 183
diff changeset
    93
         Using this <abbr title="Application Programming Interface">API</abbr> consists of requesting a well-known service type, known by developers and advertised by Local-networked Devices. User authorization, where the user connects the web page to one or more discovered services,
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    94
         is expected before the web page is able to interact with any Local-networked Services.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    95
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    96
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    97
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    98
         A web page creates a request to obtain connectivity to services running in the network by specifying a well-known discovery service type that it wishes to interact with.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    99
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   100
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   101
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   102
         The user agent, having captured all advertised services on the network from the Service Discovery mechanisms included in this recommendation, attempts to match
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   103
      the requested service type to a discovered service according to the processing described herein.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   104
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   105
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   106
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   107
          If a service connectivity request is successful then the Web page is provided with the necessary information to communicate with the authorized Local-networked Service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   108
          If the request fails then the Web page will receive an error callback containing an error code describing the cause of Local-networked Service connectivity failure.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   109
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   110
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   111
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   112
         Once connected to a Local-networked Service the Web page can send requests and receive responses to the Local-networked Service via the messaging format and appropriate channel inferred from the service type
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   113
         authorized via the provided API.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   114
         The Web page, once connected, can also receive service-pushed events, in the messaging format supported by the Local-networked Device, if such event subscription functionality is provided by the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   115
         connected Local-networked Service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   116
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   117
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   118
      <div class="example">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   119
       <p>Example of requesting a DNS-SD advertised service:</p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   120
       <hr />
185
ef42cb5f9a60 validity errors
Robin Berjon <robin@berjon.com>
parents: 183
diff changeset
   121
       <pre class="highlight">function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   122
  // Show a list of all the services provided to the web page
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   123
  for(var i = 0, l = services.length; i < l; i++) console.log( services[i].name );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   124
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   125
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   126
navigator.getNetworkServices('zeroconf:_boxee-jsonrpc._tcp', showServices);</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   127
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   128
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   129
      <div class="example">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   130
        <p>Example of requesting a UPnP advertised service, also handling error conditions:</p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   131
        <hr />
185
ef42cb5f9a60 validity errors
Robin Berjon <robin@berjon.com>
parents: 183
diff changeset
   132
        <pre class="highlight">function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   133
  // Show a list of all the services provided to the web page
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   134
  for(var i = 0, l = services.length; i < l; i++) console.log( services[i].name );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   135
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   136
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   137
function error( e ) {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   138
  console.log( "Error occurred: " + e.code );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   139
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   140
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   141
navigator.getNetworkServices('upnp:urn:schemas-upnp-org:service:ContentDirectory:1', showServices, error);</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   142
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   143
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   144
      <div class="example">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   145
        <p>Example of requesting either a DNS-SD or UPnP advertised service:</p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   146
        <hr />
185
ef42cb5f9a60 validity errors
Robin Berjon <robin@berjon.com>
parents: 183
diff changeset
   147
        <pre class="highlight">function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   148
  // Show a list of all the services provided to the web page (+ service type)
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   149
  for(var i = 0, l = services.length; i < l; i++)
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   150
     console.log( services[i].name + '(' + services[i].type + ')' );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   151
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   152
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   153
navigator.getNetworkServices([
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   154
  'zeroconf:_boxee-jsonrpc._tcp',
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   155
  'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   156
], showServices);</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   157
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   158
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   159
      <p>For more detailed examples see the <a href="#examples">Examples</a> section.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   160
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   161
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   162
    <section
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   163
     id='conformance'>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   164
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   165
     <p>Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   166
     meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.</p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   167
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   168
     <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   169
      Some conformance requirements are phrased as requirements on attributes, methods or objects. Such requirements are to be interpreted as requirements on user agents.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   170
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   171
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   172
     <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   173
      Conformance requirements phrased as algorithms or specific steps <em class="ct">MAY</em> be implemented in any manner, so long as the end result is equivalent. (In particular, the algorithms defined in
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   174
      this specification are intended to be easy to follow, and not intended to be performant.)
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   175
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   176
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   177
     <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   178
      The only conformance class defined by this specification is a <dfn>user agent</dfn>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   179
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   181
     <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   182
      User agents <em class="ct">MAY</em> impose implementation-specific limits on otherwise unconstrained inputs, e.g. to prevent denial of service attacks, to guard against running out of memory, or to work
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   183
      around platform-specific limitations.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   184
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   185
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   186
     <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   187
      When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid in development, or for performance reasons), user agents <em class="ct">MUST</em> act as if
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   188
      they had no support for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a particular feature is accessed via an attribute in a Web
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   189
      IDL interface, the attribute itself would be omitted from the objects that implement that interface - leaving the attribute on the object but making it return null or throw an exception
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   190
      is insufficient.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   191
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   192
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   193
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   194
         <h3>Dependencies</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   195
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   196
         This specification relies on several other underlying specifications.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   197
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   198
         <dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   199
            <dt>HTML</dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   200
            <dd>Many fundamental concepts from HTML are used by this specification. [[!HTML5]]</dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   201
            <dt>WebIDL</dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   202
            <dd>The IDL blocks in this specification use the semantics of the WebIDL specification. [[!WEBIDL]]</dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   203
         </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   204
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   205
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   206
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   207
    <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   208
      <h3>Terminology</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   209
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   210
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   211
         The construction "a <code>Foo</code> object", where <code>Foo</code> is actually an interface, is sometimes used instead of the more accurate "an object implementing the interface <code>Foo</code>".
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   212
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   213
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   214
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   215
         The term DOM is used to refer to the API set made available to scripts in Web applications, and does not necessarily imply the existence of an actual <code>Document</code> object or of any
182
Robin Berjon <robin@berjon.com>
parents: 181
diff changeset
   216
         other <code>Node</code> objects as defined in the DOM Core specifications. [[!DOM4]]
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   217
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   218
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   219
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   220
         An IDL attribute is said to be <em>getting</em> when its value is being retrieved (e.g. by author script), and is said to be <em>setting</em> when a new value is assigned to it.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   221
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   222
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   223
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   224
        A <dfn>valid service type</dfn> is a string that begins with <code>upnp:</code> or <code>zeroconf:</code> followed by one or more characters in the ranges U+0021, U+0023 to U+0027, U+002A to U+002B, U+002D to U+002E, U+0030 to U+0039, U+0041 to U+005A, U+005E to U+007E.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   225
      </p>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   226
      <p></p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   227
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   228
      <p>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   229
        A <a>valid service type</a> provided in the <code>type</code> attribute of the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method will be matched against the services currently contained in the <a>list of available service records</a> according to the algorithms defined in this specification.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   230
      </p>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   231
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   232
      <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   233
        A <dfn>user-agent generated callback url</dfn> is a Local-network accessible URL endpoint that a <a>user agent</a> generates and maintains for receiving HTTP NOTIFY requests from UPnP Event sources. It is only required when the user agent implements UPnP Service Discovery as defined in
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   234
        this specification.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   235
      </p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   236
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   237
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   238
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   239
    <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   240
     <h2>Requesting networked services</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   241
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   242
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   243
<pre class="widl">[Supplemental, NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   244
interface <dfn id="navigatornetworkservice">NavigatorNetworkService</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   245
  // Obtain a Local-networked Service
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   246
  void <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>( in any type,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   247
                           in <a href="#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   248
                           in optional <a href="#navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</a> errorCallback );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   249
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   250
<a class="externalDFN" href="http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href="#navigatornetworkservice">NavigatorNetworkService</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   251
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   252
[Callback=FunctionOnly, NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   253
interface <dfn id="navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   254
  void handleEvent( in <a href="#networkservices">NetworkServices</a> services );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   255
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   256
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   257
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   258
interface <dfn id="navigatornetworkserviceerror">NavigatorNetworkServiceError</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   259
  const unsigned short <a href="#dom-navigatornetworkserviceerror-permission_denied">PERMISSION_DENIED_ERR</a> = 1;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   260
  const unsigned short <a href="#dom-navigatornetworkserviceerror-unknown_type_prefix">UNKNOWN_TYPE_PREFIX_ERR</a> = 2;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   261
  readonly attribute unsigned short <a href="#dom-navigatornetworkserviceerror-code">code</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   262
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   263
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   264
[Callback=FunctionOnly, NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   265
interface <dfn id="navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   266
  void handleEvent( in <a href="#navigatornetworkserviceerror">NavigatorNetworkServiceError</a> error );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   267
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   268
</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   269
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   270
  <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   271
   <h2>Methods</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   272
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   273
      <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   274
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   275
          <var title="">window</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   276
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   277
          <code title="dom-navigator">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   278
            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">navigator</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   279
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   280
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   281
          <code title="dom-navigator-getNetworkServices">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   282
            <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   283
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   284
          (
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   285
          <var title="">type</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   286
          ,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   287
          <var title="">successCallback</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   288
           [,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   289
          <var title="">errorCallback</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   290
           ] )
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   291
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   292
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   293
          <p>Prompts the user to select one or more discovered network services that have advertised support for the requested service type.</p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   294
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   295
            The
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   296
            <var title="">type</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   297
             argument contains one or more <a>valid service type</a> tokens that the web page would like to interact with.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   298
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   299
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   300
            If the user accepts, the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   301
            <var title="">successCallback</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   302
             is
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   303
          invoked, with one or more
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   304
            <code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   305
              <a href="#networkservice"><code>NetworkService</code></a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   306
            </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   307
             objects as
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   308
          its argument.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   309
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   310
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   311
            If the user declines, the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   312
            <var title="">errorCallback</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   313
             (if
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   314
          any) is invoked.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   315
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   316
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   317
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   318
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   319
       <div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   320
          <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   321
            When the <dfn id="dom-navigator-getnetworkservices" title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[, errorCallback])</code></dfn> method is called, the <a>user agent</a> <em class="ct">MUST</em> run the following steps:
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   322
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   323
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   324
          <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   325
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   326
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   327
              Let <var>requested control types</var> be initially set to an empty array.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   328
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   329
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   330
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   331
               If <var>type</var> is an array consisting of one or more <a>valid service type</a> tokens, then let <var>requested control types</var> by the value of <var>type</var>, removing any non-<a>valid service type</a> tokens from the resulting array.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   332
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   333
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   334
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   335
               If <var>type</var> is a string consisting of one <a>valid service type</a> token, then let <var>requested control types</var> be an array containing one item with a value of <var>type</var>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   336
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   337
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   338
            <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   339
               If <var>requested control types</var> is an array that contains at least one or more <a title="valid service type">valid service type</a> tokens then continue to the step labeled <em>process</em> below. Otherwise, the <a>user agent</a> <em class="ct">MUST</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   340
                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   341
                  (<a href="#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as its argument,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   342
                   abort any remaining steps and return.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   343
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   344
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   345
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   346
               <em>Process</em>: Let <var>services found</var> be an empty array.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   347
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   348
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   349
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   350
               For each <var>available service</var> in the <a>list of available service records</a> run the following steps:
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   351
               <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   352
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   353
                    For each <var>requested control type</var> in <var>requested control types</var>: If <var>available service</var>'s <code>type</code> attribute equals the <var>requested control type</var> then let <var>matched service</var> equal the value of <var>available service</var> and continue at the step labeled <var>attach</var> below.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   354
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   355
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   356
                     Continue at the next <var>available service</var>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   357
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   358
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   359
                     <em>Attach</em>: If <var>matched service</var> is not empty then run the following steps:
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   360
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   361
                     <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   362
                        <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   363
                           Let <var>new service object</var> be a new <a href="#networkservice"><code>NetworkService</code></a> object, mapping the parameters of
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   364
                     <var>matched service</var> to this new object where possible.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   365
                        </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   366
                        <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   367
                           Append <var>new service object</var> to the <var>services found</var> array.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   368
                        </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   369
                     </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   370
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   371
               </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   372
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   373
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   374
            <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   375
               If <var>services found</var> is an empty array, then the <a>user agent</a> <em class="ct">MUST</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   376
                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   377
                 (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   378
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   379
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   380
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   381
               Return, and run the remaining steps asynchronously.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   382
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   383
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   384
            <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   385
               Optionally, e.g. based on a previously-established user preference, for security reasons, or due to platform limitations, the <a>user agent</a> <em class="ct">MAY</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   386
                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   387
                 (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   388
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   389
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   390
            <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   391
                  The <a>user agent</a> <em class="ct">MUST</em> prompt the user in a user-agent-specific manner for permission to provide the
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   392
                  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   393
                  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin" class="externalDFN">origin</a> with an array of
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   394
                  <a href="#networkservice"><code>NetworkService</code></a> objects representing the user-authorized subset of <var>services found</var>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   395
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   396
               <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   397
                  If the user grants permission to access one or more networked services then the <a>user agent</a> SHOULD include an
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   398
                  "ongoing local-network communication" indicator.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   399
               </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   400
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   401
               <p>If the user denies permission, then the <a>user agent</a> <em class="ct">MUST</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   402
                <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   403
                (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   404
              </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   405
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   406
              <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   407
                If the user never responds, this algorithm stalls on this step.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   408
              </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   409
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   410
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   411
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   412
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   413
               Let <var>services</var> be the array of one or more <a href="#networkservice"><code>NetworkService</code></a> objects for which the user granted permission.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   414
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   415
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   416
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   417
               For each Object <var>service</var> in <var>services</var>, run the following substeps:
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   418
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   419
               <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   420
                  <li>
185
ef42cb5f9a60 validity errors
Robin Berjon <robin@berjon.com>
parents: 183
diff changeset
   421
                     Add the <var>service</var>'s <code>url</code> parameter to the <a>entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   422
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   423
                  <li>
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   424
                    If <var>service</var>'s <code>type</code> parameter begins with the DOMString &quot;<code>upnp:</code>&quot; and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a>setup a UPnP Events Subscription</a> for <var>service</var>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   425
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   426
               </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   427
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   428
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   429
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   430
               Let <var>services manager</var> be a new <a href="#networkservices"><code>NetworkServices</code></a> object.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   431
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   432
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   433
            <li>
231
a0e6b501258d Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0095.html
Rich Tibbett <richt@opera.com>
parents: 230
diff changeset
   434
               Set <var>services manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of services currently found in the <a>list of available service records</a> whose <code>type</code> property matches any of the tokens requested in <var>requested control types</var>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   435
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   436
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   437
            <li>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   438
              Add the set of <var>services</var> to the <a>list of authorized service records</a> internally against the newly created <var>services manager</var> object.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   439
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   440
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   441
            <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   442
               The <a>user agent</a> <em class="ct">MUST</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>successCallback</var> with
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   443
               <var>services manager</var> as its argument.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   444
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   445
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   446
          </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   447
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   448
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   449
            The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#task-source" class="externalDFN">task source</a> for these
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   450
            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#concept-task" class="externalDFN">tasks</a> is the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   451
            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#user-interaction-task-source" class="externalDFN">user interaction task source</a>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   452
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   453
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   454
          <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   455
            When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the <a>user agent</a> <em class="ct">MUST</em> add the <code>url</code> property
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   456
             to the <dfn>entry script origin's URL whitelist</dfn>. This list enables the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   457
            Web page to override and initiate cross-site resource requests towards these URLs, and any sub-resources of these URLs, within the current
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   458
            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   459
            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin" class="externalDFN">origin</a> via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   460
            Web Messaging, XMLHttpRequest).
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   461
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   462
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   463
         <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   464
            If the user navigates away from the current browsing context, the <a>user agent</a> <em class="ct">MUST</em> remove all previously whitelisted urls from the <a>entry script origin's URL whitelist</a>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   465
            There is no persistence to network service selections provided to a web page. It is not possible to access a previously white-listed networked service without the necessary user authorization in all of the following cases:
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   466
            <ul>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   467
              <li>If the current script is reloaded at any point in the same or different window.</li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   468
              <li>if the current script reinvokes the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method at any point in its execution.</li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   469
              <li>If the user navigates forward or back in their history to reload the current page.</li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   470
              <li>If a script is running in a different origin.</li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   471
            </ul>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   472
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   473
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   474
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   475
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   476
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   477
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   478
         <h3>Error Handling</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   479
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   480
      <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   481
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   482
          <var title="">error</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   483
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   484
          <code title="dom-NavigatorNetworkServiceError-code">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   485
            <a href="#dom-navigatornetworkserviceerror-code">code</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   486
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   487
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   488
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   489
          <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   490
            Returns the current error's error code. At the current time, this will be <code>1</code> or <code>2</code>, for which the
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   491
            corresponding error constants
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   492
            <a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   493
            <a href="#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are defined.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   494
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   495
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   496
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   497
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   498
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   499
            The <dfn id="dom-navigatornetworkserviceerror-code" title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   500
            <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class="ct">MUST</em> return the code for the error, which will be one of the following:
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   501
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   502
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   503
         <dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   504
            <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   505
               <dfn id="dom-navigatornetworkserviceerror-permission_denied" title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn> (numeric value 1)
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   506
            </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   507
            <dd>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 192
diff changeset
   508
               The user or user agent denied the page permission to access any services.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   509
            </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   510
            <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   511
               <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix" title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn> (numeric value 2)
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   512
            </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   513
            <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   514
               No <a>valid service type</a> tokens were provided in the method invocation.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   515
            </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   516
         </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   517
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   518
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   519
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   520
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   521
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   522
      <h2>Obtaining networked services</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   523
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   524
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   525
         The <a href="#networkservices"><code>NetworkServices</code></a> interface is the top-level response object from a call to <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> and provides access to a set of user-authorized <a href="#networkservice"><code>NetworkService</code></a> objects for the given request.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   526
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   527
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   528
<pre class="widl">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   529
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   530
interface <dfn id="networkservices">NetworkServices</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   531
  readonly attribute unsigned long    <a href="#dom-networkservices-length">length</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   532
  getter <a href="#networkservice">NetworkService</a> (unsigned long index);
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   533
  <a href="#networkservice">NetworkService</a>? <a href="#dom-networkservices-getservicebyid">getServiceById</a>(DOMString id);
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   534
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   535
  readonly attribute unsigned long    <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   536
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   537
  // event handler attributes
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   538
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceavailable">onserviceavailable</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   539
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceunavailable">onserviceunavailable</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   540
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   541
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   542
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   543
<a href="#networkservices">NetworkServices</a> implements <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget" class="externalDFN">EventTarget</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   544
</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   545
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   546
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   547
      <h2>Attributes</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   548
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   549
        <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   550
          <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   551
            <code title="dom-networkservices-length">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   552
              <a href="#dom-networkservices-length">length</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   553
            </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   554
          </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   555
          <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   556
            <p>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   557
              Returns the current number of services belonging in the respective object's <a>list of authorized service records</a>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   558
            </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   559
          </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   560
          <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   561
            <code title="dom-networkservices-servicesavailable">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   562
              <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   563
            </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   564
          </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   565
          <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   566
            <p>
231
a0e6b501258d Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0095.html
Rich Tibbett <richt@opera.com>
parents: 230
diff changeset
   567
              Returns the current number of services matching one of the app-requested <a>valid service type</a> tokens in the
a0e6b501258d Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0095.html
Rich Tibbett <richt@opera.com>
parents: 230
diff changeset
   568
              <a>list of available service records</a>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   569
            </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   570
          </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   571
        </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   572
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   573
        <div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   574
           <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   575
              The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute <em class="ct">MUST</em> return the number of services represented in the object's corresponding <a>list of authorized service records</a> at the time of getting.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   576
           </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   577
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   578
           <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   579
              The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute <em class="ct">MUST</em> return the number of services in the <a>list of available service records</a> whose <code>type</code> attribute matches any of the <a>valid service type</a> tokens that was initially used to create the current <a href="#networkservices"><code>NetworkServices</code></a> object.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   580
           </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   581
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   582
        </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   583
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   584
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   585
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   586
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   587
      <h2>Methods</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   588
        <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   589
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   590
          <code title="networkservices-getter">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   591
            <a href="#networkservices">services</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   592
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   593
          [
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   594
          <var title="">index</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   595
          ]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   596
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   597
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   598
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   599
            Returns the specified <a href="#networkservice"><code>NetworkService</code></a> object.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   600
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   601
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   602
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   603
          <code title="networkservices-getter">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   604
            <a href="#networkservices">services</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   605
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   606
          .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   607
          <code title="dom-networkservices-getservicebyid">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   608
            <a href="#dom-networkservices-getservicebyid">getServiceById</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   609
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   610
          (
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   611
          <var title="">id</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   612
          )
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   613
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   614
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   615
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   616
            Returns the <a href="#networkservice"><code>NetworkService</code></a> object with the given identifier, or null if no
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   617
            service has that identifier.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   618
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   619
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   620
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   621
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   622
      <p>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   623
        A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of one or more current authorized services - the <a>list of authorized service records</a>. Each item in the <a>list of authorized service records</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a> object. The <a>list of authorized service records</a> is <span>immutable</span> meaning that it cannot be modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a> object.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   624
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   625
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   626
      <p class="note">
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   627
        Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the first has the index 0, and each subsequent service is numbered one higher than the previous one.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   628
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   629
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   630
      <p>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   631
        The <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices" class="externalDFN">supported property indices</a> of <a href="#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to the number of items in the <a>list of authorized service records</a> represented by the respective object minus one, if any services are represented in the <a>list of authorized service records</a>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   632
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   633
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   634
      <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   635
        To <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property" class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a <a href="#networkservices"><code>NetworkServices</code></a> object's <a>list of authorized service records</a>, the user agent <em class="ct">MUST</em> return the <a href="#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th service in the <a>list of authorized service records</a>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   636
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   637
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   638
      <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   639
        The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class="ct">MUST</em> return the first <a href="#networkservice"><code>NetworkService</code></a> object in the <a>list of authorized service records</a> represented by the respective object whose <a href="#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the <var>id</var> argument.
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   640
        When no services in the <a>list of authorized service records</a> match the given argument, the method <em class="ct">MUST</em> return null.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   641
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   642
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   643
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   644
         Services available within the local network can connect and disconnect at different times during the execution of a web page. A <a>user agent</a> can
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   645
         inform a web page when the state of networked services matching the requested <a>valid service type</a> change. Web pages can use this information to enable in-page experiences for communicating the state of networked services
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   646
         with the ability to change the particular service or set of services the page is connected to by re-invoking the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   647
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   648
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   649
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   650
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   651
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   652
      <h2>Events</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   653
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   654
      <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   655
         The following are the event handlers (and their corresponding event handler event types) that <em class="ct">MUST</em> be supported, as IDL attributes, by all objects implementing the <a href="#networkservices"><code>NetworkServices</code></a> interface:
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   656
       </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   657
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   658
       <table border="1">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   659
        <thead>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   660
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   661
            <th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   662
              <span title="event handlers">Event handler</span>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   663
            </th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   664
            <th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   665
              <span>Event handler event type</span>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   666
            </th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   667
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   668
        </thead>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   669
        <tbody>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   670
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   671
            <td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   672
              <dfn id="dom-networkservices-onserviceavailable" title="dom-NetworkServices-onserviceavailable">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   673
                <code>onserviceavailable</code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   674
              </dfn>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   675
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   676
            <td>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   677
              <a href="#event-serviceavailable"><code>serviceavailable</code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   678
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   679
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   680
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   681
            <td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   682
              <dfn id="dom-networkservices-onserviceunavailable" title="dom-NetworkServices-onserviceunavailable">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   683
                <code>onserviceunavailable</code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   684
              </dfn>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   685
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   686
            <td>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   687
              <a href="#event-serviceunavailable"><code>serviceunavailable</code></a>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   688
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   689
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   690
        </tbody>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   691
      </table>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   692
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   693
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   694
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   695
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   696
    <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   697
    <h2>Communicating with a networked service</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   698
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   699
<p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   700
   The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection information for an HTTP service endpoint and if available, service events, running on a networked device.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   701
</p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   702
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   703
<pre class="widl">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   704
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   705
interface <dfn id="networkservice">NetworkService</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   706
  readonly attribute DOMString        <a href="#dom-networkservice-id">id</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   707
  readonly attribute DOMString        <a href="#dom-networkservice-name">name</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   708
  readonly attribute DOMString        <a href="#dom-networkservice-type">type</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   709
  readonly attribute DOMString        <a href="#dom-networkservice-url">url</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   710
  readonly attribute DOMString        <a href="#dom-networkservice-config">config</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   711
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   712
  readonly attribute boolean          <a href="#dom-networkservice-online">online</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   713
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   714
  // event handler attributes
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   715
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceonline">onserviceonline</a>;
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   716
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceoffline">onserviceoffline</a>;
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   717
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   718
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onnotify">onnotify</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   719
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   720
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   721
<a href="#networkservice">NetworkService</a> implements <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget" class="externalDFN">EventTarget</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   722
</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   723
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   724
<section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   725
  <h2>Attributes</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   726
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   727
      <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   728
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   729
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   730
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   731
          <code title="dom-networkservice-id">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   732
            <a href="#dom-networkservice-id">id</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   733
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   734
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   735
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   736
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   737
            A unique identifier for the given user-selected service instance.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   738
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   739
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   740
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   741
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   742
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   743
          <code title="dom-networkservice-name">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   744
            <a href="#dom-networkservice-name">name</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   745
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   746
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   747
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   748
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   749
            The name of the user-selected service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   750
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   751
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   752
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   753
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   754
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   755
          <code title="dom-networkservice-type">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   756
            <a href="#dom-networkservice-type">type</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   757
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   758
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   759
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   760
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   761
            The <a>valid service type</a> token value of the user-selected service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   762
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   763
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   764
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   765
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   766
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   767
          <code title="dom-networkservice-url">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   768
            <a href="#dom-networkservice-url">url</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   769
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   770
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   771
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   772
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   773
            The control URL endpoint (including any required port information) of the user-selected control service that has been added to the <a>entry script origin's URL whitelist</a>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   774
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   775
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   776
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   777
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   778
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   779
          <code title="dom-networkservice-config">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   780
            <a href="#dom-networkservice-config">config</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   781
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   782
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   783
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   784
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   785
            The configuration information associated with the service depending on the requested service type.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   786
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   787
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   788
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   789
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   790
          <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   791
            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service. The same service provided at different times or on different objects <em class="ct">MUST</em> have the same <a href="#dom-networkservice-id"><code>id</code></a> value.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   792
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   793
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   794
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   795
            The <dfn id="dom-networkservice-name"><code>name</code></dfn> attribute represents a human-readable title for the service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   796
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   797
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   798
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   799
             The <dfn id="dom-networkservice-type"><code>type</code></dfn> attribute reflects the value of the <a>valid service type</a> of the service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   800
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   801
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   802
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   803
            The <dfn id="dom-networkservice-url"><code>url</code></dfn> attribute is an <a href="http://www.w3.org/TR/html5/urls.html#absolute-url" class="externalDFN">absolute URL</a> pointing to the root HTTP
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   804
            endpoint for the service that has been added to the <a>entry script origin's URL whitelist</a>. Web pages can subsequently use this value for implicit cross-document messaging via various existing mechanisms (e.g. Web Sockets, Server-Sent Events, Web Messaging, XMLHttpRequest).
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   805
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   806
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   807
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   808
            The <dfn id="dom-networkservice-config"><code>config</code></dfn> attribute provides the raw configuration information extracted from the given network service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   809
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   810
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   811
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   812
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   813
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   814
         <h3>States</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   815
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   816
      <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   817
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   818
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   819
           .
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   820
          <code title="dom-networkservice-online">
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   821
            <a href="#dom-networkservice-online">online</a>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   822
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   823
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   824
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   825
          <p>
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   826
            Returns <code>true</code> if the service is reporting that it is accessible on the local network or <code>false</code> if the service is reporting that it is no longer accessible (temporarily or permanently) on the local network.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   827
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   828
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   829
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   830
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   831
      <p>
195
76074ec7e535 Clean up the UPnP Update Service Monitor
Rich Tibbett <richt@opera.com>
parents: 194
diff changeset
   832
        The <dfn id="dom-networkservice-online"><code>online</code></dfn> attribute indicates whether the service is reporting itself as being
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   833
        either <var>online</var>, and therefore accessible on the local network, in which case this attribute will return <code>true</code> or, <var>offline</var>, and therefore not accessible on the local network, either temporarily or permanently, in which case this attribute will return <code>false</code>. This attribute <em class="ct">MUST</em> default to <code>true</code>.
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   834
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   835
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   836
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   837
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   838
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   839
         <h3>Events</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   840
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   841
      <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   842
         The following are the event handlers (and their corresponding event handler event types) that <em class="ct">MUST</em> be supported, as IDL attributes, by all objects implementing the
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   843
         <a href="#networkservice"><code>NetworkService</code></a> interface:
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   844
       </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   845
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   846
       <table border="1">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   847
        <thead>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   848
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   849
            <th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   850
              <span title="event handlers">Event handler</span>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   851
            </th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   852
            <th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   853
              <span>Event handler event type</span>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   854
            </th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   855
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   856
        </thead>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   857
        <tbody>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   858
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   859
            <td>
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   860
              <dfn id="dom-networkservice-onnotify" title="dom-NetworkService-onnotify">
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   861
                <code>onnotify</code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   862
              </dfn>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   863
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   864
            <td>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   865
              <a href="#event-notify"><code>notify</code></a>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   866
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   867
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   868
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   869
            <td>
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   870
              <dfn id="dom-networkservice-onserviceonline" title="dom-NetworkService-onserviceonline">
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   871
                <code>onserviceonline</code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   872
              </dfn>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   873
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   874
            <td>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   875
              <a href="#event-serviceonline"><code>serviceonline</code></a>
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   876
            </td>
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   877
          </tr>
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   878
          <tr>
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   879
            <td>
195
76074ec7e535 Clean up the UPnP Update Service Monitor
Rich Tibbett <richt@opera.com>
parents: 194
diff changeset
   880
              <dfn id="dom-networkservice-onserviceoffline" title="dom-NetworkService-onserviceoffline">
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   881
                <code>onserviceoffline</code>
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   882
              </dfn>
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   883
            </td>
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   884
            <td>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   885
              <a href="#event-serviceoffline"><code>serviceoffline</code></a>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   886
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   887
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   888
        </tbody>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   889
      </table>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   890
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   891
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   892
   </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   893
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   894
      <section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   895
            <h2>Service Discovery</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   896
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   897
      <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   898
         A <a>user agent</a> conforming to this specification <em class="ct">MAY</em> implement <acronym title="Simple Service Discovery Protocol">SSDP</acronym> [[!UPNP-DEVICEARCH11]] and Zeroconf [[!DNS-SD]] + [[!MDNS]] service discovery mechanisms
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   899
         to enable Web pages to request and connect with HTTP services running on networked devices, discovered via either mechanism, through this API. When a <a>user agent</a> implements either of these service discovery mechanisms, then it <em class="ct">MUST</em> conform to the corresponding algorithms provided in this section of the specification.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   900
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   901
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   902
         This section presents how the results of these two service discovery
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   903
         mechanisms will be matched to requested service types, how the user agent stores available and active services, how their properties are applied to any resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   904
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   905
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   906
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   907
         It is expected that user agents will perform these service discovery mechansisms asynchronously and periodically update the <a>list of networked devices</a> as required. The timing of any
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   908
         service discovery mechanisms is an implementation detail left to the discretion of the implementer (e.g. once on user agent start-up, every X seconds during user agent execution or on
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   909
         invocation of this API from a Web page).
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   910
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   911
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   912
      <p>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   913
         The <dfn>list of available service records</dfn> is a single dynamic internal lookup table within user agents that is used to track all the  services that have been discovered and are available in the current network at any given time.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   914
         At any point during the running of either of the two service discovery mechanisms then existing entries within this table can be updated, entries can be added and entries can be removed as the status of networked
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   915
         services changes according to the rules defined in this specification.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   916
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   917
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   918
      <p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   919
        The <dfn>list of authorized service records</dfn> is a single dynamic internal lookup table within user agents that is used to track the
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   920
        current services that are being shared with web pages at any given time from the <a>list of available service records</a>. Each record in the <a>list of authorized service records</a> is associated with a <var>services manager</var> object that is assigned as part of the
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   921
         <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> algorithm.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   922
      </p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   923
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   924
      <p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   925
        The rule for <dfn>adding an available service</dfn> is the process of adding a new service or updating an existing service in the <a>list of available service records</a> that is generally available on the user's current network. This rule takes one argument, <var>network service record</var>, and consists of
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   926
        running the following steps:
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   927
      </p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   928
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   929
      <ol class="rule">
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   930
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   931
        <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   932
          Let <var>new service registration flag</var> be <code>true</code>.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   933
        </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   934
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   935
        <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   936
           For each <var>existing service record</var> in the current <a>list of available service records</a>, run the following sub-steps:
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   937
           <ol class="rule">
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   938
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   939
             <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   940
              If the <var>existing service record</var>'s <code>id</code> property does not equal <var>network service record</var>'s <code>id</code>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   941
               property then abort any remaining sub-steps and continue at the next available <var>existing service record</var>.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   942
             </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   943
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   944
             <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   945
              Set <var>new service registration flag</var> to <code>false</code>.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   946
             </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   947
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   948
             <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   949
               Replace the value of <var>existing service record</var> in the current <a>list of available service records</a> with the value of
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   950
              <var>network service record</var>.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   951
             </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   952
           </ol>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   953
        </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   954
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   955
        <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   956
           If <var>new service registration flag</var> is set to <code>true</code> then add <var>network service record</var> to the <a>list of available service records</a> as a new entry.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   957
        </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   958
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   959
        <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   960
          For each <var>active service</var> in the <a>list of authorized service records</a> run the following steps:
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   961
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   962
          <ol class="rule">
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   963
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   964
            <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   965
               If <var>network service record</var>'s <code>type</code> property does not equal the current <var>active service</var>'s
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   966
                <code>type</code> attribute then abort any remaining sub-steps for this <var>active service</var> and continue at the next available <var>active service</var>.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   967
            </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   968
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   969
            <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   970
               If the <var>new service registration flag</var> is set to <code>true</code> then increment the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <var>services manager</var> associated with
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   971
               the current <var>active service</var>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   972
                object by <code>1</code> and then <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   973
                 to dispatch a newly created event with the name <a href="#event-serviceavailable"><code>serviceavailable</code></a> that uses the <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface,
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   974
                 which does not bubble, is not cancellable, and has no default action, at the <var>services manager</var> associated with
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   975
                 the current <var>active service</var> object.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   976
            </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   977
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   978
            <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   979
               Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a> attribute to <code>true</code> and then
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   980
               <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   981
                to dispatch a newly created event with the name <a href="#event-serviceonline"><code>serviceonline</code></a> that uses the
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
   982
                <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface, which
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   983
                 does not bubble, is not cancellable, and has no default action, at the current
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   984
                <var>active service</var> object.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   985
            </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   986
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   987
          </ol>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   988
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   989
        </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   990
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   991
      </ol>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   992
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   993
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   994
      <p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   995
        The rule for <dfn>removing an available service</dfn> is the general process of removing a service from the
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   996
        <a>list of available service records</a>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   997
         that has left the user's current network or has otherwise expired. This rule takes one argument, <var>service identifier</var>, and consists of running the following steps:</p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   998
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   999
      <ol class="rule">
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1000
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1001
        <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1002
           For each <var>existing service record</var> in the current <a>list of available service records</a>, run the following sub-steps:
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1003
           <ol class="rule">
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1004
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1005
             <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1006
              If the <var>existing service record</var>'s <code>id</code> property does not match <var>service identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and continue at the next available <var>existing service record</var>.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1007
             </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1008
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1009
             <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1010
               If the <var>existing service record</var>'s <code>type</code> property begins with the DOMString "<code>upnp:</code>" and
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1011
               <var>existing service record</var>'s <code>eventsURL</code> property is set then run the rule to
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1012
               <a>terminate an existing UPnP Events Subscription</a>, if one is currently active (as a result of having previously called
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1013
               <a>setup a UPnP Events Subscription</a> against the current <var>existing service record</var>).
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1014
             </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1015
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1016
             <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1017
               For each <var>active service</var> in <a>list of authorized service records</a> run the following steps:
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1018
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1019
               <ol class="rule">
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1020
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1021
                 <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1022
                    If <var>existing service record</var>'s <code>type</code> property does not equal the current <var>active service</var>'s
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1023
                     <code>type</code> attribute then abort any remaining sub-steps for this <var>active service</var> and continue at the next available <var>active service</var>.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1024
                 </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1025
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1026
                 <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1027
                    Decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1028
                    <var>services manager</var> associated with the current <var>active service</var>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1029
                     object by <code>1</code> and then <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1030
                      to dispatch a newly created event with the name <a href="#event-serviceunavailable"><code>serviceunavailable</code></a> that uses the
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1031
                      <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface,
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1032
                      which does not bubble, is not cancellable, and has no default action, at the <var>services manager</var> associated with
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1033
                      the current <var>active service</var> object.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1034
                 </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1035
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1036
                 <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1037
                    Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a> attribute to <code>false</code> and then
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1038
                    <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1039
                     to dispatch a newly created event with the name <a href="#event-serviceoffline"><code>serviceoffline</code></a> that uses the
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1040
                     <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface, which
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1041
                      does not bubble, is not cancellable, and has no default action, at the current
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1042
                     <var>active service</var> object.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1043
                 </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1044
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1045
               </ol>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1046
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1047
             </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1048
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1049
             <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1050
               Remove <var>existing service record</var> from the current <a>list of available service records</a>.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1051
             </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1052
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1053
           </ol>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1054
        </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1055
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1056
      </ol>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1057
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1058
      <p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1059
       User agents <em class="ct">SHOULD</em> expire a service record from the <a>list of available service records</a> when its
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1060
       <code>expiryTimestamp</code> attribute exceeds the current UTC timestamp. When this condition is met the <a>user agent</a> SHOULD
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1061
       run the rule for <a>removing an available service</a>, passing in the expired service record's <code>id</code> attribute as the
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1062
       only argument.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1063
      </p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1064
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1065
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1066
      <section>
185
ef42cb5f9a60 validity errors
Robin Berjon <robin@berjon.com>
parents: 183
diff changeset
  1067
         <h4>Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</h4>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1068
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1069
         <p>
185
ef42cb5f9a60 validity errors
Robin Berjon <robin@berjon.com>
parents: 183
diff changeset
  1070
            For each DNS response received from a user-agent-initiated Multicast DNS Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name <code>_services._dns-sd._udp</code> on the resolved recommended automatic browsing
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1071
   domain [[!MDNS]], the <a>user agent</a> <em class="ct">MUST</em> run the following steps:
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1072
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1073
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1074
         <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1075
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1076
            <li>Let <var>service mDNS responses</var> be an array of PTR records received by issuing a Multicast DNS Browse for PTR records with the name of the current discovered service type.</li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1077
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1078
            <li>For each Object <var>service mDNS response</var> in <var>service mDNS responses</var>, run the following steps:
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1079
               <ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1080
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1081
                  <li>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1082
                     Let <var>network service record</var> be an Object consisting of the following empty properties: <code>id</code>, <code>name</code>, <code>type</code>, <code>url</code>, <code>config</code>, <code>expiryTimestamp</code>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1083
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1084
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1085
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1086
                     Set <var>network service record</var>'s <code>id</code> property to the value of the full PTR Service Instance Name [[!MDNS]].
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1087
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1088
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1089
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1090
                     Set <var>network service record</var>'s <code>name</code> property to the value of the PTR Service Instance Name's <var>Instance</var> component [[!MDNS]].
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1091
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1092
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1093
                  <li>
232
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1094
                     Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string <code>zeroconf:</code> followed be the value of the PTR Service Instance Name's <var>Service</var> component [[!MDNS]].
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1095
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1096
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1097
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1098
                     Set <var>network service record</var>'s <code>url</code> property to the resolvable Service URL obtained from performing an DNS-SD Lookup [[!DNS-SD]] of the current service from the PTR record provided [[!MDNS]].
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1099
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1100
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1101
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1102
                     Set <var>network service record</var>'s <code>config</code> property to the string value of the contents of the first DNS-SD TXT record associated with the <var>service mDNS response</var> as defined in [[!DNS-SD]].
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1103
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1104
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1105
                  <li>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1106
                     Set <var>network service record</var>'s <code>expiryTimestamp</code> property to the value of the current date, in UTC timestamp format, plus a value of <code>120</code> seconds.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1107
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1108
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1109
                  <li>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1110
                     Run the general rule for <a>adding an available service</a>, passing in the current <var>network service record</var> as the
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1111
                     only argument.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1112
                  </li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1113
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1114
            </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1115
           </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1116
         </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1117
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1118
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1119
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1120
      <section>
232
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1121
         <h5>Simple Service Discovery Protocol (<abbr title="Simple Service Discovery Protocol">SSDP</abbr>)</h5>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1122
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1123
         <p>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1124
          A user agent that implements UPnP service discovery <em class="ct">MUST</em> issue an <dfn>advertisement for UPnP root devices</dfn> against the user's
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1125
          current local network according to the full normative text and timing provided in 'Section 1.3.2: Search request with M-SEARCH' detailed in [[!UPNP-DEVICEARCH11]].
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1126
          </p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1127
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1128
          <p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1129
            The user agent <em class="ct">MUST</em> issue all <a title="advertisement for UPnP root devices">advertisements for UPnP root devices</a> with a HTTP request line equal to <code>M-SEARCH * HTTP/1.1</code>, with a HOST header equal to the reserved multicast address and port of <code>239.255.255.250:1900</code>, a MAN header equal to <code>ssdp:discover</code>, an ST header equal to <code>upnp:rootdevice</code> and a user-agent defined MX header equal to a <dfn>maximum UPnP advertisement response wait time</dfn> value between <code>1</code> and <code>5</code> seconds.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1130
         </p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1131
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1132
         <p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1133
          The user agent <em class="ct">MUST</em> listen for incoming requests and process any incoming responses to any <a>advertisement for UPnP root devices</a> on the <dfn>standard UPnP address and port</dfn>, on all current local network interface addresses with the port <code>1900</code>, according to the rules defined in this section.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1134
         </p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1135
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1136
         <p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1137
          For each <dfn>HTTP Response</dfn> following an initial <a>advertisement for UPnP root devices</a> sent on a <a>standard UPnP address
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1138
            and port</a> the user agent <em class="ct">MUST</em> run the following steps:
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1139
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1140
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1141
         <ol class="rule">
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1142
          <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1143
            If the <a>HTTP Response</a> is not a HTTP 200 OK response then this response is invalid and the user agent <em class="ct">MUST</em> discard this response, abort any remaining steps and return. The user agent <em class="ct">MAY</em> issue a new <a>advertisement for UPnP root devices</a> as a result of this error occurring.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1144
          </li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1145
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1146
          <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1147
            If the <a>maximum UPnP advertisement response wait time</a> has been exceeded since the initial <a>advertisement for UPnP root devices</a> was sent then the <a>HTTP Response</a> is invalid and the user agent <em class="ct">MUST</em> discard this response, abort any remaining steps and return.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1148
          </li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1149
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1150
          <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1151
             Let <var>ssdp device</var> be an Object with a property for each HTTP header received in the <a>HTTP Response</a>, with each key being the name of a HTTP response header and each value being that HTTP response header's value.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1152
          </li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1153
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1154
          <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1155
            If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one <var>USN</var> entry, at least one <var>ST</var> entry and at least one <var>LOCATION</var> entry or the value of its <var>ST</var> entry is not <code>upnp:rootdevice</code>, then the <a>HTTP Response</a> is invalid and the <a>user agent</a> <em class="ct">MUST</em> discard this response, abort any remaining steps and return.
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1156
          </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1157
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1158
          <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1159
            The user agent <em class="ct">MUST</em> run the rule for <a>obtaining a UPnP Device Description File</a> passing in the first occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor URL</var> argument and the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var> argument.
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1160
          </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1161
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1162
        </ol>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1163
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1164
        <p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1165
          For each <dfn>HTTP Request</dfn> received on a <a>standard UPnP address and port</a> the user agent <em class="ct">MUST</em> run the following steps:
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1166
         </p>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1167
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1168
        <ol class="rule">
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1169
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1170
          <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1171
            If the <a>HTTP Request</a> is not a HTTP NOTIFY request then it is not a valid UPnP Request and the user agent <em class="ct">MUST</em> return a HTTP 200 OK response, discard this request, abort any remaining steps and return.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1172
          </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1173
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1174
          <li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1175
             Let <var>ssdp device</var> be an Object with a property for each HTTP header received in the <a>HTTP Request</a>, with each key being the name of a HTTP header and each value being that HTTP header's value.
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1176
          </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1177
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1178
          <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1179
            If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one <var>USN</var> entry, at least one <var>NT</var> entry, at least one <var>NTS</var> entry and at least one <var>LOCATION</var> entry or the value of its <var>NT</var> entry is not <code>upnp:rootdevice</code>, then the <a>HTTP Request</a> is a malformed UPnP Request and the <a>user agent</a> <em class="ct">MUST</em> return a 400 Bad Request response, discard this request, abort any remaining steps and return.
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1180
          </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1181
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1182
          <li>
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
  1183
            If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> or <code>ssdp:update</code> then the user agent <em class="ct">MUST</em> run the rule for <a>obtaining a UPnP Device Description File</a> passing in the first occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor URL</var> argument and the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var>. <br/><br/>Otherwise, if <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:byebye</code> then the user agent <em class="ct">MUST</em> run the rule for <a>removing all services from a registered UPnP Device</a> passing in the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument.
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1184
          </li>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1185
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1186
        </ol>
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1187
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
  1188
      <p>
232
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1189
        The rule for <dfn>obtaining a UPnP Device Description File</dfn> is the process of obtaining the contents of a standard UPnP Device Description [[!UPNP-DEVICEARCH11]] from a URL-based resource. This rule takes three arguments - <var>device descriptor URL</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the user agent <em class="ct">MUST</em> run the following steps:
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1190
      </p>
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1191
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1192
      <ol class="rule">
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1193
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1194
          <li>
32487cf058c5 Add embedded device processing to SSDP algorithms + minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 231
diff changeset
  1195
             Let <var>device descriptor file</var> contain the contents of the file located at the URL provided in <var>device descriptor URL</var> obtained according to the rules
<