<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='../../rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [
<!ENTITY rfc2119 SYSTEM 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY rfc4791 SYSTEM 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4791.xml'>
<!ENTITY rfc5545 SYSTEM 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5545.xml'>
<!ENTITY rfc5546 SYSTEM 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5546.xml'>
<!ENTITY rfc6638 SYSTEM 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6638.xml'>
<!ENTITY rfc7809 SYSTEM 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7809.xml'>
]>
<?rfc toc="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc tocdepth="2"?>
<?rfc strict="yes"?>
<rfc category="std"
     ipr='trust200902' docName='draft-ietf-calext-availability-03'>
  <front>
    <title abbrev="Calendar Availability">Calendar Availability</title>
    <author initials="C." surname="Daboo" fullname="Cyrus Daboo">
      <organization abbrev="Apple">Apple Inc.</organization>
      <address>
        <postal>
          <street>1 Infinite Loop</street>
          <city>Cupertino</city>
          <region>CA</region>
          <code>95014</code>
          <country>USA</country>
        </postal>
        <email>cyrus@daboo.name</email>
        <uri>http://www.apple.com/</uri>
      </address>
    </author>
	<author initials="M." surname="Douglass" fullname="Michael Douglass">
			<organization abbrev="Spherical Cow Group">Spherical Cow Group</organization>
			<address>
				<postal>
					<street>226 3rd Street</street>
					<city>Troy</city>
					<region>NY</region>
					<code>12180</code>
					<country>USA</country>
				</postal>
				<email>mdouglass@sphericalcowgroup.com</email>
				<uri>http://sphericalcowgroup.com</uri>
			</address>
		</author>
    <date />
    <area>Applications</area>
    <keyword>availability</keyword>
    <keyword>calendaring</keyword>
    <keyword>free-busy</keyword>
    <keyword>iCalendar</keyword>
    <keyword>CalDAV</keyword>
    <abstract>
      <t>
        This document specifies a new iCalendar calendar component that allows
        the publication of available and unavailable time periods
        associated with a calendar user. This component can be used in
        standard iCalendar free-busy lookups, including iTIP free-busy
        requests, to generate repeating blocks of available or busy time
        with exceptions as needed.
      </t>

      <t>
        This document also defines extensions to CalDAV calendar-access and
        calendar-auto-schedule which specify how this new calendar
        component can be used when doing free-busy time evaluation in
        CalDAV.
      </t>
    </abstract>

    <note
      title='Editorial Note (To be removed by RFC Editor before publication)'
    >
      <t>
        Discussion of this specification is taking place on the mailing
        list
        <eref
          target="http://lists.osafoundation.org/mailman/listinfo/ietf-caldav"
        > http://lists.osafoundation.org/mailman/listinfo/ietf-caldav</eref>
        .
      </t>
    </note>

  </front>
  <middle>
    <section title='Introduction'>
      <t>
        Calendar users often have regular periods of time when they are either
        available to be scheduled or always unavailable. For example, an
        office worker will often wish only to appear free to their work
        colleagues during normal 'office hours' (e.g., Monday through
        Friday, 9 am through 5 pm). Or, a university professor might only
        be available to students during a set period of time (e.g.,
        Thursday afternoons, 2 pm through 5 pm during term time only).
        Ideally users ought be able to specify such periods directly
        via their calendar user agent, and have them automatically
        considered as part of the normal free-busy lookup for that user.
        In addition, it ought be possible to present different periods
        of available time depending on which user is making the request.
      </t>
      <t>
        <xref target='RFC5545'>iCalendar</xref>
        defines a "VFREEBUSY" component that can be used to represent
        fixed busy time periods, but it does not provide a way to
        specify a repeating period of available or unavailable time.
        Since repeating patterns are often the case, "VFREEBUSY"
        components are not sufficient to solve this problem.
      </t>
      <t>
        This specification defines a new type of iCalendar component
        that can be used to publish user availability.
      </t>
      <t>
        <xref target='RFC4791'>CalDAV</xref>
        provides a way for calendar users to access and manage calendar
        data and exchange this data via scheduling operations. As part
        of this, the
        <xref target='RFC4791'>CalDAV calendar-access</xref>
        feature provides a CALDAV:free-busy-query REPORT that returns
        free-busy information for a calendar collection or hierarchy of
        calendar collections. Also, the
        <xref target='RFC6638'>CalDAV calendar-auto-schedule</xref>
        feature allows free-busy information for a calendar user to be
        determined. Both of these operations involve examining user
        calendars for events that 'block time', with the blocked out
        periods being returned in a "VFREEBUSY" component.
      </t>
      <t>
        This specification extends the CalDAV calendar-access and CalDAV
        calendar-auto-schedule features to allow the new iCalendar
        availability components to be stored and manipulated, and to
        allow free-busy lookups to use the information from any such
        components, if present.
      </t>
    </section>
    <section title='Conventions Used in This Document'>
      <t>
        The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
        NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
        "MAY", and "OPTIONAL" in this document are to be interpreted as
        described in <xref target='RFC2119' />.
      </t>
      <t>
        When XML element types in the namespaces "DAV:" and
        "urn:ietf:params:xml:ns:caldav" are referenced in this document
        outside of the context of an XML fragment, the string "DAV:" and
        "CALDAV:" will be prefixed to the element type names
        respectively.
      </t>
    </section>
    <section title="iCalendar Extensions">
      <t>
        This specification adds a new "VAVAILABILITY" calendar component to
        iCalendar. The "VAVAILABILITY" component is itself a container
        for new "AVAILABLE" sub-components.
      </t>
      <t>
        The purpose of the "VAVAILABILITY" calendar component is to provide a
        grouping of available time information over a specific range of
        time. Within that, there are specific time ranges that are marked
        as available via a set of "AVAILABLE" calendar sub-components.
        Together these can be used to specify available time that can
        repeat over set periods of time, and which can vary over time.
      </t>
      <t>
        An illustration of how "VAVAILABILITY" and "AVAILABLE" components work is shown below.
        <figure><artwork><![CDATA[
                      Time-range
<=========================================================>

   +-------------------------------------------------+
   |              VAVAILABILITY                      |
   +-------------------------------------------------+
      +------------+       +------------+
      | AVAILABLE  |       | AVAILABLE  |
      +------------+       +------------+

   <->              <----->              <-----------> Busy Time
]]></artwork></figure>
        The overall time-range is shown at the top. A "VAVAILABILITY" component spans part of the range. The time-range covered by the "VAVAILABILITY" component is considered to be busy, except for the ranges covered by the "AVAILABLE" components within the "VAVAILABILITY" component.
      </t>
      <section title="VAVAILABILITY Component" anchor="vavailability_component">
        <t>
          <list style="hanging">
            <t hangText="Component Name:">
              VAVAILABILITY
            </t>
            <t hangText="Purpose:">
              Provide a grouping of component properties and sub-components
              that describe the availability associated with a calendar user.
            </t>
            <t hangText="Format Definition:">
              A "VAVAILABILITY" calendar component is defined by the
              following notation:
              <figure><artwork name="abnf">
