<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2003 Hewlett-Packard Development Company, L.P.
PERMISSION TO COPY AND DISPLAY THIS WSMF PAPER, IN ANY MEDIUM WITHOUT FEE OR ROYALTY, 
IS HEREBY GRANTED PROVIDED THAT YOU INCLUDE THE ABOVE COPYRIGHT NOTICE ON *ALL* COPIES 
OF THIS WSMF SPECIFICATION, OR PORTIONS THEREOF, THAT YOU MAKE.
         
DISCLAIMER OF WARRANTIES. USER ACKNOWLEDGES THAT THE SPECIFICATION MAY HAVE ERRORS OR 
DEFECTS AND IS PROVIDED "AS IS." HEWLETT-PACKARD MAKES NO EXPRESS OR IMPLIED WARRANTIES OF 
ANY KIND WITH RESPECT TO THE SPECIFICATION, AND SPECIFICALLY DISCLAIMS THE IMPLIED WARRANTIES 
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, EVEN IF THAT PURPOSE IS KNOWN TO 
HEWLETT-PACKARD. HP MAKES NO EXPRESS OR IMPLIED WARRANTY THAT THE SPECIFICATION IS NON-INFRINGING, 
AND NO LICENSE, EXPRESS OR IMPLIED, IS PROVIDED TO ANY PATENT OR TRADEMARK RIGHT.

