<!--
		SIF Infrastructure Specification 3.7

		(January 21, 2025)
		
		Infrastructure Version: 3.7
		
		license: 
		    name: Apache  2.0
        identifier: Apache-2.0
        url: 'https://home.a4l.org/legal/'
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/infrastructure/3.7" targetNamespace="http://www.sifassociation.org/infrastructure/3.7" elementFormDefault="qualified" version="3.7">
  <xs:complexType name="queueType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating />
      </xs:appinfo>
      <xs:documentation>The Queues Service supports creation, deletion and querying of Queue (Instance) / Queue Messages Service pairs.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="polling" minOccurs="0">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>Determines, when no messages are queued, whether the Consumer will have to periodically reissue Polling Requests at timed intervals or can reissue a Polling Request immediately.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="IMMEDIATE" />
            <xs:enumeration value="LONG" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="ownerId" minOccurs="0" type="uuidType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>C</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>The Environment ID of the owning Consumer for which this Queue is buffering messages. It is not specified at Queue create time, but is returned as part of the response to a query operation, and serves to allow an administrative application to identify which application the Queue instance is assigned to.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="name" minOccurs="0" type="xs:token">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>A name which the Consumer assigns to the Queue. It is useful for reporting purposes, but is not guaranteed to be unique.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="queueUri" minOccurs="0" type="xs:anyURI">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>The URI of the Messages Service associated with the Queue instance. This is the endpoint where the 'get next message' requests are issued.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ownerUri" minOccurs="0" type="xs:anyURI">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>When present, this contains the URL which the Queue instance will use when it determines the owner needs to be asynchronously alerted that a new message has arrived in the Queue.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="idleTimeout" minOccurs="0" type="xs:unsignedInt">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>Is the maximum time in seconds the Messages Service will wait for a message to arrive, before returning an HTTPS Response of 'no message seen' to the Consumer.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="minWaitTime" minOccurs="0" type="xs:unsignedInt">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>C</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>indicates the minimum time in seconds that the Consumer should wait after receiving a 'no message seen' response to a previous query, before posting another.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="maxConcurrentConnections" minOccurs="0" type="xs:unsignedInt">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>Number of (properly identified) concurrent connections supported by (the consumer, if suggested, and) the queue.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="created" minOccurs="0" type="xs:dateTime">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>Time that Queue Instance was Created</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="lastAccessed" minOccurs="0" type="xs:dateTime">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>Time that Queue Instance was last Accessed and a message was dequeued.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="lastModified" minOccurs="0" type="xs:dateTime">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>Time that Queue Instance was last Modified by receiving a new incoming message.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="messageCount" minOccurs="0" type="xs:unsignedInt">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>The number of messages currently residing in the Queue.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" use="optional" type="uuidType">
      <xs:annotation>
        <xs:appinfo>
          <sifChar>O</sifChar>
          <privacyRating />
        </xs:appinfo>
        <xs:documentation />
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="queue" type="queueType">
    <xs:key name="queueKey1">
      <xs:selector xpath="." />
      <xs:field xpath="@id" />
    </xs:key>
  </xs:element>

  <xs:complexType name="queueCollectionType">
    <xs:sequence>
      <xs:element name="queue" type="queueType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="queues" type="queueCollectionType" />

</xs:schema>