availabilityc  = "BEGIN" ":" "VAVAILABILITY" CRLF
                availabilityprop *availablec
                "END" ":" "VAVAILABILITY" CRLF

availabilityprop  = *(
                 ;
                 ; the following are REQUIRED,
                 ; but MUST NOT occur more than once
                 ;
                 dtstamp / uid
                 ;
                 ; the following are OPTIONAL,
                 ; but MUST NOT occur more than once
                 ;
                 busytype / class / created / description /
                 dtstart / last-mod / location / organizer /
                 priority /seq / summary / url /
                 ;
                 ; Either 'dtend' or 'duration' MAY appear
                 ; in an 'availableprop', but 'dtend' and
                 ; 'duration' MUST NOT occur in the same
                 ; 'availabilityprop'.
                 ; 'duration' MUST NOT be present if 
                 ; 'dtstart' is not present
                 ;
                 dtend / duration /
                 ;
                 ; the following are OPTIONAL,
                 ; and MAY occur more than once
                 ;
                 categories / comment / contact /
                 x-prop / iana-prop
                 ;
                 )

availablec  = "BEGIN" ":" "AVAILABLE" CRLF
             availableprop
             "END" ":" "AVAILABLE" CRLF

availableprop  = *(
              ;
              ; the following are REQUIRED,
              ; but MUST NOT occur more than once
              ;
              dtstamp / dtstart / uid /
              ;
              ; Either 'dtend' or 'duration' MAY appear in
              ; an 'availableprop', but 'dtend' and
              ; 'duration' MUST NOT occur in the same
              ; 'availableprop'.
              ;
              dtend / duration /
              ;
              ; the following are OPTIONAL,
              ; but MUST NOT occur more than once
              ;
              created / description / last-mod /
              location / recurid / rrule / summary /
              ;
              ; the following are OPTIONAL,
              ; and MAY occur more than once
              ;
              categories / comment / contact / exdate /
              rdate / x-prop / iana-prop
              ;
              )
