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

<!--
  ~ Copyright The WildFly Authors
  ~ SPDX-License-Identifier: Apache-2.0
  -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="urn:wildfly:microprofile-opentracing-smallrye:2.0"
           xmlns="urn:wildfly:microprofile-opentracing-smallrye:2.0"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified"
           version="2.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>
