discovery-api/Overview.html
author Anssi Kostiainen <anssi.kostiainen@nokia.com>
Mon, 03 Sep 2012 18:02:09 +0300
changeset 216 5583626294f6
parent 215 53f4bfeee4fe
parent 204 58fadbd65d13
child 230 3c13dc93cfb1
permissions -rw-r--r--
merge heads
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
     1
<!DOCTYPE html>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
     2
<html lang="en" dir="ltr">
180
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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     7
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     8
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     9
    <style type="text/css">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    10
      /* Custom CSS optimizations (Richard Tibbett) */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    11
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    12
      /* Add better spacing to sections */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    13
      section, .section { margin-bottom: 2em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    14
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    15
      /* Reduce note & issue render size */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    16
      .note, .issue { font-size:0.8em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    17
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    18
      /* 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
    19
      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
    20
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    21
      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
    22
      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
    23
      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
    24
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    25
      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
    26
      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
    27
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    28
      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
    29
      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
    30
      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
    31
      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
    32
      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
    33
      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
    34
      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; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    35
    </style>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    36
  <style>/*****************************************************************
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    37
 * ReSpec 3 CSS
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    38
 * Robin Berjon - http://berjon.com/
180
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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    41
/* --- INLINES --- */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    42
em.rfc2119 {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    43
    text-transform:     lowercase;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    44
    font-variant:       small-caps;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    45
    font-style:         normal;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    46
    color:              #900;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    47
}
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
h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    50
h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    51
    border: none;
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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    54
dfn {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    55
    font-weight:    bold;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    56
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    57
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    58
a.internalDFN {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    59
    color:  inherit;
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    60
    border-bottom:  1px solid #99c;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    61
    text-decoration:    none;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    62
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    63
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    64
a.externalDFN {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    65
    color:  inherit;
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    66
    border-bottom:  1px dotted #ccc;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    67
    text-decoration:    none;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    68
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    69
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    70
a.bibref {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    71
    text-decoration:    none;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    72
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    73
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    74
cite .bibref {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    75
    font-style: normal;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    76
}
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    77
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    78
code {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    79
    color:  #ff4500;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    80
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    81
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    82
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    83
/* --- --- */
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    84
ol.algorithm { counter-reset:numsection; list-style-type: none; }
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    85
ol.algorithm li { margin: 0.5em 0; }
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    86
ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    87
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    88
/* --- TOC --- */
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    89
.toc a, .tof a {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    90
    text-decoration:    none;
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
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    93
a .secno, a .figno {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    94
    color:  #000;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    95
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    96
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    97
ul.tof, ol.tof {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
    98
    list-style: none outside none;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    99
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   100
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   101
.caption {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   102
    margin-top: 0.5em;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   103
    font-style:   italic;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   104
}
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
/* --- TABLE --- */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   107
table.simple {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   108
    border-spacing: 0;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   109
    border-collapse:    collapse;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   110
    border-bottom:  3px solid #005a9c;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   111
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   112
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   113
.simple th {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   114
    background: #005a9c;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   115
    color:  #fff;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   116
    padding:    3px 5px;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   117
    text-align: left;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   118
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   119
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   120
.simple th[scope="row"] {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   121
    background: inherit;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   122
    color:  inherit;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   123
    border-top: 1px solid #ddd;
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
.simple td {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   127
    padding:    3px 10px;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   128
    border-top: 1px solid #ddd;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   129
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   130
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   131
.simple tr:nth-child(even) {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   132
    background: #f0f6ff;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   133
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   134
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   135
/* --- DL --- */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   136
.section dd > p:first-child {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   137
    margin-top: 0;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   138
}
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
.section dd > p:last-child {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   141
    margin-bottom: 0;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   142
}
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
.section dd {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   145
    margin-bottom:  1em;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   146
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   147
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   148
.section dl.attrs dd, .section dl.eldef dd {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   149
    margin-bottom:  0;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   150
}
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   151
</style><style>/* --- ISSUES/NOTES --- */
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   152
div.issue-title, div.note-title {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   153
    padding-right:  1em;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   154
    min-width: 7.5em;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   155
    color: #b9ab2d;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   156
}
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   157
div.issue-title { color: #e05252; }
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   158
div.note-title { color: #52e052; }
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   159
div.issue-title span, div.note-title span {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   160
    text-transform: uppercase;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   161
}
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   162
div.note, div.issue {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   163
    margin-top: 1em;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   164
    margin-bottom: 1em;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   165
}
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   166
.note > p:first-child, .issue > p:first-child { margin-top: 0 }
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   167
.issue, .note {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   168
    padding: .5em;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   169
    border-left-width: .5em;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   170
    border-left-style: solid;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   171
}
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   172
div.issue, div.note {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   173
    padding: 0.5em;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   174
    margin: 1em 0;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   175
    position: relative;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   176
    clear: both;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   177
}
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   178
span.note, span.issue { padding: .1em .5em .15em; }
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   179
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   180
.issue {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   181
    border-color: #e05252;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   182
    background: #fbe9e9;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   183
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   184
.note {
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   185
    border-color: #52e052;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   186
    background: #e9fbe9;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   187
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   188
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   189
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   190
</style><style>/* HIGHLIGHTS */
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   191
code.prettyprint {
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   192
    color:  inherit;
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   193
}
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   194
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   195
/* this from google-code-prettify */
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   196
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
197
383c29793d6b Change 'two services must have the same id' to 'A service...'
Rich Tibbett <richt@opera.com>
parents: 196
diff changeset
   197
</style><link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='undefined://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   198
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   199
  <body><div class="head">
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   200
  <p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   201
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
   202
      <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></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
   203
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   204
  </p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   205
  <h1 class="title" id="title">Networked Service Discovery and Messaging</h1>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   206
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   207
  <h2 id="w3c-editor-s-draft-22-august-2012"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 22 August 2012</h2>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   208
  <dl>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   209
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   210
      <dt>This version:</dt>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   211
      <dd><a href="http://w3c-test.org/dap/discovery-api/">http://w3c-test.org/dap/discovery-api/</a></dd>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   212
      <dt>Latest published version:</dt>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   213
      <dd><a href="http://www.w3.org/TR/discovery-api/">http://www.w3.org/TR/discovery-api/</a></dd>
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
   214
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   215
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   216
      <dt>Latest editor's draft:</dt>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   217
      <dd><a href="http://w3c-test.org/dap/discovery-api/">http://w3c-test.org/dap/discovery-api/</a></dd>
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
   218
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   219
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   220
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
   221
180
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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   224
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   225
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   226
    <dt>Editors:</dt>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   227
    <dd><span>Rich Tibbett</span>, <a href="http://opera.com/">Opera Software ASA</a></dd>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   228
<dd><span>Clarke Stevens</span>, <a href="http://cablelabs.com/">CableLabs</a></dd>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   229
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   230
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   231
  </dl>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   232
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   233
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   234
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   235
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   236
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   237
      <p class="copyright">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   238
        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   239
        2012
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   240
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   241
        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   242
        (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   243
        <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   244
        <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   245
        <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   246
        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   247
        <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   248
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   249
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   250
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   251
  <hr>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   252
</div>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   253
    <section id="abstract" class="introductory"><h2>Abstract</h2>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   254
      <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   255
        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
   256
        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
   257
      </p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   258
    </section><section id="sotd" class="introductory"><h2>Status of This Document</h2>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   259
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   260
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   261
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   262
        <p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   263
          <em>This section describes the status of this document at the time of its publication. Other
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   264
          documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   265
          of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   266
          index</a> at http://www.w3.org/TR/.</em>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   267
        </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
   268
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
   269
      <p>
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
   270
        This document represents the early consensus of the group on the scope and features of the proposed
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   271
        <abbr title="Application Programming Interface">API</abbr>.
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
   272
      </p>
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
   273
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
   274
        <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   275
          This document was published by the <a href="http://www.w3.org/2009/dap/">Device APIs and Policy Working Group</a> as an Editor's Draft.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   276
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   277
          If you wish to make comments regarding this document, please send them to
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   278
          <a href="mailto:public-device-apis@w3.org">public-device-apis@w3.org</a>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   279
          (<a href="mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>,
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   280
          <a href="http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>).
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   281
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   282
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   283
          All feedback is welcome.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   284
        </p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   285
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   286
          <p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   287
            Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   288
            This is a draft document and may be updated, replaced or obsoleted by other documents at
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   289
            any time. It is inappropriate to cite this document as other than work in progress.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   290
          </p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   291
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   292
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   293
        <p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   294
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   295
            This document was produced by a group operating under the
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   296
            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   297
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   298
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   299
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   300
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   301
              <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/43696/status" rel="disclosure">public list of any patent disclosures</a>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   302
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   303
            made in connection with the deliverables of the group; that page also includes instructions for
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   304
            disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   305
            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   306
            information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   307
            6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   308
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   309
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
   310
        </p>
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
   311
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
   312
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
   313
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   314
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   315
</section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">2. </span>Conformance</a><ul class="toc"><li class="tocline"><a href="#dependencies" class="tocxref"><span class="secno">2.1 </span>Dependencies</a></li></ul></li><li class="tocline"><a href="#terminology" class="tocxref"><span class="secno">3. </span>Terminology</a></li><li class="tocline"><a href="#requesting-networked-services" class="tocxref"><span class="secno">4. </span>Requesting networked services</a><ul class="toc"><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">4.1 </span>Methods</a></li><li class="tocline"><a href="#error-handling" class="tocxref"><span class="secno">4.2 </span>Error Handling</a></li></ul></li><li class="tocline"><a href="#obtaining-networked-services" class="tocxref"><span class="secno">5. </span>Obtaining networked services</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">5.2 </span>Methods</a></li><li class="tocline"><a href="#events" class="tocxref"><span class="secno">5.3 </span>Events</a></li></ul></li><li class="tocline"><a href="#communicating-with-a-networked-service" class="tocxref"><span class="secno">6. </span>Communicating with a networked service</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">6.1 </span>Attributes</a></li><li class="tocline"><a href="#states" class="tocxref"><span class="secno">6.2 </span>States</a></li><li class="tocline"><a href="#events-1" class="tocxref"><span class="secno">6.3 </span>Events</a></li></ul></li><li class="tocline"><a href="#service-discovery" class="tocxref"><span class="secno">7. </span>Service Discovery</a><ul class="toc"><li class="tocline"><a href="#zeroconf-mdns-dns-sd" class="tocxref"><span class="secno">7.1 </span>Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</a></li><li class="tocline"><a href="#universal-plug-and-play-upnp" class="tocxref"><span class="secno">7.2 </span>Universal Plug-and-Play (<abbr title="Universal Plug-and-Play">UPnP</abbr>)</a></li><li class="tocline"><a href="#network-topology-monitoring" class="tocxref"><span class="secno">7.3 </span>Network Topology Monitoring</a></li></ul></li><li class="tocline"><a href="#garbage-collection" class="tocxref"><span class="secno">8. </span>Garbage collection</a></li><li class="tocline"><a href="#use-cases-and-requirements" class="tocxref"><span class="secno">9. </span>Use Cases and Requirements</a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">A. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">B. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">C. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">C.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">C.2 </span>Informative references</a></li></ul></li></ul></section>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   316
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   317
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   318
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   319
    <section class="informative" id="introduction">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   320
      <!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   321
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   322
      <p>To enable Web pages to connect and communicate with Local-networked Services provided over <abbr title="Hypertext Transfer Protocol">HTTP</abbr>, this specification introduces the
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   323
      <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
   324
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   325
      <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   326
         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
   327
         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
   328
      </p>
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
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   331
         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
   332
      </p>
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
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   335
         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
   336
      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
   337
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   338
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   339
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   340
          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
   341
          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
   342
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   343
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   344
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   345
         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
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   346
         authorized via the provided <abbr title="Application Programming Interface">API</abbr>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   347
         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
   348
         connected Local-networked Service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   349
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   350
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   351
      <div class="example">
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   352
       <p>Example of requesting a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> advertised service:</p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   353
       <hr>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   354
       <pre class="highlight prettyprint"><span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   355
  </span><span class="com">// Show a list of all the services provided to the web page</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   356
  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class="pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">name </span><span class="pun">);</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   357
</span><span class="pun">}</span><span class="pln">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   358
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   359
navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">(</span><span class="str">'zeroconf:_boxee-jsonrpc._tcp'</span><span class="pun">,</span><span class="pln"> showServices</span><span class="pun">);</span></pre>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   360
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   361
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   362
      <div class="example">
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   363
        <p>Example of requesting a <abbr title="Universal Plug-and-Play">UPnP</abbr> advertised service, also handling error conditions:</p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   364
        <hr>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   365
        <pre class="highlight prettyprint"><span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   366
  </span><span class="com">// Show a list of all the services provided to the web page</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   367
  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class="pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">name </span><span class="pun">);</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   368
</span><span class="pun">}</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   369
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   370
</span><span class="kwd">function</span><span class="pln"> error</span><span class="pun">(</span><span class="pln"> e </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   371
  console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln"> </span><span class="str">"Error occurred: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> e</span><span class="pun">.</span><span class="pln">code </span><span class="pun">);</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   372
</span><span class="pun">}</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   373
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   374
navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">(</span><span class="str">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</span><span class="pun">,</span><span class="pln"> showServices</span><span class="pun">,</span><span class="pln"> error</span><span class="pun">);</span></pre>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   375
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   376
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   377
      <div class="example">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   378
        <p>Example of requesting either a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> or <abbr title="Universal Plug-and-Play">UPnP</abbr> advertised service:</p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   379
        <hr>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   380
        <pre class="highlight prettyprint"><span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   381
  </span><span class="com">// Show a list of all the services provided to the web page (+ service type)</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   382
  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class="pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   383
     console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">'('</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">type </span><span class="pun">+</span><span class="pln"> </span><span class="str">')'</span><span class="pln"> </span><span class="pun">);</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   384
</span><span class="pun">}</span><span class="pln">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   385
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   386
navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">([</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   387
  </span><span class="str">'zeroconf:_boxee-jsonrpc._tcp'</span><span class="pun">,</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   388
  </span><span class="str">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</span><span class="pln">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   389
</span><span class="pun">],</span><span class="pln"> showServices</span><span class="pun">);</span></pre>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   390
      </div>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   391
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   392
      <p>For more detailed examples see the <a href="#examples">Examples</a> section.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   393
    </p></section>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   394
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   395
    <section id="conformance"><!--OddPage--><h2><span class="secno">2. </span>Conformance</h2>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   396
<p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   397
  As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   398
  and notes in this specification are non-normative. Everything else in this specification is
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   399
  normative.
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   400
</p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   401
<p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   402
  The key words <em class="rfc2119" title="must">must</em>, <em class="rfc2119" title="must not">must not</em>, <em class="rfc2119" title="required">required</em>, <em class="rfc2119" title="should">should</em>, <em class="rfc2119" title="should not">should not</em>, <em class="rfc2119" title="recommended">recommended</em>, <em class="rfc2119" title="may">may</em>,
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   403
  and <em class="rfc2119" title="optional">optional</em> in this specification are to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   404
</p>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   405
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   406
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   407
     <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
   408
     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
   409
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   410
     <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   411
      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
   412
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   413
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   414
     <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   415
      Conformance requirements phrased as algorithms or specific steps may be implemented in any manner, so long as the end result is equivalent. (In particular, the algorithms defined in
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   416
      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
   417
     </p>
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
     <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   420
      The only conformance class defined by this specification is a <dfn id="dfn-user-agent">user agent</dfn>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   421
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   422
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   423
     <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   424
      User agents may 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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   425
      around platform-specific limitations.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   426
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   427
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   428
     <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   429
      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 must act as if
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   430
      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
   431
      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
   432
      is insufficient.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   433
     </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   434
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   435
      <section id="dependencies">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   436
         <h3><span class="secno">2.1 </span>Dependencies</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   437
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   438
         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
   439
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   440
         <dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   441
            <dt>HTML</dt>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   442
            <dd>Many fundamental concepts from HTML are used by this specification. [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>]</dd>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   443
            <dt>WebIDL</dt>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   444
            <dd>The IDL blocks in this specification use the semantics of the WebIDL specification. [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]</dd>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   445
         </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   446
      </section>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   447
    </section>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   448
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   449
    <section id="terminology">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   450
      <!--OddPage--><h2><span class="secno">3. </span>Terminology</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   451
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
         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
   454
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   455
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   456
      <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   457
         The term DOM is used to refer to the <abbr title="Application Programming Interface">API</abbr> 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
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   458
         other <code>Node</code> objects as defined in the DOM Core specifications. [<cite><a class="bibref" href="#bib-DOM4">DOM4</a></cite>]
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   459
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   460
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
         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
   463
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   464
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   465
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   466
        A <dfn id="dfn-valid-service-type">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
   467
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   468
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   469
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   470
        A <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> provided in the <code>type</code> attribute of the <code>getNetworkServices()</code> method will be matched against the services currently contained in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> according to the algorithms defined in this specification.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   471
      </p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   472
    </section>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   473
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   474
    <section id="requesting-networked-services">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   475
     <!--OddPage--><h2><span class="secno">4. </span>Requesting networked services</h2>
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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   478
<pre class="widl">[Supplemental, NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   479
interface <dfn id="navigatornetworkservice">NavigatorNetworkService</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   480
  // Obtain a Local-networked Service
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   481
  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
   482
                           in <a href="#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   483
                           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
   484
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   485
<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
   486
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   487
[Callback=FunctionOnly, NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   488
interface <dfn id="navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   489
  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
   490
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   491
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   492
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   493
interface <dfn id="navigatornetworkserviceerror">NavigatorNetworkServiceError</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   494
  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
   495
  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
   496
  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
   497
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   498
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   499
[Callback=FunctionOnly, NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   500
interface <dfn id="navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   501
  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
   502
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   503
</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   504
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   505
  <section id="methods">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   506
   <h3><span class="secno">4.1 </span>Methods</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   507
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   508
      <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   509
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   510
          <var title="">window</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   511
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   512
          <code title="dom-navigator">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   513
            <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
   514
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   515
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   516
          <code title="dom-navigator-getNetworkServices">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   517
            <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   518
          </code>
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
          <var title="">type</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   521
          ,
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   522
          <var title="">successCallback</var>
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
          <var title="">errorCallback</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   525
           ] )
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   526
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   527
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   528
          <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
   529
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   530
            The
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   531
            <var title="">type</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   532
             argument contains one or more <a href="#dfn-valid-service-type" class="internalDFN">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
   533
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   534
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   535
            If the user accepts, the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   536
            <var title="">successCallback</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   537
             is
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   538
          invoked, with one or more
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   539
            <code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   540
              <a href="#networkservice"><code>NetworkService</code></a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   541
            </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   542
             objects as
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   543
          its argument.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   544
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   545
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   546
            If the user declines, the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   547
            <var title="">errorCallback</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   548
             (if
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   549
          any) is invoked.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   550
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   551
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   552
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   553
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   554
       <div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   555
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   556
            When the <dfn id="dom-navigator-getnetworkservices" title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[, errorCallback])</code></dfn> method is called, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> run the following steps:
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   557
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   558
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   559
          <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   560
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   561
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   562
              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
   563
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   564
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   565
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   566
               If <var>type</var> is an array consisting of one or more <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens, then let <var>requested control types</var> by the value of <var>type</var>, removing any non-<a href="#dfn-valid-service-type" class="internalDFN">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
   567
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   568
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   569
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   570
               If <var>type</var> is a string consisting of one <a href="#dfn-valid-service-type" class="internalDFN">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
   571
            </li>
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
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   574
               If <var>requested control types</var> is an array that contains at least one or more <a title="valid service type" href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens then continue to the step labeled <em>process</em> below. Otherwise, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   575
                 <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
   576
                  (<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
   577
                   abort any remaining steps and return.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   578
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   579
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   580
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   581
               <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
   582
            </li>
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
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   585
               For each <var>available service</var> in the <a href="#dfn-list-of-available-service-records" class="internalDFN">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
   586
               <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   587
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   588
                    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
   589
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   590
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   591
                     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
   592
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   593
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   594
                     <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
   595
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   596
                     <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   597
                        <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   598
                           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
   599
                     <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
   600
                        </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   601
                        <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   602
                           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
   603
                        </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   604
                     </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   605
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   606
               </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   607
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   608
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   609
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   610
               If <var>services found</var> is an empty array, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   611
                 <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
   612
                 (<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
   613
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   614
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   615
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   616
               Return, and run the remaining steps asynchronously.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   617
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   618
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   619
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   620
               Optionally, e.g. based on a previously-established user preference, for security reasons, or due to platform limitations, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="may">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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   621
                 <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
   622
                 (<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
   623
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   624
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   625
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   626
                  The <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> prompt the user in a user-agent-specific manner for permission to provide the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   627
                  <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
   628
                  <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
   629
                  <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
   630
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   631
               <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   632
                  If the user grants permission to access one or more networked services then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="should">should</em> include an
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   633
                  "ongoing local-network communication" indicator.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   634
               </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   635
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   636
               <p>If the user denies permission, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   637
                <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
   638
                (<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
   639
              </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   640
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
                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
   643
              </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   644
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   645
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   646
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   647
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   648
               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
   649
            </li>
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
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   652
               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
   653
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   654
               <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   655
                  <li>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   656
                     Add the <var>service</var>'s <code>url</code> parameter to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">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
   657
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   658
                  <li>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   659
                    If <var>service</var>'s <code>type</code> parameter begins with the DOMString "<code>upnp:</code>" and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a href="#dfn-setup-a-upnp-events-subscription" class="internalDFN">setup a <abbr title="Universal Plug-and-Play">UPnP</abbr> 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
   660
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   661
               </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   662
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   663
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   664
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   665
               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
   666
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   667
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   668
            <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
   669
               Set <var>services manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the length of <var>services</var>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   670
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   671
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   672
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   673
              Store the set of <var>services</var> as <dfn id="current_authorized_services">current authorized services</dfn> internally against the newly created <var>services manager</var> object.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   674
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   675
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   676
            <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   677
               The <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   678
               <var>services manager</var> as its argument.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   679
            </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   680
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   681
          </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   682
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   683
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   684
            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
   685
            <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
   686
            <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
   687
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   688
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   689
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   690
            When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> add the <code>url</code> property
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   691
             to the <dfn id="dfn-entry-script-origin-s-url-whitelist">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</dfn>. This list enables the
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   692
            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
   693
            <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
   694
            <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
   695
            Web Messaging, XMLHttpRequest).
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   696
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   697
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   698
         <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   699
            If the user navigates away from the current browsing context, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> remove all previously whitelisted urls from the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">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
   700
            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
   701
            </p><ul>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   702
              <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
   703
              <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
   704
              <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
   705
              <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
   706
            </ul>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   707
         <p></p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   708
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   709
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   710
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   711
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   712
      <section id="error-handling">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   713
         <h3><span class="secno">4.2 </span>Error Handling</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   714
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   715
      <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   716
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   717
          <var title="">error</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   718
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   719
          <code title="dom-NavigatorNetworkServiceError-code">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   720
            <a href="#dom-navigatornetworkserviceerror-code">code</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   721
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   722
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   723
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   724
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   725
            Returns the current error's error code. At the current time, this may be <code>1</code> or <code>2</code>, for which the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   726
            corresponding error constants
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   727
            <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
   728
            <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
   729
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   730
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   731
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   732
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   733
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   734
            The <dfn id="dom-navigatornetworkserviceerror-code" title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   735
            <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class="rfc2119" title="must">must</em> return the code for the error, which will be one of the following:
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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   738
         <dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   739
            <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   740
               <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
   741
            </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   742
            <dd>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   743
               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
   744
            </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   745
            <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   746
               <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
   747
            </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   748
            <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   749
               No <a href="#dfn-valid-service-type" class="internalDFN">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
   750
            </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   751
         </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   752
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   753
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   754
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   755
      </section>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   756
      <section id="obtaining-networked-services">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   757
      <!--OddPage--><h2><span class="secno">5. </span>Obtaining networked services</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   758
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   759
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   760
         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
   761
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   762
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   763
<pre class="widl">[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   764
interface <dfn id="networkservices">NetworkServices</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   765
  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
   766
  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
   767
  <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
   768
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   769
  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
   770
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   771
  // event handler attributes
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   772
           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
   773
           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
   774
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   775
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   776
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   777
<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
   778
</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   779
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   780
      <section id="attributes">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   781
      <h3><span class="secno">5.1 </span>Attributes</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   782
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   783
        <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   784
          <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   785
            <code title="dom-networkservices-length">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   786
              <a href="#dom-networkservices-length">length</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   787
            </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   788
          </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   789
          <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   790
            <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   791
              Returns the current number of services in the respective object's <a href="#current_authorized_services" class="internalDFN">current authorized services</a>.
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
          </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   794
          <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   795
            <code title="dom-networkservices-servicesavailable">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   796
              <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   797
            </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   798
          </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   799
          <dd>
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
              Returns the current number of services matching one of the app-requested <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens that are actively available within the user's current network.
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
          </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   804
        </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   805
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   806
        <div>
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-networkservices-length"><code>length</code></dfn> attribute <em class="rfc2119" title="must">must</em> return the number of services represented in the object's corresponding <a href="#current_authorized_services" class="internalDFN">current authorized services</a> list at the time of getting.
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
           <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   812
              The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute <em class="rfc2119" title="must">must</em> return the number of services available in the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   813
              user's network that match the <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> that was initially used to create the current <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
   814
           </p>
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
           <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
   817
             When a previously unknown instance of a networked service matching one of the requested <a href="#dfn-valid-service-type">valid service types</a> becomes available on the user's current network, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> increment the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute by <code>1</code> and then
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
   818
             <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</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
   819
             to dispatch a newly created event with the name <code>serviceavailable</code> that uses the <code>Event</code> interface, which does
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
             not bubble, is not cancellable, and has no default action, at the current <a href="#networkservices"><code>NetworkServices</code></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
   821
             object.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   822
           </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   823
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   824
           <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
   825
             When a previously known instance of a networked service matching one of the requested <a href="#dfn-valid-service-type">valid service types</a> becomes unavailable on the user's current network, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute by <code>1</code> and then
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
             <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</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
   827
              to dispatch a newly created event with the name <code>serviceunavailable</code> that uses the <code>Event</code> interface, which does
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
   828
              not bubble, is not cancellable, and has no default action, at the current <a href="#networkservices"><code>NetworkServices</code></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
   829
              object.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   830
           </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   831
        </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   832
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   833
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   834
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   835
      <section id="methods-1">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   836
      <h3><span class="secno">5.2 </span>Methods</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   837
        <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   838
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   839
          <code title="networkservices-getter">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   840
            <a href="#networkservices">services</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   841
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   842
          [
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   843
          <var title="">index</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   844
          ]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   845
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   846
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   847
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   848
            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
   849
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   850
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   851
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   852
          <code title="networkservices-getter">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   853
            <a href="#networkservices">services</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   854
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   855
          .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   856
          <code title="dom-networkservices-getservicebyid">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   857
            <a href="#dom-networkservices-getservicebyid">getServiceById</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   858
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   859
          (
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   860
          <var title="">id</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   861
          )
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   862
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   863
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   864
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   865
            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
   866
            service has that identifier.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   867
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   868
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   869
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   870
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   871
      <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
   872
        A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of zero or more <a href="#current_authorized_services" class="internalDFN">current authorized services</a>, of which zero or more can be available at a time. Each item in <a href="#current_authorized_services" class="internalDFN">current authorized services</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a> object. The list of <a href="#current_authorized_services" class="internalDFN">current authorized services</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
   873
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   874
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   875
      <div class="note"><div class="note-title"><span>Note</span></div><p class="">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   876
        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. If the <a href="#dfn-user-agent" class="internalDFN">user agent</a> dynamically adds or removes network services for any reason, then the indices of the services in <a href="#current_authorized_services" class="internalDFN">current authorized services</a> will change dynamically. If the set of network services changes entirely, then all the previous services will be removed from <a href="#current_authorized_services" class="internalDFN">current authorized services</a> and replaced with new services.
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   877
      </p></div>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   878
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   879
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   880
        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 <a href="#current_authorized_services" class="internalDFN">current authorized services</a> represented by the respective object minus one, if any services are represented in <a href="#current_authorized_services" class="internalDFN">current authorized services</a>. If a <a href="#networkservices"><code>NetworkServices</code></a> object represents no <a href="#current_authorized_services" class="internalDFN">current authorized services</a>, it has no <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices" class="externalDFN">supported property indices</a>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   881
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   882
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   883
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   884
        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 href="#current_authorized_services" class="internalDFN">current authorized services</a>, the user agent <em class="rfc2119" title="must">must</em> return the <a href="#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th service in <a href="#current_authorized_services" class="internalDFN">current authorized services</a>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   885
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   886
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   887
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   888
        The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class="rfc2119" title="must">must</em> return the first <a href="#networkservice"><code>NetworkService</code></a> object in <a href="#current_authorized_services" class="internalDFN">current authorized services</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.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   889
        When no services in <a href="#current_authorized_services" class="internalDFN">current authorized services</a> match the given argument, the method <em class="rfc2119" title="must">must</em> return null.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   890
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   891
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   892
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   893
         Services available within the local network can connect and disconnect at different times during the execution of a web page. A <a href="#dfn-user-agent" class="internalDFN">user agent</a> can
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   894
         inform a web page when the state of networked services matching the requested <a href="#dfn-valid-service-type" class="internalDFN">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
   895
         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
   896
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   897
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   898
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   899
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   900
      <section id="events">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   901
      <h3><span class="secno">5.3 </span>Events</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   902
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   903
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   904
         The following are the event handlers (and their corresponding event handler event types) that must be supported, as IDL attributes, by all objects implementing the <a href="#networkservices"><code>NetworkServices</code></a> interface:
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   905
       </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   906
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   907
       <table border="1">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   908
        <thead>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   909
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   910
            <th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   911
              <span title="event handlers">Event handler</span>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   912
            </th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   913
            <th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   914
              <span>Event handler event type</span>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   915
            </th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   916
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   917
        </thead>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   918
        <tbody>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   919
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   920
            <td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   921
              <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
   922
                <code>onserviceavailable</code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   923
              </dfn>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   924
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   925
            <td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   926
              <code title="event-serviceavailable">serviceavailable</code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   927
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   928
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   929
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   930
            <td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   931
              <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
   932
                <code>onserviceunavailable</code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   933
              </dfn>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   934
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   935
            <td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   936
              <code title="event-serviceunavailable">serviceunavailable</code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   937
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   938
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   939
        </tbody>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   940
      </table>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   941
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   942
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   943
         Events with an event type of <code>serviceavailable</code> or <code>serviceunavailable</code> defined in this specification are simple <code>Event</code> objects.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   944
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   945
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   946
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   947
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   948
    </section>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   949
    <section id="communicating-with-a-networked-service">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   950
    <!--OddPage--><h2><span class="secno">6. </span>Communicating with a networked service</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   951
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   952
<p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   953
   The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection information for an <abbr title="Hypertext Transfer Protocol">HTTP</abbr> service endpoint and if available, service events, running on a networked device.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   954
</p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   955
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   956
<pre class="widl">[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   957
interface <dfn id="networkservice">NetworkService</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   958
  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
   959
  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
   960
  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
   961
  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
   962
  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
   963
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
   964
  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
   965
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   966
  // 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
   967
           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
   968
           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
   969
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
   970
           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
   971
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   972
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   973
<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
   974
</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   975
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
   976
<section id="attributes-1">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   977
  <h3><span class="secno">6.1 </span>Attributes</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   978
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   979
      <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   980
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   981
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   982
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   983
          <code title="dom-networkservice-id">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   984
            <a href="#dom-networkservice-id">id</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   985
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   986
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   987
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   988
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   989
            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
   990
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   991
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   992
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   993
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   994
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   995
          <code title="dom-networkservice-name">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   996
            <a href="#dom-networkservice-name">name</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   997
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   998
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   999
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1000
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1001
            The name of the user-selected service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1002
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1003
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1004
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1005
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1006
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1007
          <code title="dom-networkservice-type">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1008
            <a href="#dom-networkservice-type">type</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1009
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1010
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1011
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1012
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1013
            The <a href="#dfn-valid-service-type" class="internalDFN">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
  1014
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1015
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1016
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1017
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1018
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1019
          <code title="dom-networkservice-url">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1020
            <a href="#dom-networkservice-url">url</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1021
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1022
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1023
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1024
          <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1025
            The control <abbr title="Uniform Resource Locator">URL</abbr> endpoint (including any required port information) of the user-selected control service that has been added to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">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
  1026
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1027
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1028
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1029
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1030
           .
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1031
          <code title="dom-networkservice-config">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1032
            <a href="#dom-networkservice-config">config</a>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1033
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1034
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1035
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1036
          <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1037
            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
  1038
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1039
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1040
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1041
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1042
          <p>
197
383c29793d6b Change 'two services must have the same id' to 'A service...'
Rich Tibbett <richt@opera.com>
parents: 196
diff changeset
  1043
            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="rfc2119" title="must">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
  1044
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1045
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1046
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1047
            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
  1048
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1049
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1050
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1051
             The <dfn id="dom-networkservice-type"><code>type</code></dfn> attribute reflects the value of the <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> of the service.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1052
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1053
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1054
         <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1055
            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 <abbr title="Uniform Resource Locator">URL</abbr></a> pointing to the root <abbr title="Hypertext Transfer Protocol">HTTP</abbr>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1056
            endpoint for the service that has been added to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> 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).
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1057
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1058
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1059
         <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1060
            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
  1061
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1062
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1063
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1064
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1065
      <section id="states">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1066
         <h3><span class="secno">6.2 </span>States</h3>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1067
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1068
      <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1069
        <dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1070
          <var title="">service</var>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1071
           .
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
  1072
          <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
  1073
            <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
  1074
          </code>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1075
        </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1076
        <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1077
          <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
  1078
            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
  1079
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1080
        </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1081
      </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1082
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
  1083
      <p>
196
d7463ce3e901 Clean up the UPnP Update Service Monitor
Rich Tibbett <richt@opera.com>
parents: 194
diff changeset
  1084
        The <dfn id="dom-networkservice-online"><code>online</code></dfn> attribute indicates whether the service is reporting itself as being
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
  1085
        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="rfc2119" title="must">must</em> default to <code>true</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
  1086
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1087
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1088
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1089
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1090
      <section id="events-1">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1091
         <h3><span class="secno">6.3 </span>Events</h3>
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
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1094
         The following are the event handlers (and their corresponding event handler event types) that must be supported, as IDL attributes, by all objects implementing the
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1095
         <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
  1096
       </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1097
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1098
       <table border="1">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1099
        <thead>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1100
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1101
            <th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1102
              <span title="event handlers">Event handler</span>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1103
            </th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1104
            <th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1105
              <span>Event handler event type</span>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1106
            </th>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1107
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1108
        </thead>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1109
        <tbody>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1110
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1111
            <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
  1112
              <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
  1113
                <code>onnotify</code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1114
              </dfn>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1115
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1116
            <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
  1117
              <code title="event-notify">notify</code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1118
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1119
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1120
          <tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1121
            <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
  1122
              <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
  1123
                <code>onserviceonline</code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1124
              </dfn>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1125
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1126
            <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
  1127
              <code title="event-onserviceonline">serviceonline</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
  1128
            </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
  1129
          </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
  1130
          <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
  1131
            <td>
196
d7463ce3e901 Clean up the UPnP Update Service Monitor
Rich Tibbett <richt@opera.com>
parents: 194
diff changeset
  1132
              <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
  1133
                <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
  1134
              </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
  1135
            </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
  1136
            <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
  1137
              <code title="event-onserviceoffline">serviceoffline</code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1138
            </td>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1139
          </tr>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1140
        </tbody>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1141
      </table>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1142
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1143
      <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
  1144
         Events with an event type of <code>notify</code>, <code>serviceonline</code> or <code>serviceoffline</code> defined in this specification are simple <code>Event</code> objects.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1145
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1146
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1147
      </section>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1148
   </section>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1149
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1150
      <section id="service-discovery">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1151
            <!--OddPage--><h2><span class="secno">7. </span>Service Discovery</h2>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1152
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1153
      <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1154
         A <a href="#dfn-user-agent" class="internalDFN">user agent</a> conforming to this specification <em class="rfc2119" title="may">may</em> implement <acronym title="Simple Service Discovery Protocol">SSDP</acronym> [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and Zeroconf [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>] + [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>] service discovery mechanisms
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1155
         to enable Web pages to request and connect with <abbr title="Hypertext Transfer Protocol">HTTP</abbr> services running on networked devices, discovered via either mechanism, through this <abbr title="Application Programming Interface">API</abbr>. When a <a href="#dfn-user-agent" class="internalDFN">user agent</a> implements either of these service discovery mechanisms, then it <em class="rfc2119" title="must">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
  1156
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1157
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1158
         This section presents how the results of these two service discovery
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1159
         mechanisms will be matched to requested service types and how their properties will be applied to any resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1160
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1161
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1162
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1163
         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
  1164
         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
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1165
         invocation of this <abbr title="Application Programming Interface">API</abbr> from a Web page).
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1166
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1167
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1168
      <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1169
         The <dfn id="dfn-list-of-available-service-records">list of available service records</dfn> is a single dynamic internal lookup table within user agents that is used to track the current services available in the network at any given time.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1170
         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
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1171
         services changes. Each record contained within this table contains the attributes: <code>id</code>, <code>name</code>, <code>type</code>, <code>url</code> and <code>config</code>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1172
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1173
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1174
            <section id="zeroconf-mdns-dns-sd">
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1175
         <h3><span class="secno">7.1 </span>Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</h3>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1176
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1177
         <p>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1178
            For each <abbr title="Domain Name System">DNS</abbr> response received from a user-agent-initiated Multicast <abbr title="Domain Name System">DNS</abbr> 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
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1179
   domain [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>], the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> run the following steps:
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1180
         </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1181
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1182
         <ol class="rule">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1183
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1184
            <li>Let <var>service <abbr title="Multicast DNS">mDNS</abbr> responses</var> be an array of <abbr title="DNS Pointer Record">PTR</abbr> records received by issuing a Multicast <abbr title="Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name of the current discovered service type.</li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1185
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1186
            <li>For each Object <var>service <abbr title="Multicast DNS">mDNS</abbr> response</var> in <var>service <abbr title="Multicast DNS">mDNS</abbr> responses</var>, run the following steps:
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1187
               <ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1188
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1189
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1190
                     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>.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1191
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1192
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1193
                  <li>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1194
                     Set <var>network service record</var>'s <code>id</code> property to the value of the full <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1195
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1196
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1197
                  <li>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1198
                     Set <var>network service record</var>'s <code>name</code> property to the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Instance</var> component [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1199
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1200
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1201
                  <li>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1202
                     Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string <code>zeroconf:</code> followed by the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Service</var> component [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1203
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1204
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1205
                  <li>
194
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1206
                     Set <var>network service record</var>'s <code>url</code> property to the resolvable Service <abbr title="Uniform Resource Locator">URL</abbr> obtained from performing an <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> Lookup [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>] of the current service from the <abbr title="DNS Pointer Record">PTR</abbr> record provided [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1207
                  </li>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1208
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1209
                  <li>
ad608906c611 Minor editorial to Networked Service Discovery
Rich Tibbett <richt@opera.com>
parents: 191
diff changeset
  1210
                     Set <var>network service record</var>'s <code>config</code> property to the string value of the contents of the first <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> TXT record associated with the <var>service <abbr title="Multicast DNS">mDNS</abbr> response</var> as defined in [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>].
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1211
                  </li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1212
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
  1213
                  <li>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
R&