</artwork></figure>
            </t>
            <t hangText="Description:">
              A "VAVAILABILITY" component indicates a period
              of time within which availability information is provided.
              A "VAVAILABILITY" component can specify a start time and
              an end time or duration. If "DTSTART" is not present, then
              the start time is unbounded. If "DTEND" or "DURATION" are
              not present, then the end time is unbounded. Within the
              specified time period, availability defaults to a
              free-busy type of "BUSY-UNAVAILABLE" (see <xref target="BUSYTYPE"/>), except for any time
              periods corresponding to "AVAILABLE" sub-components.
            </t>
            <t>
              "AVAILABLE" sub-components are used to indicate periods
              of free time within the time range of the enclosing
              "VAVAILABILITY" component. "AVAILABLE" sub-components MAY
              include recurrence properties to specify recurring periods
              of time, which can be overridden using normal iCalendar recurrence
              behavior (i.e., use of the "RECURRENCE-ID" property).
            </t>
            <t>
              If specified, the "DTSTART" and "DTEND" properties in
              "VAVAILABILITY" components and "AVAILABLE" sub-components
              MUST be "DATE-TIME" values specified as either date with
              UTC time or date with local time and a time zone
              reference.
            </t>
            <t>
              The iCalendar object containing the "VAVAILABILITY" component MUST contain appropriate "VTIMEZONE" components corresponding to each unique "TZID" parameter value used in any DATE-TIME properties in all components, unless <xref target="RFC7809"/> is in effect.
            </t>
            <t>
              When used to publish available time, the "ORGANIZER"
              property specifies the calendar user associated with the
              published available time.
            </t>
            <t>
              If the "PRIORITY" property is specified in "VAVAILABILITY"
              components, it is used to determine how that component is combined
              with other "VAVAILABILITY" components. See
              <xref target='combinations' />.
            </t>
            <t>
              Other calendar properties MAY be specified in "VAVAILABILITY" or "AVAILABLE" components and are considered attributes of the marked block of time. Their usage is application specific. For example, the "LOCATION" property might be used to indicate that a person is available in one location for part of the week and a different location for another part of the week (but see <xref target="privacy"/> for when it is appropriate to add additional data like this).
            </t>
            <t hangText="Example:">
              The following is an example of a "VAVAILABILITY" calendar
              component used to represent the availability of a user,
              always available Monday through Friday, 9:00 AM to 5:00 PM
              in the America/Montreal time zone:
              <figure><artwork>
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:vavail-1@example.com
DTSTAMP:20111005T133225Z
BEGIN:AVAILABLE
UID:avail-1-A@example.com
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
END:AVAILABLE
END:VAVAILABILITY
</artwork></figure>
              The following is an example of a "VAVAILABILITY" calendar
              component used to represent the availability of a user
              available Monday through Thursday, 9:00 AM to 5:00 PM at
              the main office, and
              Friday 9:00 AM to 12:00 PM in the branch office in the
              America/Montreal time
              zone between October 2nd and December 2nd 2011:
              <figure><artwork>
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:vavail-1@example.com
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
DTEND;TZID=America/Montreal:20111202T000000
BEGIN:AVAILABLE
UID:avail-1-A@example.com
SUMMARY:Monday to Thursday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH
LOCATION:Main Office
END:AVAILABLE
BEGIN:AVAILABLE
UID:avail-1-B@example.com
SUMMARY:Friday from 9:00 to 12:00
DTSTART;TZID=America/Montreal:20111006T090000
DTEND;TZID=America/Montreal:20111006T120000
RRULE:FREQ=WEEKLY
LOCATION:Branch Office
END:AVAILABLE
END:VAVAILABILITY
</artwork></figure>
              The following is an example of three "VAVAILABILITY"
              calendar components used to represent the availability of
              a traveling worker: Monday through Friday, 9:00 AM to 5:00
              PM each day. However, for three weeks the calendar user is
              working in Montreal, then one week in Los Angeles, then
              back to Montreal. Note that each overall period is covered
              by separate "VAVAILABILITY" components. The last of these
              has no DTEND so continues on "for ever". This example
              shows one way "blocks" of available time can be represented.
              See <xref target='combinations' /> for another approach using
              priorities.
              <figure><artwork>
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:vavail-1@example.com
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
DTEND;TZID=America/Montreal:20111023T030000
BEGIN:AVAILABLE
UID:avail-1-A@example.com
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Montreal
END:AVAILABLE
END:VAVAILABILITY
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:vavail-2@example.com
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Los_Angeles:20111023T000000
DTEND;TZID=America/Los_Angeles:20111030T000000
BEGIN:AVAILABLE
UID:avail-2-A@example.com
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Los_Angeles:20111023T090000
DTEND;TZID=America/Los_Angeles:20111023T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Los Angeles
END:AVAILABLE
END:VAVAILABILITY
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:vavail-3@example.com
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111030T030000
BEGIN:AVAILABLE
UID:avail-3-A@example.com
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111030T090000
DTEND;TZID=America/Montreal:20111030T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Montreal
END:AVAILABLE
END:VAVAILABILITY
</artwork></figure>
            </t>
          </list>
        </t>
      </section>
      <section title="Busy Time Type" anchor="BUSYTYPE">
        <t>
          <list style="hanging">
            <t hangText="Property Name:">
              BUSYTYPE
            </t>
            <t hangText="Purpose:">
              This property specifies the default busy time
              type.
            </t>
            <t hangText="Value Type:">
              TEXT
            </t>
            <t hangText="Property Parameters:">
              IANA and non-standard property parameters can be specified on this
              property.
            </t>
            <t hangText="Conformance:">
              This property can be specified within "VAVAILABILITY" calendar
              components.
            </t>
            <t hangText="Format Definition:">
              This property is defined by the following notation:
              <figure><artwork name="abnf">
busytype      = "BUSYTYPE" busytypeparam ":" busytypevalue CRLF

busytypeparam = *(";" other-param)

busytypevalue = "BUSY" / "BUSY-UNAVAILABLE" /
                "BUSY-TENTATIVE" / iana-token / x-name
               ; Default is "BUSY-UNAVAILABLE".
</artwork></figure>
            </t>
            <t hangText="Description:">
              This property is used to specify the default
              busy time type. The values correspond to those used by the
              "FBTYPE" parameter used on a "FREEBUSY" property, with the
              exception that the "FREE" value is not used in this
              property. If not specified on a component that allows this
              property, the default is "BUSY-UNAVAILABLE".
            </t>
            <t hangText="Example:">
              The following is an example of this property:
              <figure><artwork>
