<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="urn:jboss:installer:record:1.0.0"
           xmlns="urn:jboss:installer:record:1.0.0"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified"
           version="1.0.0">

    <xs:element name="installation-data" type="installationData"/>

    <xs:complexType name="installationData">
        <xs:choice minOccurs="1" maxOccurs="unbounded">
            <xs:element name="admin-user" type="adminUser"/>
            <xs:element name="target-directory" type="xs:string"/>
            <xs:element name="maven-repositories" type="mavenRepositories"/>
            <xs:element name="selected-packages" type="packagesType"/>
            <xs:element name="excluded-packages" type="packagesType"/>
            <xs:element name="post-install-tasks" type="postInstallTasks"/>
            <xs:element name="post-install-configs" type="postInstallConfigs"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="adminUser">
        <xs:attribute name="username" type="xs:string"/>
        <xs:attribute name="adminPassword" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="mavenRepositories">
        <xs:sequence minOccurs="1" maxOccurs="unbounded">
            <xs:element name="maven-repository" type="mavenRepository"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="mavenRepository">
        <xs:attribute name="repository-id" type="xs:string"/>
        <xs:attribute name="repository-url" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="packagesType">
        <xs:sequence minOccurs="1" maxOccurs="unbounded">
            <xs:element name="package" type="packageType"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="packageType">
        <xs:attribute name="name" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="postInstallTasks">
        <xs:sequence minOccurs="1" maxOccurs="unbounded">
            <xs:element name="post-install-task" type="postInstallTask"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="postInstallTask">
        <xs:attribute name="name" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="postInstallConfigs">
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element name="post-install-config" type="postInstallConfig"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="postInstallConfig">
        <xs:choice minOccurs="0" maxOccurs="1">
            <xs:element name="attribute-list" type="attributeListType"/>
            <xs:element name="port-config" type="portConfigType"/>
        </xs:choice>
        <xs:attribute name="name" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="attributeListType">
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element name="attribute" type="attributeType"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="attributeType">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="value" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="portConfigType">
        <xs:sequence>
            <xs:sequence minOccurs="0" maxOccurs="1">
                <xs:element name="management-interface" type="managementInterfaceType"/>
            </xs:sequence>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:element name="socket-bindings" type="socketBindingsType"/>
            </xs:sequence>
        </xs:sequence>

        <xs:attribute name="offset" type="xs:int"/>
    </xs:complexType>

    <xs:complexType name="managementInterfaceType">
        <xs:sequence>
            <xs:element name="socket-binding" type="socketBindingType"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="socketBindingsType">
        <xs:sequence maxOccurs="unbounded">
            <xs:element name="socket-binding" type="socketBindingType"/>
        </xs:sequence>
        <xs:attribute name="config" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="socketBindingType">
        <xs:attribute name="property" type="xs:string"/>
        <xs:attribute name="key" type="xs:string"/>
        <xs:attribute name="portValue" type="xs:int"/>
        <xs:attribute name="mcastPort" type="xs:int"/>
    </xs:complexType>
</xs:schema>