LIMITATION OF LIABILITY. HEWLETT-PACKARD SHALL NOT BE RESPONSIBLE FOR ANY LOSS TO ANY THIRD PARTIES 
CAUSED BY USING THE SPECIFICATION IN ANY MANNER WHATSOEVER. HEWLETT-PACKARD SHALL NOT BE LIABLE FOR 
ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER BASED ON CONTRACT, 
TORT OR ANY OTHER LEGAL THEORY, ARISING OUT OF ANY USE OF THE SPECIFICATION OR ANY PERFORMANCE OF 
HEWLETT-PACKARD RELATED TO THIS SPECIFICATION. USER FURTHER ACKNOWLEDGES THAT THE SPECIFICATION IS 
PROVIDED FOR EVALUATION PURPOSES ONLY, AND USER ASSUMES ALL RISKS ASSOCIATED WITH ITS USE. 
-->
<!-- CVS $Revision: 1.25 $ $Date: 2003/07/30 04:08:23 $ -->
<schema  elementFormDefault="qualified" version="2.0"
  targetNamespace="http://devresource.hp.com/drc/specifications/wsmf/2003/07/events/"
  xmlns:evt="http://devresource.hp.com/drc/specifications/wsmf/2003/07/events/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns="http://www.w3.org/2001/XMLSchema">

  <annotation><documentation>
      This XML Schema document has N sections:
      0 Defines types for generic data (e.g. time)
      1 Defines types for the Event discovery
      2 Defines types for the Notifications syntax
      3 Defines types for Notification exchanges
      4 Defines types for the subscription mechanism
    </documentation></annotation>

  <!-- Generic types -->

  <simpleType name="InfinityType">
    <restriction base="xs:string">
      <enumeration value="infinity"/>
    </restriction>
  </simpleType>

  <simpleType name="DateTimeType">
    <union memberTypes="evt:InfinityType xs:dateTime"/>
  </simpleType>

  <simpleType name="DurationType">
    <union memberTypes="evt:InfinityType xs:duration"/>
  </simpleType>

  <complexType name="FilterType">
    <choice>
      <element name="Filter" type="xs:QName"/>
      <any processContents="lax"/> 
    </choice>
  </complexType>


  <annotation><documentation>
      This is a union type to represent an EventSelectorType. 
      It could be:
      * A single URI to match a single event type
      * A string represting a regular expression to match event types
      * The tokent 'all' to match all the known event types at the
        producer.
    </documentation></annotation>
  <element name="EventSelector" type="evt:EventSelectorType" />
  <simpleType name="EventSelectorType">
    <union memberTypes="xs:anyURI xs:string">
      <simpleType>
        <restriction base="xs:token">
          <enumeration value="all"/>
        </restriction>
      </simpleType>
    </union>
  </simpleType>


  <!-- Events Type Discovery -->
  <element name="EventTypeDefinitionList" type="evt:EventTypeDefinitionListType" />
  <complexType name="EventTypeDefinitionListType">
    <annotation><documentation><evt:doc> 
          An element of type EventTypeDefinitionListType contains zero or
          more child elements of type EventTypeDefinition.
        </evt:doc></documentation></annotation>
    <sequence> 
      <element ref="evt:EventTypeDefinition" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>


  <!-- EventTypeDefinition --> 
  <annotation><documentation><evt:doc> 
	
      </evt:doc></documentation></annotation>
  <element name="EventTypeDefinition" type="evt:EventTypeDefinitionType" />
  <complexType name="EventTypeDefinitionType">
    <sequence> 
      <element name="EventType" type="xs:anyURI"/>
      <element name="Obsolete" type="xs:anyURI" minOccurs="0"/>
      <element name="SchemaLocation" type="xs:anyURI"/>
      <element name="Description" type="xs:string" minOccurs="0"/>
      <element name="SubscriptionMode">
        <simpleType name="SubscriptionToken">
          <restriction base="token">
            <enumeration value="push"/>
            <enumeration value="pull"/>
            <enumeration value="pushAndPull"/>
            <enumeration value="none"/>
          </restriction>
        </simpleType>
      </element>
      
      <choice minOccurs="0">
        <element name="Aggregates" type="evt:EventTypeListType"/>
        <element name="CausalityExpression" type="xs:string"/>
      </choice>
      <element name="Causes" type="evt:EventTypeListType" minOccurs="0"/>
      
      <any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> 
    </sequence>
    <anyAttribute namespace="##other" processContents="skip"/>
  </complexType>


  <!-- Events Instances Discovery -->
  <element name="EventInstanceInfoList" type="evt:EventInstanceInfoListType" />
  <complexType name="EventInstanceInfoListType">
    <annotation><documentation><evt:doc> 
          An element of type EventInstanceInfoListType contains zero or
          more child elements of type EventInstanceInfo.
        </evt:doc></documentation></annotation>
    <sequence> 
      <element ref="evt:EventInstanceInfo" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>


  <!-- EventInstanceInfo --> 
  <annotation><documentation><evt:doc> 
	
      </evt:doc></documentation></annotation>
  <element name="EventInstanceInfo" type="evt:EventInstanceInfoType" />
  <complexType name="EventInstanceInfoType">
    <sequence> 
      <element name="EventType" type="xs:anyURI"/>
      <element name="Available" type="xs:integer" minOccurs="0"/>
      <element name="LastInstance" minOccurs="0">
        <complexType name="LastInstanceData">
          <attribute name="UUID" type="xs:anyURI"/>
          <attribute name="Date" type="xs:dateTime"/>
          <attribute name="AvailableUntil" type="xs:dateTime"/>
        </complexType>
      </element>
      <element name="FirstInstance"  minOccurs="0"> 
        <complexType name="FirstInstanceData">
          <attribute name="UUID" type="xs:anyURI"/> 
          <attribute name="Date" type="xs:dateTime"/> 
          <attribute name="AvailableUntil" type="xs:dateTime"/> 
        </complexType>
      </element> 
      <any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> 
    </sequence>
    <anyAttribute namespace="##other" processContents="skip"/>
  </complexType>


  <!-- EventTypeListType & element -->
  <element name="EventTypeList" type="evt:EventTypeListType"/>
  <complexType name="EventTypeListType">
    <sequence> 
      <element name="EventType" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/> 
    </sequence>  
  </complexType>


      
  <!-- NotificationList --> 
  <annotation><documentation><evt:doc> 
	This is the root element that encapsulates zero, one or more
	Notification. It is used in the WS-Events WSDL to define the
	part of messages which carry notifications.There are no
	constraints on how the Notification elements are grouped in a
	NotificationList. For instance, a NotificationList can contain
	Notification elements of various types or from different
	sources.
      </evt:doc></documentation></annotation>
  
  <element name="NotificationList" type="evt:NotificationListType"/>
  <complexType name="NotificationListType">
    <sequence> 
      <element ref="evt:Notification" minOccurs="0" maxOccurs="unbounded"/> 
    </sequence>  
  </complexType>


  <!-- Notification -->

  <!-- Notification Source -->
  <annotation><documentation><evt:doc>
	This element contains the URL of the event producer. The URL
	SHOULD be a valid network address even though it MAY not
	always be dereferencable because of network connectivity
	issues (e.g firewall).
	
	The notification source URL MAY be different from the one of
	the sender of the notification if, for instance, there is a
	broker acting as an intermediary between the event producer
	and consumer.
	
	However, the URL Source element SHOULD be the same than the
	one used in a subscribe call.
	
      </evt:doc></documentation></annotation>
  <element name="Source" type="xs:anyURI"/>
  

  <!-- Notification Type -->
  <annotation><documentation><evt:doc>
	Describes the type of the notification. Wildcard are not
	allowed.
      </evt:doc></documentation></annotation>
  <element name="Type" type="xs:anyURI"/>

  <!-- Notification Timestamp  -->
  <annotation><documentation><evt:doc>
	The date and time that uniquely identify the instant when the
	notification was created. This time should be equal to the
	event or events time that generated this notification.
      </evt:doc></documentation></annotation>
  <element name="Timestamp" type="xs:dateTime"/>


  <!-- Notification ExpiresOn -->
  <annotation><documentation><evt:doc>
	An optional element to indicate how long the notification is
	valid for. Events happen at a single point in time but
	notification can last longer since they are a physical
	representation of the event that propagates through systems.


	A system SHOULD not propagate any notification that have
	expired though the mechanisms described in this
	specification. However, for audit and logging purpose, it is
	expected that expired notifications will be transmistted using
	the apropriate means.


	If ExpiresOn is present, the value should be bigger or equal
	to the one in Timestamp.
      </evt:doc></documentation></annotation>
  <element name="ExpiresOn" type="evt:DateTimeType"/>

  <!-- Notification Duration  -->
  <annotation><documentation><evt:doc>

      </evt:doc></documentation></annotation>
  <element name="Duration" type="evt:DateTimeType"/>



  <!-- Notification Element -->
  <annotation><documentation><evt:doc>
	The Notification element is the basic building block used to
	convey information about events. It contains the minimal set
	of information to sustain the subscription protocal and ensure
	scalability. It is very generic and extensible.

	The optional Id attribute can be used to uniquely identify the
	notification in the list. To uniquely identify a notification,
	the concatenation of the content of the Source, Type and
	Timestamp can be used.

	If ExpiresOn is present, the value should be bigger or equal
	to the one in Timestamp.
      </evt:doc></documentation></annotation>

  <element name="Notification" type="evt:NotificationType"/>
  <complexType name="NotificationType">
    <sequence> 
      <element ref="evt:Source"/> 
      <element ref="evt:Type"/>
      <element ref="evt:Timestamp"/>
      <element ref="evt:ExpiresOn" minOccurs="0" maxOccurs="1"/>
      <element ref="evt:Duration" minOccurs="0"/>
      <element name="UUID" type="xs:anyURI"/>
      <any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/> 
    </sequence>  
    <anyAttribute namespace="##other" processContents="skip"/>
  </complexType>


  <complexType name="NewEventTypeNotification">
    <complexContent>
      <restriction base="evt:NotificationType">
        <sequence>
          <element ref="evt:Source"/> 
          <element name="Type" type="xs:anyURI"
            fixed="http://devresource.hp.com/drc/specifications/wsmf/2003/07/events/NewEventType"/>
          <element ref="evt:Timestamp"/>
          <element ref="evt:ExpiresOn" minOccurs="0" maxOccurs="1"/>
          <element ref="evt:Duration" minOccurs="0"/>
          <element name="UUID" type="xs:anyURI"/>
          <element ref="evt:EventTypeDefinition"/>
        </sequence>
      </restriction>
    </complexContent>
  </complexType>
  
  <complexType name="EventTypeUpdatedNotification">
    <complexContent>
      <restriction base="evt:NotificationType">
        <sequence>
          <element ref="evt:Source"/> 
          <element name="Type" type="xs:anyURI"
            fixed="http://devresource.hp.com/drc/specifications/wsmf/2003/07/events/EventTypeUpdated"/>
          <element ref="evt:Timestamp"/>
          <element ref="evt:ExpiresOn" minOccurs="0" maxOccurs="1"/>
          <element ref="evt:Duration" minOccurs="0"/>
          <element name="UUID" type="xs:anyURI"/>
          <element ref="evt:EventTypeDefinition"/>
        </sequence>
      </restriction>
    </complexContent>
  </complexType>
  

</schema>

<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:nil
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