BUSYTYPE:BUSY
</artwork></figure>
            </t>
          </list>
        </t>
      </section>
    </section>

    <section title="Combining VAVAILABILITY components" anchor="combinations">
      <t>
        The "VAVAILABILITY" component allows a calendar user to describe their
        availability over extended periods of time through the use of recurrence
        patterns. This availability might be relatively constant from year to year.
      </t>

      <t>
        However, there is usually some degree of irregularity, as people take
        vacations or perhaps spend a few weeks at a different office. For that
        period of time there is a need to redefine their availability.
      </t>

      <t>
        Rather than modify their existing availability, the "PRIORITY" property
        allows new "VAVAILABILITY" components to override others
        of lower ordinal priority. Note that <xref target='RFC5545'>iCalendar</xref>
        defines the "PRIORITY" property such that a value of 0 is undefined,
        1 is the highest priority and 9 is the lowest.
      </t>

      <t>
        When combining "VAVAILABILITY" components, an absence of a "PRIORITY"
        property or a value of 0 implies the lowest level of priority.
        When two or more VAVAILABILITY components overlap, and they have the
        same PRIORITY value, the overlapping busy time type is determined by
        the following order: BUSY > BUSY-UNAVAILABLE > BUSY-TENTATIVE. i.e., if
        one component has a BUSYTYPE set to BUSY, and the another has BUSYTYPE
        set to BUSY-UNAVAILABLE, then the effective busy time type over the
        time range that they overlap would be BUSY.  It is up to the creator of
        such components to ensure that combining them produces a consistent and
        expected result.
      </t>

      <t>
        To calculate the available time, order the intersecting "VAVAILABILITY"
        components by priority (i.e., lowest to highest "PRIORITY" values are 0, 9, 8, 7, 6, 5, 4, 3, 2, 1).
      </t>

      <t>
        Step through the resulting list of "VAVAILABILITY" components. For each, the
        time range covered by the "VAVAILABILITY" component is set to busy and
        then portions of it defined by the "AVAILABLE" components in
        the "VAVAILABILITY" component are set to free.
      </t>

      <t>
        Note that, if any "VAVAILABILITY" component completely covers the date
        range of interest, then any lower priority "VAVAILABILITY" components
        can be ignored.
      </t>
      <t>
        Typically, a calendar user's "default" availability (e.g., business hours of Monday through Friday, 9:00 am to 5:00 pm) would use the lowest level of priority: zero. Any overrides to the "default" would use higher levels as needed. To avoid having to keep readjusting the "PRIORITY" property value when an override has to be "inserted" between two existing components, priority values SHOULD be "spaced out" over the full range of values. e.g., the "default" availability is created with priority zero, then the first override created with priority 5, a subsequent availability can be inserted between the two by using priority 7, and another, taking precedence over all existing ones, with priority 3.
      </t>
    </section>

    <section title="Calculating Free-Busy Time" anchor="Calculating">
      <t>
        This section describes how free-busy time information for a
        calendar user is calculated in the presence of "VAVAILABILITY"
        calendar components.
      </t>
      <t>
        An iCalendar "VFREEBUSY" component is used to convey "rolled-up"
        free-busy time information for a calendar user. This can be
        generated as the result of an
        <xref target="RFC5546">iTIP free-busy</xref>
        request or through some other mechanism (e.g., a CalDAV
        calendar-access CALDAV:free-busy-query REPORT).
      </t>
      <t>
        When one or more "VAVAILABILITY" components are present and intersect the
        time-range for the free-busy request, first available time is calculated,
        as outlined in <xref target='combinations' />. Once that is done,
        regular "VEVENT" and "VFREEBUSY" components can be "overlaid" in the
        usual way to block out time.
      </t>
      <t>
        An example procedure for this is as follows:
        <list style="numbers">
          <t>
            Initially mark the entire period of the free-busy request
            as free.
          </t>
          <t>
            For each "VAVAILABILITY" component ordered by PRIORITY (lowest to highest):
            <list style="numbers">
              <t>
                Determine if the "VAVAILABILITY" intersects the time-range of the
                free-busy request. If not ignore it.
              </t>
              <t>
                Determine if the "VAVAILABILITY" is completely overridden by
                a higher priority component. If so ignore it.
              </t>
              <t>
                For the time period covered by the "VAVAILABILITY" component, mark
                time in the free-busy request result set as busy, using
                the busy time type derived from the "BUSYTYPE" property
                in the "VAVAILABILITY" component.
              </t>
              <t>
                Append the "VAVAILABILITY" component to a list of components for further processing in step 3, if it has not been ignored.
              </t>
            </list>
          </t>
          <t>
            For each "VAVAILABILITY" component in the list resulting from step 2, in order from the first item to the last item:
            <list style="numbers">
              <t>
                For each "AVAILABLE" component in the "VAVAILABILITY"
                component:
                <list style="numbers">
                  <t>
                    Expand all recurring instances, taking into account overridden
                    instances, ignoring instances or parts of instances that fall
                    outside of the free-busy request time-range or the time period
                    specified by the "VAVAILABILITY" component.
                  </t>
                  <t>
                    For each instance, mark the corresponding time in the free-busy
                    request result set as free.
                  </t>
                </list>
              </t>
            </list>
          </t>
          <t>
            For each "VEVENT" or "VFREEBUSY" component apply normal
            free-busy processing within the free-busy request
            time-range.
          </t>
        </list>
      </t>
      <section title="Examples">
        <t>
          In the examples below a table is used to represent time slots
          for the period of a free-busy request. Each time slot is two
          hours long. The column header represents the hours from
          midnight local time. Each row below the column headers
          represents a step in the free-busy result set determination,
          following the procedure outlined above.
        </t>
        <t>
          Each cell in the rows below the column header contains a
          single character that represents the free-busy type for the
          corresponding time period at the end of the process step
          represented by the row. The characters in the row are:
        </t>
        <texttable>
          <ttcol>Character</ttcol>
          <ttcol>Meaning</ttcol>
          <c>F</c>
          <c>Represents "FREE" time in that slot.</c>
          <c>B</c>
          <c>Represents "BUSY" time in that slot.</c>
          <c>U</c>
          <c>Represents "BUSY-UNAVAILABLE" time in that slot.</c>
          <c>T</c>
          <c>Represents "BUSY-TENTATIVE" time in that slot.</c>
        </texttable>
        <section title="Simple Example">
          <t>
            A free-busy request for Monday, 6th November 2011, midnight to
            midnight in the America/Montreal timezone.
          </t>
          <t>
            The user's calendar is as shown in <xref target="Example1" />.
            This includes one "VAVAILABILITY" component giving
            available time within the requested time-range of 8:00 AM to
            6:00 PM, together with one "VEVENT" component representing a
            two hour meeting starting at 12:00 PM.
          </t>
          <texttable>
            <ttcol>Step</ttcol>
            <ttcol>&nbsp;0
            </ttcol>
            <ttcol>&nbsp;2
            </ttcol>
            <ttcol>&nbsp;4
            </ttcol>
            <ttcol>&nbsp;6
            </ttcol>
            <ttcol>&nbsp;8
            </ttcol>
            <ttcol>10</ttcol>
            <ttcol>12</ttcol>
            <ttcol>14</ttcol>
            <ttcol>16</ttcol>
            <ttcol>18</ttcol>
            <ttcol>20</ttcol>
            <ttcol>22</ttcol>
            <c>1.</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>2.</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>3.</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>F</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>4.</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
            <c>F</c>
            <c>F</c>
            <c>B</c>
            <c>F</c>
            <c>F</c>
            <c>U</c>
            <c>U</c>
            <c>U</c>
          </texttable>
        </section>
        <section title="Further Example">
          <t>
            The following is another way to represent the availability of the traveling worker shown above. Here we represent their base availability of Monday through Friday, 9:00 AM to 5:00 PM each day with a "VAVAILABILITY" with default "PRIORITY" (there is no "DTEND" property so that this availability is unbounded). For the three weeks the calendar user is working in Los Angeles, we represent their availability with a "VAVAILABILITY" component with priority 1, which overrides the base availability.
            <figure><artwork>
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:vavail-1@example.com
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
BEGIN:AVAILABLE
UID:avail-1-A@example.com
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Montreal
END:AVAILABLE
END:VAVAILABILITY
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:vavail-2@example.com
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Los_Angeles:20111023T000000
DTEND;TZID=America/Los_Angeles:20111030T000000
PRIORITY:1
BEGIN:AVAILABLE
UID:avail-2-A@example.com
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Los_Angeles:20111023T090000
DTEND;TZID=America/Los_Angeles:20111023T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Los Angeles
END:AVAILABLE
END:VAVAILABILITY
</artwork></figure>

          </t>
        </section>

      </section>
    </section>

    <section title="Use with iTIP">
      <t>This specification does not define how "VAVAILABILITY" components are used in scheduling messages sent using the <xref target="RFC5546">iTIP</xref> protocol. It is expected that future specifications will define how iTIP scheduling can make use of "VAVAILABILITY" components.</t>
    </section>

    <section title="CalDAV Extensions">
      <section title="CalDAV Requirements Overview" anchor="requirements">
        <t>
          This section lists what functionality is required of a CalDAV server which supports "VAVAILABILITY" components in stored calendar data. A server:
          <list style="symbols">
            <t>
              MUST advertise support for "VAVAILABILITY" components in
              CALDAV:supported-calendar-component-set properties on
              calendars which allow storing of such components;
            </t>
            <t>
              MUST support CALDAV:free-busy-query REPORTs that aggregate the
              information in any "VAVAILABILITY" components in the
              calendar collections targeted by the request;
            </t>
            <t>
              MUST support "VAVAILABILITY" components stored in a
              CALDAV:calendar-availability WebDAV property on a CalDAV
              scheduling inbox collection, if the CalDAV
              calendar-auto-schedule feature is supported;
            </t>
            <t>
              MUST support
              <xref target='RFC5546'>iTIP</xref>
              free-busy requests that aggregate the information in any
              "VAVAILABILITY" components in calendar collections that
              contribute to free-busy, or in any "VAVAILABILITY"
              components stored in the CALDAV:calendar-availability property on
              the CalDAV scheduling inbox collection of the calendar
              user targeted by the iTIP free-busy request, if the CalDAV
              calendar-auto-schedule feature is available.
            </t>
          </list>
        </t>
        <t>
          "VAVAILABILITY" components are treated in a manner similar to "VEVENT" and "VTODO" components, and MUST satisfy the other requirements CalDAV imposes on calendar object resources (see Section 4.1 of <xref target='RFC4791'/>).
        </t>
      </section>
      <section title='New features in CalDAV' anchor='changes'>
        <section title="Calendar Availability Support">
          <t>
            A server supporting the features described in this document MUST
            include "calendar-availability" as a field in the DAV
            response header from an OPTIONS request. A value of "calendar-availability" in the DAV
            response header MUST indicate that the server supports all
            MUST level requirements specified in this document.
          </t>
          <section
            title="Example: Using OPTIONS for the Discovery of Calendar Availability Support"
          >
            <figure>
              <preamble>&gt;&gt; Request &lt;&lt;</preamble>
