<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2016-2022 ActionTech.
  ~ License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher.
  -->

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="dbGroup">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="heartbeat">
                    <xs:complexType>
                        <xs:simpleContent>
                            <xs:extension base="xs:string">
                                <xs:attribute name="errorRetryCount" type="xs:integer"/>
                                <xs:attribute name="timeout" type="xs:nonNegativeInteger"/>
                                <xs:attribute name="keepAlive" type="xs:integer"/>
                            </xs:extension>
                        </xs:simpleContent>
                    </xs:complexType>
                </xs:element>
                <xs:element maxOccurs="unbounded" name="dbInstance">
                    <xs:complexType mixed="true">
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                            <xs:element name="property">
                                <xs:complexType>
                                    <xs:simpleContent>
                                        <xs:extension base="xs:string">
                                            <xs:attribute name="name" type="xs:string" use="required"/>
                                        </xs:extension>
                                    </xs:simpleContent>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="url" type="xs:string" use="required"/>
                        <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
                        <xs:attribute name="user" type="xs:string" use="required"/>
                        <xs:attribute name="password" type="xs:string" use="required"/>
                        <xs:attribute name="maxCon" type="xs:nonNegativeInteger" use="required"/>
                        <xs:attribute name="minCon" type="xs:nonNegativeInteger" use="required"/>
                        <xs:attribute name="primary" type="xs:boolean"/>
                        <xs:attribute name="readWeight" type="xs:nonNegativeInteger"/>
                        <xs:attribute name="id" type="xs:string"/>
                        <xs:attribute name="usingDecrypt" type="xs:boolean"/>
                        <xs:attribute name="disabled" type="xs:boolean"/>
                        <xs:attribute name="databaseType" type="xs:string"/>
                        <xs:attribute name="dbDistrict" type="xs:string"/>
                        <xs:attribute name="dbDataCenter" type="xs:string"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="rwSplitMode" type="xs:nonNegativeInteger" use="required"/>
            <xs:attribute name="delayThreshold" type="xs:integer"/>
            <xs:attribute name="delayPeriodMillis" type="xs:integer"/>
            <xs:attribute name="delayDatabase" type="xs:string"/>
            <xs:attribute name="disableHA" type="xs:boolean"/>
        </xs:complexType>
    </xs:element>

</xs:schema>