<?xml version="1.0" encoding="GB2312"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="systems">
        <xs:annotation>
            <xs:documentation>可供最终用户修改的系统配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="log">
                    <xs:annotation>
                        <xs:documentation>日志</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element ref="bus">
                    <xs:annotation>
                        <xs:documentation>总线</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element ref="login">
                    <xs:annotation>
                        <xs:documentation>登录</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element ref="myMessage" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>我的消息</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element ref="subSystem" maxOccurs="unbounded">
                    <xs:annotation>
                        <xs:documentation>子系统</xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="log">
        <xs:annotation>
            <xs:documentation>日志配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="basePath" type="xs:string" use="required"/>
            <xs:attribute name="baseFilename" type="xs:string" use="required"/>
            <xs:attribute name="minLevel" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Debug"/>
                        <xs:enumeration value="Info"/>
                        <xs:enumeration value="Warn"/>
                        <xs:enumeration value="Error"/>
                        <xs:enumeration value="Fatal"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="rollingType" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="bus">
        <xs:annotation>
            <xs:documentation>总线配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="globalTimeOut" type="xs:short" use="required">
                <xs:annotation>
                    <xs:documentation>队列中每个指令请求的超时时间</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="login">
        <xs:annotation>
            <xs:documentation>登录配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="saveUserName" type="xs:boolean" use="required"/>
            <xs:attribute name="lockTime" type="xs:int" use="required"/>
            <xs:attribute name="defaultSystemId" type="xs:short" use="required"/>
            <xs:attribute name="allowSelectSubSystem" type="xs:boolean" use="required"/>
            <xs:attribute name="marketTerminal" type="xs:string" use="required"/>
            <xs:attribute name="enableCounterSelection" type="xs:boolean" use="required"/>
			<xs:attribute name="needTips" type="xs:boolean" use="required"/>
			<xs:attribute name="adminMode" type="xs:boolean" use="required"/>
          <xs:attribute name="defaultCounterType" use="required">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="飞马主柜台版"/>
                <xs:enumeration value="飞马证券版"/>
                <xs:enumeration value="飞马多交易所版"/>
                <xs:enumeration value="飞马2.00两所版"/>
                <xs:enumeration value="飞马2.00优化版"/>
                <xs:enumeration value="飞马1.03版"/>
                <xs:enumeration value="恒生UFX"/>
                <xs:enumeration value="Unkown"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="myMessage">
        <xs:annotation>
            <xs:documentation>我的消息配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="refreshInterval" type="xs:byte" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="subSystem">
        <xs:annotation>
            <xs:documentation>子系统的配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="channels"/>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="eName" type="xs:string" use="required"/>
            <xs:attribute name="id" type="xs:short" use="required"/>
            <xs:attribute name="version" type="xs:decimal" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="channels">
        <xs:annotation>
            <xs:documentation>子系统通道列表</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="channel" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="default" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="channel">
        <xs:annotation>
            <xs:documentation>通道配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="uri" type="xs:anyURI" use="required"/>
            <xs:attribute name="type" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="业务前置"/>
                        <xs:enumeration value="交易前置"/>
                        <xs:enumeration value="行情前置"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="defaultProtocol" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="json"/>
                        <xs:enumeration value="structs"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="topic" type="xs:string" use="required"/>
            <xs:attribute name="subscribeType" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
</xs:schema>