<artwork><![CDATA[
OPTIONS /home/bernard/calendars/ HTTP/1.1
Host: cal.example.com
]]></artwork></figure>
            <figure>
              <preamble>&gt;&gt; Response &lt;&lt;</preamble>
<artwork><![CDATA[
HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
Allow: PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL
DAV: 1, 2, 3, access-control, calendar-access,
 calendar-availability
Date: Fri, 11 Nov 2005 09:32:12 GMT
Content-Length: 0
]]></artwork></figure>
            <t>
              In this example, the OPTIONS method returns the value
              "calendar-availability" in the DAV response header to
              indicate that the collection "/home/bernard/calendars/"
              supports the new features defined in this specification.
            </t>
          </section>
        </section>
        <section title='CalDAV Time Range Queries' anchor='time-range'>
          <t>Section 9.9 of <xref target='RFC4791'/> describes how to specify time ranges to limit the set of calendar components returned by the server.  This specification extends <xref target='RFC4791'/> to describe how to apply time range filtering to "VAVAILABILITY" components.</t>

          <t>A "VAVAILABILITY" component is said to overlap a given time range if the condition for the corresponding component state specified in the table below is satisfied.  The conditions depend on the presence of the "DTSTART", "DTEND", and "DURATION" properties in the "VAVAILABILITY" component.  Note that, as specified above, the "DTEND" value MUST be a "DATE-TIME" value equal to or after the "DTSTART" value, if specified.</t>

          <figure>
