<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
  ~ Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors.
  ~ 
  ~ Licensed under the Apache License, Version 2.0 (the \"License\");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an \"AS IS\" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<xs:schema xmlns="urn:jboss:domain:switchyard:1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:jboss:domain:switchyard:1.0" version="1.0">
    <!-- The SwitchYard subsystem root element -->
    <xs:element name="subsystem" type="subsystemType"/>

    <xs:complexType name="subsystemType">
        <xs:annotation>
            <xs:documentation>
            <![CDATA[
                The configuration of the SwitchYard subsystem.
            ]]>
            </xs:documentation>
        </xs:annotation>
        <xs:all>
            <xs:element name="socket-binding" type="socketBindingsType" minOccurs="0"/>
            <xs:element minOccurs="0" name="modules" type="modulesType"/>
            <xs:element minOccurs="0" name="extensions" type="extensionsType"/>
            <xs:element name="properties" type="propertiesType" minOccurs="0"/>
        </xs:all>
    </xs:complexType>

    <xs:complexType name="modulesType">
        <xs:choice maxOccurs="unbounded" minOccurs="0">
            <xs:element name="module" type="moduleType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="moduleType">
        <xs:all>
            <xs:element name="properties" type="propertiesType" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                            The SwitchYard subsystem component's global properties.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:all>
        <xs:attribute name="identifier" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>
                    <![CDATA[
                        The SwitchYard subsystem component's module identifier.
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="implClass" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>
                    <![CDATA[
                        The SwitchYard subsystem component's implementation class.
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="socketBindingsType">
        <xs:annotation>
            <xs:documentation>
            <![CDATA[
                The list of comma seperated socket-binding names to be used by SwitchYard subsystem.
            ]]>
            </xs:documentation>
        </xs:annotation>
        <xs:attribute name="names" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="propertiesType">
        <xs:sequence>
            <xs:any/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="extensionsType">
        <xs:choice maxOccurs="unbounded" minOccurs="0">
            <xs:element name="module" type="extensionType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="extensionType">
        <xs:attribute name="identifier" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>
                    <![CDATA[
                        The SwitchYard subsystem component's module identifier.
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

</xs:schema>
