<?xml version="1.0" encoding="utf-8"?>
<xsd:schema targetNamespace="http://www.dre.vanderbilt.edu/CIAOEvents"
            xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            attributeFormDefault="unqualified">

  <xsd:element name="CIAOEvents" type="CIAO:CIAOEventsDef">
    <xsd:annotation>
      <xsd:documentation>
        Root element for defining all the pub/sub services configuration 
        used by a DeploymentPlan.  
        A CIAO:Events document should reside in a separate file.  
        A DeploymentPlan can refer to one or more CIAO:Events file names
        using the "infoProperty" tag.  
      </xsd:documentation>
    </xsd:annotation>
  </xsd:element>

<!-- =============================================================== -->
<!--            CIAO Event Service Deployment Description            -->
<!-- =============================================================== -->

  <xsd:simpleType name="EventServiceType">
    <xsd:restriction base="xsd:NCName">
      <xsd:enumeration value="EC"/>
      <xsd:enumeration value="RTEC"/>
      <xsd:enumeration value="NOTIFY"/>
      <xsd:enumeration value="RTNOTIFY"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="CIAOEventsDef">
    <xsd:sequence>
      <xsd:element name="eventServiceConfiguration" type="CIAO:EventServiceDescription" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:ID"/>
  </xsd:complexType>
  
  <xsd:complexType name="EventServiceDescription">
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="node" type="xsd:string"/>
      <xsd:element name="type" type="CIAO:EventServiceType"/>
      <xsd:element name="svc_cfg_file" type="xsd:string"/>
      <xsd:element name="filter" type="CIAO:Filter" minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element name="addr_serv" type="CIAO:AddressServerDescription" minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element name="udp_sender" type="CIAO:UDPSenderDescription" minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element name="udp_receiver" type="CIAO:UDPReceiverDescription" minOccurs="0" maxOccurs="unbounded"/> 
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:ID"/>
  </xsd:complexType>

  
<!-- =============================================================== -->
<!--                  CIAO Event Filter Description                  -->
<!-- =============================================================== -->  
  
  <xsd:simpleType name="FilterType">
    <xsd:restriction base="xsd:NCName">
      <xsd:enumeration value="CONJUNCTION"/>
      <xsd:enumeration value="DISJUNCTION"/>
      <xsd:enumeration value="LOGICAL_AND"/>
      <xsd:enumeration value="NEGATE"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="Filter">
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="type" type="CIAO:FilterType"/>     
      <xsd:element name="source" type="xsd:string" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:ID"/>
  </xsd:complexType>  
  
<!-- =============================================================== -->
<!--            CIAO Event Service Federation Description            -->
<!-- =============================================================== -->  

  <xsd:complexType name="AddressServerDescription">
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="port" type="xsd:unsignedShort"/>
      <xsd:element name="address" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="UDPSenderDescription">
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="addr_serv_id" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:complexType name="UDPReceiverDescription">
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="addr_serv_id" type="xsd:string" minOccurs="0" />
      <xsd:element name="is_multicast" type="xsd:boolean"/>
      <xsd:element name="listen_port" type="xsd:unsignedShort"/>
    </xsd:sequence>
  </xsd:complexType> 

</xsd:schema>