<artwork><![CDATA[
    +------------------------------------------------------------+
    | VAVAILABILITY has the DTSTART property?                    |
    |   +--------------------------------------------------------+
    |   | VAVAILABILITY has the DTEND property?                  |
    |   |   +----------------------------------------------------+
    |   |   | VAVAILABILITY has the DURATION property?           |
    |   |   |   +------------------------------------------------+
    |   |   |   | Condition to evaluate                          |
    +---+---+---+------------------------------------------------+
    | Y | Y | N | (start < DTEND  AND  end > DTSTART)            |
    +---+---+---+------------------------------------------------+
    | Y | N | Y | (start < DTSTART+DURATION  AND  end > DTSTART) |
    +---+---+---+------------------------------------------------+
    | Y | N | N | (end > DTSTART)                                |
    +---+---+---+------------------------------------------------+
    | N | Y | N | (start < DTEND)                                |
    +---+---+---+------------------------------------------------+
    | N | N | * | TRUE                                           |
    +---+---+---+------------------------------------------------+
]]></artwork></figure>
        </section>
        <section title='CALDAV:free-busy-query REPORT' anchor='free-busy-query'>
          <t>
            A CALDAV:free-busy-query REPORT can be executed on a
            calendar collection that contains iCalendar "VAVAILABILITY"
            components. When that occurs, the server MUST aggregate the
            information in any "VAVAILABILITY" components when
            generating the free-busy response, as described in
            <xref target="Calculating" />.
          </t>
        </section>
        <section anchor="PROPERTY_calendar-availability" title="CALDAV:calendar-availability Property">
          <t>
