<?xml version="1.0" encoding="UTF-8" standalone="no" ?>


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

            xmlns="http://www.zfoo.com/schema/net"
            targetNamespace="http://www.zfoo.com/schema/net"

            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

    <xsd:complexType name="addressAttributeType">
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="url" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="addressType">
        <xsd:sequence>
            <xsd:element name="address" maxOccurs="unbounded" type="addressAttributeType"/>
        </xsd:sequence>
        <xsd:attribute name="center" type="xsd:string" use="required"/>
        <xsd:attribute name="path" type="xsd:string" use="optional"/>
        <xsd:attribute name="user" type="xsd:string" use="required"/>
        <xsd:attribute name="password" type="xsd:string" use="required"/>
        <xsd:attribute name="driver-class-name" type="xsd:string" use="optional"/>
    </xsd:complexType>

    <xsd:complexType name="providersType">
        <xsd:sequence>
            <xsd:element name="provider" maxOccurs="unbounded" type="providerAttributeType" minOccurs="0"/>
        </xsd:sequence>
        <xsd:attribute name="thread" type="xsd:string" use="optional"/>
        <xsd:attribute name="address" type="xsd:string" use="optional"/>
    </xsd:complexType>

    <xsd:complexType name="consumersType">
        <xsd:sequence>
            <xsd:element name="consumer" maxOccurs="unbounded" type="consumerAttributeType"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="providerAttributeType">
        <xsd:attribute name="protocol-module" type="xsd:string" use="required"/>
        <xsd:attribute name="provider" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="consumerAttributeType">
        <xsd:attribute name="load-balancer" type="xsd:string" default="consistent-hash"/>
        <xsd:attribute name="consumer" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="netType">
        <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="1">
                <xsd:element name="registry" type="addressType"/>
            </xsd:choice>
            <xsd:choice minOccurs="0" maxOccurs="1">
                <xsd:element name="monitor" type="addressType"/>
            </xsd:choice>
            <xsd:choice minOccurs="0" maxOccurs="1">
                <xsd:element name="providers" type="providersType"/>
            </xsd:choice>
            <xsd:choice minOccurs="0" maxOccurs="1">
                <xsd:element name="consumers" type="consumersType"/>
            </xsd:choice>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="protocol-location" type="xsd:string" use="required"/>
        <xsd:attribute name="merge-protocol" type="xsd:boolean" default="false"/>
        <xsd:attribute name="fold-protocol" type="xsd:boolean" default="false"/>
        <xsd:attribute name="code-languages" type="xsd:string"/>
        <xsd:attribute name="protocol-path" type="xsd:string"/>
        <xsd:attribute name="protocol-param" type="xsd:string"/>
    </xsd:complexType>

    <xsd:element name="net" type="netType"/>


</xsd:schema>
