<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0"
           targetNamespace="urn:infinispan:server:13.0"
           xmlns:tns="urn:infinispan:server:13.0"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">

   <xs:element name="server" type="tns:server"/>

   <xs:element name="interfaces" type="tns:interfaces"/>
   <xs:element name="data-sources" type="tns:data-sources"/>
   <xs:element name="security" type="tns:security"/>
   <xs:element name="socket-bindings" type="tns:socket-bindings"/>
   <xs:element name="endpoints" type="tns:endpoints">
      <xs:unique name="connector-unique">
         <xs:selector xpath="./tns:hotrod-connector|./tns:rest-connector|./tns:memcached-connector"/>
         <xs:field xpath="@name"/>
      </xs:unique>
   </xs:element>
   <xs:element name="endpoint" type="tns:endpoint"/>

   <xs:complexType name="server">
      <xs:sequence>
         <xs:element type="tns:interfaces" name="interfaces">
            <xs:unique name="interface-name-unique">
               <xs:selector xpath="./tns:interface"/>
               <xs:field xpath="@name"/>
            </xs:unique>
         </xs:element>
         <xs:element type="tns:socket-bindings" name="socket-bindings">
            <xs:unique name="socket-binding-unique">
               <xs:selector xpath="./tns:socket-binding"/>
               <xs:field xpath="@name"/>
            </xs:unique>
         </xs:element>
         <xs:element type="tns:security" name="security" minOccurs="0"/>
         <xs:element type="tns:data-sources" name="data-sources" minOccurs="0"/>
         <xs:element type="tns:endpoints" name="endpoints"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="interfaces">
      <xs:sequence>
         <xs:element type="tns:interface" name="interface" maxOccurs="unbounded" minOccurs="0"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="interface">
      <xs:all>
         <xs:element type="tns:interface-inet-address" name="inet-address" minOccurs="0"/>
         <xs:element type="tns:interface-global" name="global" minOccurs="0"/>
         <xs:element type="tns:interface-link-local" name="link-local" minOccurs="0"/>
         <xs:element type="tns:interface-loopback" name="loopback" minOccurs="0"/>
         <xs:element type="tns:interface-non-loopback" name="non-loopback" minOccurs="0"/>
         <xs:element type="tns:interface-site-local" name="site-local" minOccurs="0"/>
         <xs:element type="tns:interface-match-interface" name="match-interface" minOccurs="0"/>
         <xs:element type="tns:interface-match-address" name="match-address" minOccurs="0"/>
      </xs:all>
      <xs:attribute type="xs:string" name="name"/>
   </xs:complexType>

   <xs:complexType name="interface-match-interface">
      <xs:attribute name="value"/>
   </xs:complexType>

   <xs:complexType name="interface-match-address">
      <xs:attribute name="value"/>
   </xs:complexType>

   <xs:complexType name="interface-match-host">
      <xs:attribute name="value"/>
   </xs:complexType>

   <xs:complexType name="socket-bindings">
      <xs:sequence>
         <xs:element type="tns:socket-binding" name="socket-binding" maxOccurs="unbounded" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="default-interface"/>
      <xs:attribute type="xs:string" name="port-offset"/>
   </xs:complexType>

   <xs:complexType name="socket-binding">
      <xs:simpleContent>
         <xs:extension base="xs:string">
            <xs:attribute type="xs:string" name="name" use="required"/>
            <xs:attribute type="xs:string" name="port" use="required"/>
            <xs:attribute type="xs:string" name="interface"/>
         </xs:extension>
      </xs:simpleContent>
   </xs:complexType>

   <xs:complexType name="data-sources">
      <xs:sequence>
         <xs:element type="tns:data-source" name="data-source" maxOccurs="unbounded" minOccurs="0"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="data-source">
      <xs:all>
         <xs:element type="tns:data-source-connection-factory" name="connection-factory">
            <xs:annotation>
               <xs:documentation>Configuration for the connection factory</xs:documentation>
            </xs:annotation>
         </xs:element>
         <xs:element type="tns:data-source-connection-pool" name="connection-pool">
            <xs:annotation>
               <xs:documentation>Configuration for the connection pool</xs:documentation>
            </xs:annotation>
         </xs:element>
      </xs:all>
      <xs:attribute name="name" type="xs:token" use="required">
         <xs:annotation>
            <xs:documentation>Name for the datasource (used for management)</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="jndi-name" type="xs:token" use="required">
         <xs:annotation>
            <xs:documentation>JNDI name for the datasource</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="statistics" type="xs:boolean" default="false">
         <xs:annotation>
            <xs:documentation>Enable statistics for this datasource</xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="data-source-connection-factory">
      <xs:all>
         <xs:element type="tns:credential-reference" name="credential-reference" minOccurs="0"/>
         <xs:element type="tns:property" name="connection-property" minOccurs="0">
            <xs:annotation>
               <xs:documentation>Properties for the JDBC driver</xs:documentation>
            </xs:annotation>
         </xs:element>
      </xs:all>
      <xs:attribute name="driver" type="xs:token" use="required">
         <xs:annotation>
            <xs:documentation>Unique reference to the JDBC driver</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="url" type="xs:token">
         <xs:annotation>
            <xs:documentation>JDBC driver connection URL (e.g. "jdbc:h2:tcp://localhost:1234")</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="transaction-isolation" type="tns:data-source-transaction-isolation" default="READ_COMMITTED">
         <xs:annotation>
            <xs:documentation>Set the java.sql.Connection transaction isolation level to use. Defaults to READ_COMMITTED</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="new-connection-sql" type="xs:token">
         <xs:annotation>
            <xs:documentation>SQL statement to be executed on a connection after creation</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="username" type="xs:token">
         <xs:annotation>
            <xs:documentation>Username to use for basic authentication with the database</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="password" type="xs:token">
         <xs:annotation>
            <xs:documentation>Password to use for basic authentication with the database</xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:simpleType name="data-source-transaction-isolation">
      <xs:annotation>
         <xs:documentation>
            Define constants used as the possible transaction isolation levels in transaction-isolation type ]>
            Include: NONE, READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE
         </xs:documentation>
      </xs:annotation>
      <xs:restriction base="xs:token">
         <xs:enumeration value="NONE"/>
         <xs:enumeration value="READ_UNCOMMITTED"/>
         <xs:enumeration value="READ_COMMITTED"/>
         <xs:enumeration value="REPEATABLE_READ"/>
         <xs:enumeration value="SERIALIZABLE"/>
      </xs:restriction>
   </xs:simpleType>

   <xs:complexType name="data-source-connection-pool">
      <xs:attribute name="max-size" type="xs:nonNegativeInteger" use="required">
         <xs:annotation>
            <xs:documentation>Maximum number of connections in the pool</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="min-size" type="xs:nonNegativeInteger">
         <xs:annotation>
            <xs:documentation>Minimum number of connections the pool should hold</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="initial-size" type="xs:nonNegativeInteger">
         <xs:annotation>
            <xs:documentation>Initial number of connections the pool should hold</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="blocking-timeout" type="xs:nonNegativeInteger" default="0">
         <xs:annotation>
            <xs:documentation>
               Maximum time in milliseconds to block while waiting for a connection before throwing an exception
               This will never throw an exception if creating a new connection takes an inordinately long period of time
               Default is 0 meaning that a call will wait indefinitely
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="background-validation" type="xs:nonNegativeInteger">
         <xs:annotation>
            <xs:documentation>
               Time in milliseconds between background validation runs. A duration of 0 means that this feature is disabled.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="validate-on-acquisition" type="xs:nonNegativeInteger">
         <xs:annotation>
            <xs:documentation>
               Connections idle for longer than this time, specified in milliseconds, are validated before being
               acquired (foreground validation). A duration of 0 means that this feature is disabled.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="leak-detection" type="xs:nonNegativeInteger">
         <xs:annotation>
            <xs:documentation>
               Time in milliseconds a connection has to be held before a leak warning
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="idle-removal" type="xs:nonNegativeInteger">
         <xs:annotation>
            <xs:documentation>
               Time in minutes a connection has to be idle before it can be removed
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="security">
      <xs:sequence>
         <xs:element type="tns:credential-stores" name="credential-stores" minOccurs="0">
            <xs:unique name="security-credential-unique">
               <xs:selector xpath="./tns:credential-store"/>
               <xs:field xpath="@name"/>
            </xs:unique>
         </xs:element>
         <xs:element type="tns:security-realms" name="security-realms">
            <xs:unique name="security-realm-unique">
               <xs:selector xpath="./tns:security-realm"/>
               <xs:field xpath="@name"/>
            </xs:unique>
         </xs:element>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="protocol-connector" abstract="true">
      <xs:attribute name="socket-binding" type="xs:string">
         <xs:annotation>
            <xs:documentation>Specifies the socket this connector binds to. If no socket binding is declared, the server does not listen to TCP connections. </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="cache-container" type="xs:string">
         <xs:annotation>
            <xs:documentation>Names the cache container this connector exposes.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="io-threads" type="xs:int">
         <xs:annotation>
            <xs:documentation>Sets the number of I/O threads. Defaults to 2 * cpu cores.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="worker-threads" type="xs:int">
         <xs:annotation>
            <xs:documentation>Sets the number of worker threads. Defaults to 160.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="idle-timeout" type="xs:int">
         <xs:annotation>
            <xs:documentation>Specifies the maximum time, in seconds, that client connections can remain inactive. Defaults to 0 (no timeout). </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="tcp-nodelay" type="xs:boolean">
         <xs:annotation>
            <xs:documentation>Enables TCP NODELAY on the TCP stack. Values are enabled (default) / disabled.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="tcp-keepalive" type="xs:boolean">
         <xs:annotation>
            <xs:documentation>Enables TCP KEEPALIVE on the TCP stack. Values are enabled / disabled (default).</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="send-buffer-size" type="xs:int">
         <xs:annotation>
            <xs:documentation>Sets the size of the send buffer.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="receive-buffer-size" type="xs:int">
         <xs:annotation>
            <xs:documentation>Sets the size of the receive buffer.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="require-ssl-client-auth" type="xs:boolean">
         <xs:annotation>
            <xs:documentation>
              Requires clients to use certificates for authentication.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="endpoints">
      <xs:sequence>
         <xs:element name="endpoint" type="tns:endpoint" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="socket-binding" type="xs:string">
         <xs:annotation>
            <xs:documentation>Specifies the socket the endpoint connector binds to.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="security-realm" type="xs:string">
         <xs:annotation>
            <xs:documentation>Names the security realm to use for authentication, cache authorization, and encryption.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="endpoint">
      <xs:complexContent>
         <xs:extension base="tns:protocol-connector">
            <xs:sequence>
               <xs:element name="ip-filter" type="tns:ip-filter" minOccurs="0"/>
               <xs:element type="tns:hotrod-connector" name="hotrod-connector" minOccurs="0" maxOccurs="unbounded"/>
               <xs:element type="tns:rest-connector" name="rest-connector" minOccurs="0" maxOccurs="unbounded"/>
               <xs:element type="tns:memcached-connector" name="memcached-connector" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="socket-binding" type="xs:string" use="required">
               <xs:annotation>
                  <xs:documentation>Specifies the socket the endpoint connector binds to.</xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="security-realm" type="xs:string">
               <xs:annotation>
                  <xs:documentation>Names the security realm to use for authentication, cache authorization, and encryption. </xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="admin" type="xs:boolean" default="true">
               <xs:annotation>
                  <xs:documentation>Enable administrative features on this endpoint. Defaults to true.</xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="metrics-auth" type="xs:boolean" default="true">
               <xs:annotation>
                  <xs:documentation>Enable metrics authentication on this endpoint. Defaults to true.</xs:documentation>
               </xs:annotation>
            </xs:attribute>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="named-protocol-connector" abstract="true">
      <xs:complexContent>
         <xs:extension base="tns:protocol-connector">
            <xs:all>
               <xs:element name="ip-filter" type="tns:ip-filter" minOccurs="0"/>
            </xs:all>
            <xs:attribute name="name" type="xs:string">
               <xs:annotation>
                  <xs:documentation>Logically names this connector. Use this attribute to separate multiple connector declarations for the same endpoint.</xs:documentation>
               </xs:annotation>
            </xs:attribute>

         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="ip-filter">
      <xs:choice maxOccurs="unbounded">
         <xs:element name="accept" type="tns:ip-rule"/>
         <xs:element name="reject" type="tns:ip-rule"/>
      </xs:choice>
   </xs:complexType>

   <xs:complexType name="ip-rule">
      <xs:attribute name="from" type="xs:string"/>
   </xs:complexType>

   <xs:complexType name="hotrod-connector">
      <xs:complexContent>
         <xs:extension base="tns:named-protocol-connector">
            <xs:all>
               <xs:element name="topology-state-transfer" type="tns:topology-state-transfer" minOccurs="0"/>
               <xs:element name="authentication" type="tns:authentication" minOccurs="0"/>
               <xs:element name="encryption" type="tns:encryption" minOccurs="0"/>
            </xs:all>
            <xs:attribute name="external-host" type="xs:string" use="optional">
               <xs:annotation>
                  <xs:documentation>Sets an external address for this node to accept client connections. Defaults to the server socket binding address.</xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="external-port" type="xs:int" use="optional">
               <xs:annotation>
                  <xs:documentation>Sets an external port for this node. Defaults to the server socket binding port.</xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="security-realm" type="xs:string">
               <xs:annotation>
                  <xs:documentation>Names the security realm to use for authentication, cache authorization, and encryption. </xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="network-prefix-override" type="xs:boolean" default="true">
               <xs:annotation>
                  <xs:documentation>
                     Configures whether to use the netmask that the host system provides for interfaces or override with netmasks that follow IANA private address conventions.
                     Defaults to overriding host netmasks and using IANA conventions.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="memcached-connector">
      <xs:complexContent>
         <xs:extension base="tns:named-protocol-connector">
            <xs:attribute name="cache" type="xs:string">
               <xs:annotation>
                  <xs:documentation>Names the cache that the Memcached connector exposes. Defaults to memcachedCache.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="client-encoding" type="xs:string">
               <xs:annotation>
                  <xs:documentation>Sets client encoding for values. Applies to memcached text protocol only.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="rest-connector">
      <xs:complexContent>
         <xs:extension base="tns:named-protocol-connector">
            <xs:all>
               <xs:element name="authentication" type="tns:rest-authentication" minOccurs="0"/>
               <xs:element name="cors-rules" type="tns:cors-rules" minOccurs="0"/>
               <xs:element name="encryption" type="tns:encryption" minOccurs="0"/>
            </xs:all>
            <xs:attribute name="context-path" type="xs:string" use="optional">
               <xs:annotation>
                  <xs:documentation>
                    Sets the context path for REST connectors and defaults to
                    the root context. The command line interface (CLI) and
                    other internal components use the root context. For this
                    reason, you should not change the default value or set a
                    custom context path.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="extended-headers" type="tns:extended-headers" use="optional" default="ON_DEMAND">
               <xs:annotation>
                  <xs:documentation>Enables extended headers. Values are NEVER / ON_DEMAND (default).
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="max-content-length" type="xs:int" use="optional">
               <xs:annotation>
                  <xs:documentation>Sets the maximum allowed content length.</xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="compression-level" type="xs:int" use="optional">
               <xs:annotation>
                  <xs:documentation>Sets the level for compressed requests and responses.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="security-realm" type="xs:string">
               <xs:annotation>
                  <xs:documentation>Names the security realm to use for authentication, cache authorization, and encryption. </xs:documentation>
               </xs:annotation>
            </xs:attribute>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="topology-state-transfer">
      <xs:attribute name="lock-timeout" type="xs:int" use="optional">
         <xs:annotation>
            <xs:documentation>Configures lock acquisition timeouts, in seconds, for topology caches. Defaults to 10.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="replication-timeout" type="xs:int" use="optional">
         <xs:annotation>
            <xs:documentation>Configures replication timeouts, in seconds, for topology caches. Defaults to 10.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="lazy-retrieval" type="xs:boolean" default="false">
         <xs:annotation>
            <xs:documentation>Enables lazy retrieval of cluster topology from nodes via a ClusterCacheLoader. Values are true / false (default).
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="await-initial-retrieval" type="xs:boolean" use="optional"
                    default="${TopologyCache.awaitInitialRetrieval}">
         <xs:annotation>
            <xs:documentation>Configures whether initial state retrieval should happen immediately at startup. Applies only when lazy-retrieval is false. Values are true (default) / false.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="authentication">
      <xs:all>
         <xs:element name="sasl" type="tns:sasl" minOccurs="0"/>
      </xs:all>
      <xs:attribute name="security-realm" type="xs:string">
         <xs:annotation>
            <xs:documentation>Names the security realm to use for authentication and authorization. Deprecated since 12.1. Use the security-realm attribute on the connector instead.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="sasl">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                The configuration of the SASL authentication layer for this server.

                The optional "include-mechanisms" attribute contains a list of allowed SASL mechanism names.
                No mechanisms will be allowed which are not present in this list.

                The optional "qop" attribute contains a list of quality-of-protection values, in decreasing order
                of preference.

                The optional "strength" attribute contains a list of cipher strength values, in decreasing order
                of preference.

                The optional "policy" attribute contains a list of policies to use to narrow down the available set
                of mechanisms.

                The optional nested "property" elements specify additional properties required by the specified mechanisms
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:sequence>
         <xs:element name="property" type="tns:property" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="server-principal" type="xs:string">
         <xs:annotation>
            <xs:documentation>The principal to use as the server identity. The principal must be present in the security
               realm.
               This is required for Kerberos-based SASL mechs (e.g. GSSAPI, GS2_KRB5)
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="server-name" type="xs:string">
         <xs:annotation>
            <xs:documentation>Names the server that is exposed to clients.</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="mechanisms" type="tns:name-list"/>
      <xs:attribute name="qop" type="tns:qop-list"/>
      <xs:attribute name="strength" type="tns:strength"/>
      <xs:attribute name="policy" type="tns:policy-list"/>
   </xs:complexType>

   <xs:simpleType name="policy-list">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                Policy criteria items to use in order to choose a SASL mechanism.

                "forward-secrecy" specifies whether mechanisms
                that implement forward secrecy between sessions are required. Forward secrecy means that breaking into
                one session will not automatically provide information for breaking into future sessions.

                "no-active" forbids mechanisms susceptible to active (non-dictionary) attacks.

                "no-anonymous" forbids mechanisms that accept anonymous login.

                "no-dictionary" forbids mechanisms susceptible to passive dictionary attacks.

                "no-plain-text" forbids mechanisms susceptible to simple plain passive attacks (e.g., "PLAIN") are not permitted.

                "pass-credentials" allows mechanisms that pass client credentials.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:list>
         <xs:simpleType>
            <xs:restriction base="xs:token">
               <xs:enumeration value="forward-secrecy"/>
               <xs:enumeration value="no-active"/>
               <xs:enumeration value="no-anonymous"/>
               <xs:enumeration value="no-dictionary"/>
               <xs:enumeration value="no-plain-text"/>
               <xs:enumeration value="pass-credentials"/>
            </xs:restriction>
         </xs:simpleType>
      </xs:list>
   </xs:simpleType>

   <xs:complexType name="property">
      <xs:simpleContent>
         <xs:extension base="xs:string">
            <xs:attribute name="name" type="xs:string" use="required">
               <xs:annotation>
                  <xs:documentation>Defines the name of a property.</xs:documentation>
               </xs:annotation>
            </xs:attribute>
         </xs:extension>
      </xs:simpleContent>
   </xs:complexType>

   <xs:complexType name="boolean-element">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                An element specifying a boolean value.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="value" type="xs:boolean" use="required"/>
   </xs:complexType>

   <xs:complexType name="name-listType">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                An element specifying a string list.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="value" type="tns:name-list" use="required"/>
   </xs:complexType>

   <xs:simpleType name="name-list">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                A set of string items.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:list itemType="xs:string"/>
   </xs:simpleType>

   <xs:complexType name="qop-listType">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                An element specifying a qop list.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="value" type="tns:qop-list" use="required"/>
   </xs:complexType>

   <xs:simpleType name="qop-list">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                The SASL quality-of-protection value list.  See http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/security/sasl/Sasl.html#QOP
                for more information.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:list>
         <xs:simpleType>
            <xs:restriction base="xs:token">
               <xs:enumeration value="auth"/>
               <xs:enumeration value="auth-int"/>
               <xs:enumeration value="auth-conf"/>
            </xs:restriction>
         </xs:simpleType>
      </xs:list>
   </xs:simpleType>

   <xs:simpleType name="strength">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                The SASL strength value list.  See http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/security/sasl/Sasl.html#STRENGTH
                for more information.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:list>
         <xs:simpleType>
            <xs:restriction base="xs:token">
               <xs:enumeration value="low"/>
               <xs:enumeration value="medium"/>
               <xs:enumeration value="high"/>
            </xs:restriction>
         </xs:simpleType>
      </xs:list>
   </xs:simpleType>

   <xs:complexType name="rest-authentication">
      <xs:attribute name="security-realm" type="xs:string">
         <xs:annotation>
            <xs:documentation>The security realm to use for authentication/authorization purposes. Defaults to none (no
               authentication).  Deprecated since 12.1. Use the security-realm attribute on the connector instead.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="mechanisms" type="tns:name-list" default="NONE">
         <xs:annotation>
            <xs:documentation>The authentication method to require. Can be NONE, BASIC, DIGEST, CLIENT_CERT, SPNEGO.
               Defaults to NONE. Setting it to a different value requires enabling a security-realm.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="server-principal" type="xs:string">
         <xs:annotation>
            <xs:documentation>The principal to use as the server identity. The principal must be present in the security
               realm.
               This is required for Kerberos-based SASL mechs (e.g. SPNEGO).
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="encryption">
      <xs:sequence>
         <xs:element name="sni" type="tns:sni" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="require-ssl-client-auth" type="xs:boolean" use="optional"
                    default="${Encryption.requireSslClientAuth}">
         <xs:annotation>
            <xs:documentation>
              Requires clients to use certificates for authentication.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="security-realm" type="xs:string" use="required">
         <xs:annotation>
            <xs:documentation>
              Names the security realm that contains the SSL keystore. Deprecated since 12.1. Use the security-realm attribute on the connector instead.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="cors-rules">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                Configures CORS (Cross Origin Resource Sharing) for the REST Server.

                Contains one or more rules that specify the permissions for cross-domain requests based on the origin.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:sequence>
         <xs:element name="cors-rule" type="tns:cors-rule" minOccurs="1" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="sni">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                An element specifying a TLS SNI mapping.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="host-name" type="xs:string" use="required">
         <xs:annotation>
            <xs:documentation>TLS SNI host name</xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="security-realm" type="xs:string" use="optional">
         <xs:annotation>
            <xs:documentation>A corresponding security realm. If none is specified, the default will be used.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="prefix">
      <xs:annotation>
         <xs:documentation>
            <![CDATA[
                An element specifying REST prefix.
            ]]>
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="path" type="xs:string" use="required">
         <xs:annotation>
            <xs:documentation>Path for REST prefix</xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:simpleType name="extended-headers">
      <xs:restriction base="xs:token">
         <xs:enumeration value="NEVER">
            <xs:annotation>
               <xs:documentation>Never return extended headers</xs:documentation>
            </xs:annotation>
         </xs:enumeration>
         <xs:enumeration value="ON_DEMAND">
            <xs:annotation>
               <xs:documentation>Return extended headers on demand (i.e. when the 'extendend' query parameter is present
                  on the request)
               </xs:documentation>
            </xs:annotation>
         </xs:enumeration>
      </xs:restriction>
   </xs:simpleType>

   <xs:complexType name="cors-rule">
      <xs:annotation>
         <xs:documentation>
           Defines a CORS rule for one or more origins.
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="name" type="xs:string">
         <xs:annotation>
            <xs:documentation>
              Defines a name for a CORS rule.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="allow-credentials" type="xs:boolean" default="false">
         <xs:annotation>
            <xs:documentation>
              Configures if CORS requests use credentials and sets the CORS
              'Access-Control-Allow-Credentials' response header.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="max-age-seconds" type="xs:int" default="0">
         <xs:annotation>
            <xs:documentation>
              Configures how long CORS preflight request headers can be caches
              and sets the CORS 'Access-Control-Max-Age' response header.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="allowed-origins" type="xs:string">
         <xs:annotation>
            <xs:documentation>
               Specifies the CORS 'Access-Control-Allow-Origin' header that controls which
               origins can access resources.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="allowed-methods" type="tns:name-list">
         <xs:annotation>
            <xs:documentation>
               Specifies the CORS 'Access-Control-Allow-Methods' header in the preflight response.
               Controls the methods that origins can access.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="allowed-headers" type="tns:name-list">
         <xs:annotation>
            <xs:documentation>
               Specifies the CORS 'Access-Control-Allow-Headers' header in the preflight response.
               Controls the headers that origins can access.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="expose-headers" type="tns:name-list">
         <xs:annotation>
            <xs:documentation>
               Specifies the CORS 'Access-Control-Expose-Headers' header in the preflight response.
               Controls the headers that are exposed to origins.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="credential-stores">
      <xs:annotation>
         <xs:documentation>
            Complex type to contain the definitions of the credential stores.
         </xs:documentation>
      </xs:annotation>
      <xs:sequence>
         <xs:element name="credential-store" type="tns:credential-store" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="credential-reference">
      <xs:annotation>
         <xs:documentation>
            Credential reference to be used by the configuration.
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="store" type="xs:string">
         <xs:annotation>
            <xs:documentation>
               Credential store name used to fetch credential with given 'alias' from.
               Credential store name has to be defined elsewhere.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="alias" type="xs:string">
         <xs:annotation>
            <xs:documentation>
               Alias of credential in the credential store.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="clear-text-credential">
      <xs:annotation>
         <xs:documentation>
            A clear-text credential.
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="clear-text" type="xs:string" use="required">
         <xs:annotation>
            <xs:documentation>
               The clear-text password.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="credential-store">
      <xs:annotation>
         <xs:documentation>
            An individual credential store definition.
         </xs:documentation>
      </xs:annotation>
      <xs:choice>
         <xs:element name="clear-text-credential" type="tns:clear-text-credential">
            <xs:annotation>
               <xs:documentation>
                  Credential to be used by as protection parameter for the Credential Store.
               </xs:documentation>
            </xs:annotation>
         </xs:element>
         <xs:element name="credential-reference" type="tns:credential-reference">
            <xs:annotation>
               <xs:documentation>
                  Credential to be used by as protection parameter for the Credential Store.
               </xs:documentation>
            </xs:annotation>
         </xs:element>
      </xs:choice>
      <xs:attribute name="name" type="xs:string" use="required">
         <xs:annotation>
            <xs:documentation>
               The name of this credential store.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="relative-to" type="xs:string">
         <xs:annotation>
            <xs:documentation>
               A property name whose value will be used to resolve relative paths.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="path" type="xs:string" use="required">
         <xs:annotation>
            <xs:documentation>
               File name of credential store storage. If the path is relative, the full path will be resolved using
               the 'relative-to' attribute.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="type" type="xs:string" default="pkcs12">
         <xs:annotation>
            <xs:documentation>
               The type of the credential store file. Can be either pkcs12 or jceks. Defaults to pkcs12.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="security-realms">
      <xs:sequence>
         <xs:element type="tns:security-realm" name="security-realm" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="security-realm">
      <xs:sequence>
         <xs:element type="tns:security-realm-server-identities" name="server-identities" minOccurs="0"/>
         <xs:element type="tns:security-realm-filesystem" name="filesystem-realm" minOccurs="0"/>
         <xs:element type="tns:security-realm-ldap" name="ldap-realm" minOccurs="0"/>
         <xs:element type="tns:security-realm-local" name="local-realm" minOccurs="0"/>
         <xs:element type="tns:security-realm-properties" name="properties-realm" minOccurs="0"/>
         <xs:element type="tns:security-realm-token" name="token-realm" minOccurs="0"/>
         <xs:element type="tns:security-realm-trust" name="truststore-realm" minOccurs="0"/>
         <xs:element type="tns:security-realm-distributed" name="distributed-realm" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" use="required"/>
      <xs:attribute name="default-realm" type="xs:string">
         <xs:annotation>
            <xs:documentation>
               Specifies which of the underlying realms will be used by default. It defaults to the first realm.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="cache-max-size" type="xs:int" default="256">
         <xs:annotation>
            <xs:documentation>
               The maximum size for the identity cache for this realm. If the size is less than 1, the cache will be disabled. Defaults to 256.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="cache-lifespan" type="xs:long" default="-1">
         <xs:annotation>
            <xs:documentation>
               The lifespan of entries in the identity cache after which they expire and are reloaded from the realm provider. Defaults to -1 (never expires).
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="security-realm-authentication">
      <xs:sequence>
         <xs:element type="tns:security-realm-properties" name="properties"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="security-realm-authorization">
      <xs:sequence>
         <xs:element type="tns:security-realm-properties" name="properties"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="map-groups-to-roles"/>
   </xs:complexType>

   <xs:complexType name="interface-inet-address">
      <xs:attribute type="xs:string" name="value" use="required"/>
   </xs:complexType>

   <xs:complexType name="interface-global"></xs:complexType>

   <xs:complexType name="interface-link-local"></xs:complexType>

   <xs:complexType name="interface-loopback"></xs:complexType>

   <xs:complexType name="interface-non-loopback"></xs:complexType>

   <xs:complexType name="interface-site-local"></xs:complexType>

   <xs:complexType name="security-realm-server-identities">
      <xs:sequence>
         <xs:element type="tns:security-realm-ssl" name="ssl" minOccurs="0"/>
         <xs:element type="tns:security-realm-kerberos" name="kerberos" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>
   <xs:complexType name="security-realm-ssl">
      <xs:sequence>
         <xs:element type="tns:security-realm-keystore" name="keystore" minOccurs="0"/>
         <xs:element type="tns:security-realm-truststore" name="truststore" minOccurs="0"/>
         <xs:element type="tns:security-realm-ssl-engine" name="engine" minOccurs="0"/>
      </xs:sequence>
   </xs:complexType>
   <xs:complexType name="security-realm-keystore">
      <xs:sequence>
         <xs:element type="tns:credential-reference" name="credential-reference" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="path">
         <xs:annotation>
            <xs:documentation>
               Specifies the location of the keystore on the host file system. You can set a relative or absolute value.
               If you set a relative value, configure a value for the 'relative-to' attribute.
               The type of the keystore will be auto-detected among JKS, JCEKS, PKCS12 or PEM.
               BKS, BCFKS and UBER are also supported if the `bouncycastle` libary is present.
               The path may be omitted when using global store providers, such as 'SunPKCS11-NSS-FIPS'.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="relative-to" default="infinispan.server.config.path">
         <xs:annotation>
            <xs:documentation>
               Specifies a property name that resolves to a directory on the host file system.
               Any files that you specify with the 'path' attribute, unless absolute, must be relative to this directory.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="keystore-password">
         <xs:annotation>
            <xs:documentation>
               Deprecated: use the 'password' attribute instead.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="password">
         <xs:annotation>
            <xs:documentation>
               The password required to open the keystore. If the keystore is a PEM file, this should be specified as an
               empty string.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="alias">
         <xs:annotation>
            <xs:documentation>
               The alias of the entry in the keystore to use as the server identity.
               Only required if there are multiple entries in the keystore.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="key-password">
         <xs:annotation>
            <xs:documentation>
               A password required to access a specific entry within the keystore. Only needed if the keystore type
               supports it and the entries have been protected by an additional password.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="generate-self-signed-certificate-host">
         <xs:annotation>
            <xs:documentation>
               If this attribute is set and if the file that backs the KeyStore does not exist, then
               a self-signed certificate will be generated on first use and it will be persisted to
               the file that backs the KeyStore. The value of this attribute will be used for the
               Common Name value in the self-signed certificate.

               The use of this attribute is intended for testing purposes only. This attribute is not
               intended for production use.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="provider">
         <xs:annotation>
            <xs:documentation>
               The name of the provider to use to instantiate the KeyManagerFactory. If the provider is not
               specified, and OpenSSL is available and supported on the platform and architecture, the
               'openssl' provider will be used. Otherwise the first provider found that can create an instance of the
               specified 'type' will be used.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="type">
         <xs:annotation>
            <xs:documentation>
               The type of the keystore. Normally the type will be auto-detected. This attribute is required for
               file-less keystores, for example when using the `SunPKCS11-nss-fips` provider.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>
   <xs:complexType name="security-realm-truststore">
      <xs:sequence>
         <xs:element type="tns:credential-reference" name="credential-reference" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="path">
         <xs:annotation>
            <xs:documentation>
               Specifies the location of the truststore on the host file system. You can set a relative or absolute value.
               If you set a relative value, configure a value for the 'relative-to' attribute.
               The type of the keystore will be auto-detected among JKS, JCEKS, PKCS12 or PEM.
               BKS, BCFKS and UBER are also supported if the `bouncycastle` libary is present.
               The path may be omitted when using global store providers, such as 'SunPKCS11-NSS-FIPS'.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="relative-to" default="infinispan.server.config.path">
      <xs:annotation>
         <xs:documentation>
            Specifies a property name that resolves to a directory on the host file system.
            Any files that you specify with the 'path' attribute, unless absolute, must be relative to this directory.
         </xs:documentation>
      </xs:annotation>
   </xs:attribute>
      <xs:attribute type="xs:string" name="password">
         <xs:annotation>
            <xs:documentation>
               The password required to open the truststore. If the truststore is a PEM file, this should be specified as an
               empty string.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="provider">
         <xs:annotation>
            <xs:documentation>
               The name of the provider to use to instantiate the TrustManagerFactory. If the provider is not
               specified, and OpenSSL is available and supported on the platform and architecture, the
               'openssl' provider will be used. Otherwise the first provider found that can create an instance of the
               specified 'type' will be used.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="type">
         <xs:annotation>
            <xs:documentation>
               The type of the truststore. Normally the type will be auto-detected. This attribute is required for
               file-less truststores, for example when using the `SunPKCS11-nss-fips` provider.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>
   <xs:complexType name="security-realm-ssl-engine">
      <xs:attribute type="tns:name-list" name="enabled-protocols"/>
      <xs:attribute type="xs:string" name="enabled-ciphersuites" default="DEFAULT">
         <xs:annotation>
            <xs:documentation>
               The filter to be applied to the cipher suites made available by this SSL engine.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="enabled-ciphersuites-tls13" default="TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256">
         <xs:annotation>
            <xs:documentation>
               The ciphersuite names to use for the TLSv1.3 engine.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="security-realm-properties">
      <xs:sequence>
         <xs:element type="tns:security-realm-user-properties" name="user-properties"/>
         <xs:element type="tns:security-realm-group-properties" name="group-properties"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="name">
         <xs:annotation>
            <xs:documentation>
               Names the security realm to logically separate multiple realms of the same type.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="groups-attribute"/>
   </xs:complexType>

   <xs:complexType name="security-realm-user-properties">
      <xs:attribute type="xs:string" name="path" use="required"/>
      <xs:attribute type="xs:string" name="relative-to"/>
      <xs:attribute type="xs:string" name="digest-realm-name"/>
      <xs:attribute type="xs:boolean" name="plain-text" default="false"/>
   </xs:complexType>

   <xs:complexType name="security-realm-group-properties">
      <xs:attribute type="xs:string" name="path" use="required"/>
      <xs:attribute type="xs:string" name="relative-to"/>
   </xs:complexType>

   <xs:complexType name="security-realm-ldap">
      <xs:annotation>
         <xs:documentation>
            Defines an LDAP security realm.
         </xs:documentation>
      </xs:annotation>
      <xs:sequence>
         <xs:element type="tns:credential-reference" name="credential-reference" minOccurs="0"/>
         <xs:element type="tns:ldap-name-rewriter" name="name-rewriter" minOccurs="0"/>
         <xs:element type="tns:ldap-identity-mapping" name="identity-mapping" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="name">
         <xs:annotation>
            <xs:documentation>
               Names the security realm to logically separate multiple realms of the same type.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="url" use="required">
         <xs:annotation>
            <xs:documentation>
               Specifies the URL for LDAP server connections in the format ldap[s]://{hostname}:{port}.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="principal">
         <xs:annotation>
            <xs:documentation>
               Specifies the user principal for LDAP server connections.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="credential">
         <xs:annotation>
            <xs:documentation>
               Specifies the user credential for LDAP server connections.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:boolean" name="direct-verification">
         <xs:annotation>
            <xs:documentation>
              Configures the realm to verify credentials by connecting to LDAP servers with the account. Values are true / false (default).
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:int" name="page-size" default="50">
         <xs:annotation>
            <xs:documentation>
               Sets the page size for realm iteration. The default value is 50.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:boolean" name="enable-connection-pooling" default="false">
         <xs:annotation>
            <xs:documentation>
               Enables connection pooling.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="tns:referral-list" name="referral-mode" default="follow">
         <xs:annotation>
            <xs:documentation>
               Specifies if LDAP server referrals are followed and corresponds
               to the REFERRAL ("java.naming.referral") environment property.
               Values are "ignore", "follow" (default), and "throw".
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:integer" name="connection-timeout" default="5000">
         <xs:annotation>
            <xs:documentation>
               Sets the timeout, in milliseconds, for LDAP server connections.
               The default value is 5 seconds.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:integer" name="read-timeout" default="60000">
         <xs:annotation>
            <xs:documentation>
               Sets the read timeout, in milliseconds, for LDAP server
               operations. The default value is 1 minute.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="client-ssl-context">
         <xs:annotation>
            <xs:documentation>
               The name of a realm which provides a trust store with which to validate SSL client connections.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="ldap-name-rewriter">
      <xs:annotation>
         <xs:documentation>
            Specifies a LDAP name rewriter that transforms names returned by
            LDAP servers.
         </xs:documentation>
      </xs:annotation>
      <xs:choice>
         <xs:element type="tns:regex-principal-transformer" name="regex-principal-transformer"/>
      </xs:choice>
   </xs:complexType>

   <xs:complexType name="principal-transformer" abstract="true">
      <xs:annotation>
         <xs:documentation>
            Specifies the base type for all PrincipalTransformer definitions.
         </xs:documentation>
      </xs:annotation>
      <xs:attribute name="name" type="xs:string">
         <xs:annotation>
            <xs:documentation>
               Deprecated. Will be ignored.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="regex-principal-transformer">
      <xs:annotation>
         <xs:documentation>
            Specifies a PrincipalTransformer definition using regular expressions and Matcher based replacement.
         </xs:documentation>
      </xs:annotation>
      <xs:complexContent>
         <xs:extension base="principal-transformer">
            <xs:attribute name="pattern" type="xs:string" use="required">
               <xs:annotation>
                  <xs:documentation>
                     Specifies the regular expression for this PrincipalTransformer.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="replacement" type="xs:string" use="required">
               <xs:annotation>
                  <xs:documentation>
                     Specifies the replacement string for the PrincipalTransformer.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
            <xs:attribute name="replace-all" type="xs:boolean" default="false">
               <xs:annotation>
                  <xs:documentation>
                     Replaces all occurrences instead of the first occurrence.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="ldap-identity-mapping">
      <xs:annotation>
         <xs:documentation>
            Specifies configuration options that define how principals are
            mapped to corresponding entries in LDAP servers.
         </xs:documentation>
      </xs:annotation>
      <xs:sequence>
         <xs:element type="tns:ldap-attribute-mapping" name="attribute-mapping" minOccurs="0"/>
         <xs:element type="tns:ldap-user-password-mapper" name="user-password-mapper" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="search-dn">
         <xs:annotation>
            <xs:documentation>
               Names the context for query execution. This option provides a
               useful method to authenticate users based on names that do not
               use X.500 format, such as "plainUser". In this case, you must
               also specify the rdn-identifier. If names to authenticate users
               are based on the X.500 format, you can suppress this
               configuration. You should also note that this option lets realms
               authenticate users based on simple, or X.500, names.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="rdn-identifier">
         <xs:annotation>
            <xs:documentation>
               Specifies an LDAP attribute that contains the user name and
               appears in the path of new entries.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="search-recursive" type="xs:boolean" default="false">
         <xs:annotation>
            <xs:documentation>
               Performs recursive queries.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="search-time-limit" type="xs:int" default="10000">
         <xs:annotation>
            <xs:documentation>
               The time limit of LDAP search in milliseconds. Defaults to 10000 ms.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="filter-name" type="xs:string" default="(rdn_identifier={0})">
         <xs:annotation>
            <xs:documentation>
               Specifies the LDAP filter that retrieves an identity by name.
               In the default value, "{0}" is replaced with the searched identity name and "rdn_identifier" is replaced with the value of the "rdn-identifier" attribute.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="ldap-attribute-mapping">
      <xs:annotation>
         <xs:documentation>
            Specifies the attribute mappings defined for this resource.
         </xs:documentation>
      </xs:annotation>
      <xs:sequence>
         <xs:choice maxOccurs="unbounded">
            <xs:element type="tns:ldap-attribute-filter" name="attribute"/>
            <xs:element type="tns:ldap-attribute-reference" name="attribute-reference"/>
         </xs:choice>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="ldap-attribute-filter">
      <xs:complexContent>
         <xs:extension base="tns:ldap-attribute">
            <xs:attribute type="xs:string" name="filter" use="required">
               <xs:annotation>
                  <xs:documentation>
                     The filter to use to obtain the values for a specific attribute.
                     String "{0}" will be replaced by username, "{1}" by user identity DN.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="ldap-attribute-reference">
      <xs:complexContent>
         <xs:extension base="tns:ldap-attribute">
            <xs:attribute type="xs:string" name="reference" use="required">
               <xs:annotation>
                  <xs:documentation>
                     The name of an LDAP attribute containing DN of entry to obtain value from.
                  </xs:documentation>
               </xs:annotation>
            </xs:attribute>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="ldap-attribute" abstract="true">
      <xs:attribute type="xs:string" name="filter-dn">
         <xs:annotation>
            <xs:documentation>
               The name of the context where the filter should be performed.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="from">
         <xs:annotation>
            <xs:documentation>
               The name of the LDAP attribute to map to an identity attribute.
               If not defined, DN of the whole entry is used as value.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="to">
         <xs:annotation>
            <xs:documentation>
               The name of the identity attribute mapped from a specific LDAP attribute.
               If not provided, the name of the attribute is the same as define in 'from'.
               If the 'from' is not defined too, value 'dn' is used.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:boolean" name="search-recursive" default="true">
         <xs:annotation>
            <xs:documentation>
               Indicates if attribute LDAP search queries are recursive.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:int" name="role-recursion" default="0">
         <xs:annotation>
            <xs:documentation>
               Sets recursive roles assignment - value determine maximum depth of recursion. (0 for no recursion)
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="role-recursion-name" default="cn">
         <xs:annotation>
            <xs:documentation>
               Determine LDAP attribute of role entry which will be substitute for "{0}" in filter-name when searching roles of role.
               Used only when role-recursion is set.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="extract-rdn">
         <xs:annotation>
            <xs:documentation>
               The RDN key to use as the value for an attribute, in case the value in its raw form is in X.500 format.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="ldap-user-password-mapper">
      <xs:annotation>
         <xs:documentation>
            Specifies the user password credential mapping defined for this
            resource.
         </xs:documentation>
      </xs:annotation>
      <xs:attribute type="xs:string" name="from">
         <xs:annotation>
            <xs:documentation>
               The name of the LDAP attribute to map to an identity user password credential.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:boolean" name="verifiable">
         <xs:annotation>
            <xs:documentation>
               If the password credential is verifiable.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:simpleType name="referral-list">
      <xs:list>
         <xs:simpleType>
            <xs:restriction base="xs:token">
               <xs:enumeration value="ignore"/>
               <xs:enumeration value="follow"/>
               <xs:enumeration value="throw"/>
            </xs:restriction>
         </xs:simpleType>
      </xs:list>
   </xs:simpleType>

   <xs:complexType name="security-realm-token">
      <xs:choice>
         <xs:element type="tns:jwt" name="jwt"/>
         <xs:element type="tns:oauth2-introspection" name="oauth2-introspection"/>
      </xs:choice>
      <xs:attribute type="xs:string" name="name" use="required"/>
      <xs:attribute type="xs:string" name="auth-server-url" use="required"/>
      <xs:attribute type="xs:string" name="client-id" use="required"/>
      <xs:attribute type="xs:string" name="principal-claim" default="username"/>
   </xs:complexType>

   <xs:complexType name="jwt">
      <xs:attribute type="tns:name-list" name="issuer">
         <xs:annotation>
            <xs:documentation>
               Defines one or more string values representing an unique identifier for the entities that are allowed as
               issuers of a given JWT. During validation JWT tokens must have a iss claim that contains one of the values defined here.
               If not provided, the validator will not perform validations based on the issuer claim.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="tns:name-list" name="audience">
         <xs:annotation>
            <xs:documentation>
               Defines one or more string values representing the audiences supported by this configuration.
               During validation JWT tokens must have an aud claim that contains one of the values defined here.
               If not provided, the validator will not perform validations based on the audience claim.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="public-key">
         <xs:annotation>
            <xs:documentation>
               A default public key in its PEM format used to validate the signature of tokens without kid header parameter.
               If not provided, the validator will not validate signatures.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:long" name="jku-timeout" default="120000">
         <xs:annotation>
            <xs:documentation>
               A timeout, in milliseconds for cached jwks when using jku claim.
               After this timeout, the keys of need to be re-cached before use. Default value is 2 minutes.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:integer" name="connection-timeout" default="2000">
         <xs:annotation>
            <xs:documentation>
               Sets the timeout, in milliseconds, for connections to the JKU server.
               The default value is 2 seconds.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:integer" name="read-timeout" default="2000">
         <xs:annotation>
            <xs:documentation>
               Sets the read timeout, in milliseconds, for the JKU server.
               operations. The default value is 2 seconds.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="client-ssl-context">
         <xs:annotation>
            <xs:documentation>
               The name of a realm which provides a trust store with which to validate SSL client connections.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="host-name-verification-policy">
         <xs:annotation>
            <xs:documentation>
               A HostnameVerifier that will be used to validate the hostname when using SSL/TLS.
               This configuration is mandatory if using jku claims. Can be ANY or DEFAULT.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="oauth2-introspection">
      <xs:sequence>
         <xs:element type="tns:credential-reference" name="credential-reference" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="client-id" use="required">
         <xs:annotation>
            <xs:documentation>
               The identifier of a client registered within the OAuth2 Authorization Server that will be used to
               authenticate this server in order to validate bearer tokens arriving to this server.
               Please note that the client will be usually a confidential client with both an identifier and secret
               configured in order to authenticate against the token introspection endpoint. In this case, the endpoint
               must support HTTP BASIC authentication using the client credentials (both id and secret).
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="client-secret">
         <xs:annotation>
            <xs:documentation>
               The secret of the client identified by the given clientId.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="introspection-url" use="required">
         <xs:annotation>
            <xs:documentation>
               An URL pointing to a RFC-7662 OAuth2 Token Introspection compatible endpoint.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:integer" name="connection-timeout" default="2000">
         <xs:annotation>
            <xs:documentation>
               Sets the timeout, in milliseconds, for connections to the OAuth2 server.
               The default value is 2 seconds.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:integer" name="read-timeout" default="2000">
         <xs:annotation>
            <xs:documentation>
               Sets the read timeout, in milliseconds, for the OAuth2 server.
               operations. The default value is 2 seconds.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="client-ssl-context">
         <xs:annotation>
            <xs:documentation>
               The name of a realm which provides a trust store with which to validate SSL client connections.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute type="xs:string" name="host-name-verification-policy">
         <xs:annotation>
            <xs:documentation>
               A HostnameVerifier that will be used to validate the hostname when using SSL/TLS.
               This configuration is mandatory if the given token introspection url is using SSL/TLS. Can be ANY or DEFAULT.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="security-realm-filesystem">
      <xs:attribute type="xs:string" name="name" default="filesystem"/>
      <xs:attribute type="xs:string" name="path" use="required"/>
      <xs:attribute type="xs:string" name="relative-to" default="infinispan.server.data.path"/>
      <xs:attribute type="xs:int" name="levels" default="0"/>
      <xs:attribute type="xs:boolean" name="encoded" default="true"/>
   </xs:complexType>

   <xs:complexType name="security-realm-local">
      <xs:attribute type="xs:string" name="name" default="local"/>
   </xs:complexType>

   <xs:complexType name="security-realm-kerberos">
      <xs:attribute name="principal" type="xs:string" use="required">
         <xs:annotation>
            <xs:documentation>
               Specifies the principal that the KeyTab represents.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="keytab-path" type="xs:string" use="required">
         <xs:annotation>
            <xs:documentation>
               Sets the path to the KeyTab for retrieving credentials.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="relative-to" type="xs:string">
         <xs:annotation>
            <xs:documentation>
               Specifies the name of a named path or a standard path that the
               system provides. If set, the value of the "path" attribute
               becomes relative to this path.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="minimum-remaining-lifetime" type="xs:int" default="0">
         <xs:annotation>
            <xs:documentation>
               Specifies, in seconds, how long a cached credential can remain before it is recreated.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="request-lifetime" type="xs:int">
         <xs:annotation>
            <xs:documentation>
               Specifies, in seconds, how much lifetime to request for newly
               created credentials.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="fail-cache" type="xs:int">
         <xs:annotation>
            <xs:documentation>
               Specifies the amount of time, in seconds, to wait before
               attempting to obtain server credential if the previous attempt
               failed. Prevents long waiting periods on every authentication
               attempt if the KDC is unavailable.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="server" type="xs:boolean" default="true">
         <xs:annotation>
            <xs:documentation>
               Specifies if the realm is server-side (default) or client-side.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="obtain-kerberos-ticket" type="xs:boolean" default="false">
         <xs:annotation>
            <xs:documentation>
               Controls if a KerberosTicket is also obtained and associated
               with the credential. The value must be true if credentials are
               delegated to the server.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="debug" type="xs:boolean" default="false">
         <xs:annotation>
            <xs:documentation>
               Defines if the JAAS step to obtain the credential has debug
               logging enabled.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="wrap-gss-credential" type="xs:boolean" default="false">
         <xs:annotation>
            <xs:documentation>
               Specifies if generated GSS credentials are wrapped to prevent
               improper disposal.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="required" type="xs:boolean" default="false">
         <xs:annotation>
            <xs:documentation>
               Specifies if the keytab file with adequate principal must exist
               when the service starts.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="mechanism-names" type="tns:name-list" default="KRB5 SPNEGO">
         <xs:annotation>
            <xs:documentation>
               Defines the mechanism names with which the credential can be
               used. Names are converted to OIDs and used together with OIDs
               from the mechanism-oids attribute.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
      <xs:attribute name="mechanism-oids" type="tns:name-list">
         <xs:annotation>
            <xs:documentation>
               Defines the mechanism OIDs with which the credential can be
               used. Used with OIDs derived from names from the mechanism-names
               attribute.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:complexType name="security-realm-trust">
      <xs:attribute type="xs:string" name="name"/>
   </xs:complexType>

   <xs:complexType name="security-realm-distributed">
      <xs:annotation>
         <xs:documentation>
            A realm definition for authentication and authorization of identities distributed between multiple realms.
         </xs:documentation>
      </xs:annotation>
      <xs:attribute type="xs:string" name="name"/>
      <xs:attribute name="realms" type="tns:name-list">
         <xs:annotation>
            <xs:documentation>
               A list of security realms that should be used for authentication until one succeeds.
               If no realms are specified, all of the available realms will be used.
            </xs:documentation>
         </xs:annotation>
      </xs:attribute>
   </xs:complexType>

   <xs:attribute name="security-realm" type="xs:string">
      <xs:annotation>
         <xs:documentation>
            Defines a security-realm which will be used to secure the resource.
            It may be used on the cache-container transport element.
         </xs:documentation>
      </xs:annotation>
   </xs:attribute>
</xs:schema>
