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

<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2018, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="urn:wildfly:microprofile-opentracing-smallrye:3.0"
           xmlns="urn:wildfly:microprofile-opentracing-smallrye:3.0"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified"
           version="3.0">

    <xs:element name="subsystem">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="jaeger-tracer" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="tags" minOccurs="0" maxOccurs="1">
                                <xs:annotation>
                                    <xs:documentation>
                                        Map of credentials store implementation specific properties.
                                    </xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="property" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:attribute name="name" type="xs:string" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation>
                                                            The key for this tag.
                                                        </xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="value" type="xs:string" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation>
                                                            The value for this tag.
                                                        </xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="codec-configuration" minOccurs="0" maxOccurs="1">
                                <xs:complexType>
                                    <xs:attribute name="propagation" use="optional">
                                        <xs:simpleType>
                                            <xs:restriction base="xs:string">
                                                <xs:enumeration value="B3"/>
                                                <xs:enumeration value="JAEGER"/>
                                            </xs:restriction>
                                        </xs:simpleType>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="sampler-configuration" minOccurs="0" maxOccurs="1">
                                <xs:complexType>
                                    <xs:attribute name="sampler-type" use="optional">
                                        <xs:simpleType>
                                            <xs:restriction base="xs:string">
                                                <xs:enumeration value="const"/>
                                                <xs:enumeration value="probabilistic"/>
                                                <xs:enumeration value="ratelimiting"/>
                                                <xs:enumeration value="remote"/>
                                            </xs:restriction>
                                        </xs:simpleType>
                                    </xs:attribute>
                                    <xs:attribute name="sampler-param" use="optional" type="xs:double"/>
                                    <xs:attribute name="sampler-manager-host-port" type="xs:string"/>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="sender-configuration" minOccurs="0" maxOccurs="1">
                                <xs:complexType>
                                    <xs:attribute name="sender-agent-host" use="optional" type="xs:string"/>
                                    <xs:attribute name="sender-agent-port" use="optional" type="xs:int"/>
                                    <xs:attribute name="sender-endpoint" use="optional" type="xs:string"/>
                                    <xs:attribute name="sender-auth-token" use="optional" type="xs:string"/>
                                    <xs:attribute name="sender-auth-user" use="optional" type="xs:string"/>
                                    <xs:attribute name="sender-auth-password" use="optional" type="xs:string"/>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="reporter-configuration" minOccurs="0" maxOccurs="1">
                                <xs:complexType>
                                    <xs:attribute name="reporter-log-spans" use="optional" type="xs:boolean"/>
                                    <xs:attribute name="reporter-flush-interval" use="optional" type="xs:int"/>
                                    <xs:attribute name="reporter-max-queue-size" use="optional" type="xs:int"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="name" type="xs:string" use="required"/>
                        <xs:attribute name="traceid-128bit" type="xs:boolean" use="optional"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attribute name="default-tracer" type="xs:string" use="optional"/>
        </xs:complexType>
    </xs:element>

</xs:schema>