<?rfc compact="no" ?>
            <list style="hanging">
              <t hangText="Name:">
                calendar-availability
              </t>
              <t hangText="Namespace:">
                urn:ietf:params:xml:ns:caldav
              </t>
              <t hangText="Purpose:">
                Defines a "VAVAILABILITY" component that
                will be used in calculating free-busy time when an iTIP
                free-busy request is targeted at the calendar user who
                owns the Inbox.
              </t>
              <t hangText="Conformance:">
                This property MAY be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request. Support for this property is REQUIRED. The value of this property MUST be a valid iCalendar object containing a "VAVAILABILITY" component. "VTIMEZONE" components SHOULD NOT be present if <xref target="RFC7809"/> is in effect. For simplicity, only a single "VAVAILABILITY" component MUST be present in the property. For more complex availability scenarios, clients can store multiple "VAVAILABILITY" components in the calendar user's calendar collections.
              </t>
              <t hangText="Description:">
                This property allows a user to specify their
                availability by including an "VAVAILABILITY" component in
                the value of this property. If present, the server MUST
                use this "VAVAILABILITY" component when determining
                free-busy information as part of an iTIP free-busy
                request being handled by the server.
              </t>
              <t hangText="Definition:">
                <figure>
                  <artwork><![CDATA[
<!ELEMENT calendar-availability (#PCDATA) >
; Data value MUST be iCalendar object containing
; "VAVAILABILITY" or "VTIMEZONE" components.
]]></artwork></figure>
              </t>
              <t hangText="Example:">
                <figure><artwork><![CDATA[
<C:calendar-availability xmlns:D="DAV:"
xmlns:C="urn:ietf:params:xml:ns:caldav"
>BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//example.com//iCalendar 2.0//EN
VERSION:2.0
BEGIN:VAVAILABILITY
UID:vavail-1@example.com
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
BEGIN:AVAILABLE
UID:avail-1-A@example.com
SUMMARY:Monday to Friday from 9:00 to 18:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T180000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
END:AVAILABLE
END:VAVAILABILITY
END:VCALENDAR
</C:calendar-availability>
]]></artwork></figure>
              </t>
            </list>
<?rfc compact="yes" ?>
          </t>
        </section>
        <section title='iTIP free-busy requests' anchor='itip-request'>
          <t>
            The <xref target='RFC6638' />
            processing of an iTIP free-busy request targeted at the
            owner of the CALDAV:schedule-inbox will include free-busy
            information derived from "VAVAILABILITY" components in any
            calendar collection targeted during the request, as
            described in
            <xref target="Calculating" />.
            In addition, the "VAVAILABILITY" component specified in
            the CALDAV:calendar-availability property on the owner's
            Inbox, MUST be included in the free-busy calculation.
          </t>
        </section>
      </section>
    </section>
    <section title='Security Considerations'>
      <t>
        Calculation of availability information, particularly with multiple overlapping time-ranges, can be complex, and CalDAV servers MAY limit the complexity of such data stored by a client.
      </t>
      <t>
        An attacker able to "inject" availability information into a calendar user's calendar data could ensure that the user never appears free for meetings, or appears free at inappropriate times. Calendar systems MUST ensure that availability information for a calendar user can only be modified by authorized users.
      </t>
      <t>
        Security considerations in <xref target="RFC5545" />, <xref target="RFC5546" />, <xref target='RFC4791' />, <xref target='RFC6638' />, and <xref target='RFC7809' /> MUST also be adhered to.
      </t>
    </section>
    <section title='Privacy Considerations' anchor='privacy'>
      <t>
        Free-busy and availability information can be used by attackers to infer the whereabouts or overall level of "activity" of the corresponding calendar user. Any calendar system that allows a user to expose their free-busy and availability information MUST limit access to that information to only authorized users.
      </t>
      <t>
        When "VAVAILABILITY" components are sent to or shared with other calendar users, care has to be taken to not expose more information than is needed by each recipient. In particular, user specified property values such as "SUMMARY", "LOCATION" and "DESCRIPTION" properties might need to be removed from the "VAVAILABILITY" components exposed to other calendar users. For example, family members might be willing to expose their location to each other, but a business owner will likely not want to do that with their customers.
      </t>
      <t>
        iCalendar "VFREEBUSY" information generated from "VAVAILABILITY" components MUST NOT include information other than busy or free time periods. In particular, user specified property values such as "SUMMARY", "LOCATION" and "DESCRIPTION" MUST NOT be copied into the free-busy result data.
      </t>
      <t>
        Privacy considerations in <xref target="RFC5545" />, <xref target="RFC5546" />, <xref target='RFC4791' />, <xref target='RFC6638' />, and <xref target='RFC7809' /> MUST also be adhered to.
      </t>
    </section>
    <section title='IANA Considerations'>
      <section title='Component Registrations'>
        <t>
          This documents defines the following new iCalendar components
          to be added to the registry defined in Section 8.3.1 of
          <xref target="RFC5545" />:
        </t>
        <texttable>
          <ttcol>Component</ttcol>
          <ttcol>Status</ttcol>
          <ttcol>Reference</ttcol>
          <c>VAVAILABILITY</c>
          <c>Current</c>
          <c>
            RFCXXXX, <xref target='vavailability_component' />
          </c>
          <c>AVAILABLE</c>
          <c>Current</c>
          <c>
            RFCXXXX, <xref target='vavailability_component' />
          </c>
        </texttable>
      </section>
      <section title='Property Registrations'>
        <t>
          This documents defines the following new iCalendar properties
          to be added to the registry defined in Section 8.3.2 of
          <xref target="RFC5545" />:
        </t>
        <texttable>
          <ttcol>Property</ttcol>
          <ttcol>Status</ttcol>
          <ttcol>Reference</ttcol>
          <c>BUSYTYPE</c>
          <c>Current</c>
          <c>
            RFCXXXX, <xref target='BUSYTYPE' />
          </c>
        </texttable>
      </section>
    </section>
    <section title='Acknowledgments'>
      <t>
        Thanks to the following for providing feedback:
        Toby Considine
        Bernard Desruisseaux,
        Alexey Melnikov,
        Daniel Migault,
        Ken Murchison,
        Evert Pot,
        Dave Thewlis.
        This specification came about via discussions at the
        Calendaring and Scheduling Consortium.
      </t>
    </section>

  </middle>
  <back>
    <references title='Normative References'>
    &rfc2119;
    &rfc4791;
    &rfc5545;
    &rfc5546;
    &rfc6638;
    &rfc7809;
    </references>
    <!-- <references title='Informative References'> </references> -->
    <section title='Example Calendar #1' anchor="Example1">
      <t>
        <figure>
          <preamble>iCalendar object</preamble>
          <artwork><![CDATA[
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//example.com//iCalendar 2.0//EN
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:20111113T044111Z
DTSTART;TZID=America/Montreal:20111106T120000
DURATION:PT1H
SUMMARY:Meeting
UID:60A48841ECB90F3F215FE3D2@example.com
END:VEVENT
BEGIN:VAVAILABILITY
UID:vavail-1@example.com
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
BEGIN:AVAILABLE
UID:avail-1-A@example.com
SUMMARY:Monday to Friday from 8:00 to 18:00
DTSTART;TZID=America/Montreal:20111002T080000
DTEND;TZID=America/Montreal:20111002T180000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
END:AVAILABLE
END:VAVAILABILITY
END:VCALENDAR
]]></artwork></figure>
      </t>
    </section>
    <section
      title="Change History (To be removed by RFC Editor before publication)"
    >
      <t>
        Changes in draft-ietf-calext-availability-03:
        <list style='numbers'>
          <t>[EXPERT] Make 7809 reference more authoritative.</t>
          <t>[EXPERT] Add reference to privacy section when describing use of LOCATION.</t>
          <t>[EXPERT] Added more text to privacy section to cover published or iTIP-messaged VAVAILABILITY components.</t>
          <t>[EXPERT] Clarify highest to lowest priority ordering in free-busy calculation.</t>
          <t>[EXPERT] Fixed PRIORITY in example.</t>
          <t>[EXPERT] Editorial fixes.</t>
          <t>[EXPERT] Clarify that calendar-availability follows the RFC7809 rule wrt VTIMEZONE presence.</t>
          <t>[WGCHAIR] Added text suggesting how best to assign priority values.</t>
          <t>[WGCHAIR] Clarify example procedure step 3 ordering.</t>
          <t>Be more explicit about dependent security and privacy considerations.</t>
        </list>
      </t>
      <t>
        Changes in draft-ietf-calext-availability-02:
        <list style='numbers'>
          <t>[WGLC] Change Appendix A example to start available time at 08:00.</t>
          <t>[WGLC] Added new section with table describing CalDAV time range query behavior.</t>
          <t>Added text and reference to RFC7809.</t>
          <t>Added location to formal syntax of components.</t>
        </list>
      </t>
      <t>
        Changes in draft-ietf-calext-availability-01:
        <list style='numbers'>
          <t>Minor editorial fixes.</t>
          <t>ABNF syntax fixes.</t>
          <t>Clarify BUSTYPE precedence when combining components with the same PRIORITY values.</t>
          <t>Added section explaining that iTIP use is not defined</t>
          <t>Added Privacy Considerations and tweaked Security Considerations.</t>
          <t>Added diagram to illustrate the overall concept.</t>
          <t>Limit the calendar-availability property to a single "VAVAILABILITY" component.</t>
        </list>
      </t>
      <t>
        Changes in draft-ietf-calext-availability-00:
        <list style='numbers'>
          <t>Re-publication as WG document.</t>
        </list>
      </t>
      <t>
        Changes in draft-daboo-calendar-availability-05:
        <list style='numbers'>
          <t>Small typos.</t>
          <t>Fix explanation of priority.</t>
          <t>Change uid values to make legal and easier to follow.</t>
        </list>
      </t>
      <t>
        Changes in draft-daboo-calendar-availability-04:
        <list style='numbers'>
          <t>Small typos.</t>
          <t>Add prioritized example.</t>
        </list>
      </t>
      <t>
        Changes in draft-daboo-calendar-availability-03:
        <list style='numbers'>
          <t>Switch authors.</t>
          <t>CalDAV scheduling is now rfc6638.</t>
          <t>List priority as a vavailability property and define its use.</t>
        </list>
      </t>
      <t>
        Changes in draft-daboo-calendar-availability-02:
        <list style='numbers'>
          <t>Updated to 5545/5546 references.</t>
          <t>Fixed some examples.</t>
          <t>Added some more properties to the components</t>
          <t>Fixed text that said dtstart was required in VAVAILABILITY</t>
        </list>
      </t>
      <t>
        Changes in draft-daboo-calendar-availability-01:
        <list style='numbers'>
          <t>Allow property on Inbox for caldav-schedule.</t>
          <t>Clarify that DURATION can only be present in VAVAILABILITY
            if DTSTART is also present, and DTEND is not.</t>
          <t>Updated references.</t>
          <t>Added templates.</t>
        </list>
      </t>
    </section>
  </back>
</rfc>
