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

<!--
  ~ Copyright The WildFly Authors
  ~ SPDX-License-Identifier: Apache-2.0
  -->
<xs:schema targetNamespace="urn:jboss:domain:infinispan:1.0"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:tns="urn:jboss:domain:infinispan:1.0"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            version="1.0">

    <xs:element name="subsystem" type="tns:subsystem">
        <xs:annotation>
            <xs:documentation>Enumerates the cache containers available to the registry.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="subsystem">
        <xs:sequence>
            <xs:element name="cache-container" type="tns:cache-container" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>Defines an embedded cache container.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="default-cache-container" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>Identifies the default cache container.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="cache-container">
        <xs:sequence>
            <xs:element name="alias" type="xs:string" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>Defines an additional name by which this cache container may be referenced.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="transport" type="tns:transport" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Overrides the transport characteristics for this cache container.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:choice maxOccurs="unbounded">
                <xs:element name="local-cache" type="tns:local-cache">
                    <xs:annotation>
                        <xs:documentation>Defines a LOCAL mode cache.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="replicated-cache" type="tns:replicated-cache">
                    <xs:annotation>
                        <xs:documentation>Defines a REPL_* mode cache.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="invalidation-cache" type="tns:invalidation-cache">
                    <xs:annotation>
                        <xs:documentation>Defines an INVALIDATION_* mode cache.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="distributed-cache" type="tns:distributed-cache">
                    <xs:annotation>
                        <xs:documentation>Defines a DIST_* mode cache.</xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:choice>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>Uniquely identifies this cache container.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="jndi-name" type="xs:string">
            <xs:annotation>
                <xs:documentation>The jndi name to which to bind this cache container.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="default-cache" type="xs:string">
            <xs:annotation>
                <xs:documentation>Indicates the default cache for this cache container.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="listener-executor" type="xs:string">
            <xs:annotation>
                <xs:documentation>Defines the executor used for asynchronous cache listener notifications.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="eviction-executor" type="xs:string">
            <xs:annotation>
                <xs:documentation>Defines the scheduled executor used for evictions.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="replication-queue-executor" type="xs:string">
            <xs:annotation>
                <xs:documentation>Defines the scheduled executor used by the asynchronous replication queue.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="transport">
        <xs:attribute name="stack" type="xs:string">
            <xs:annotation>
                <xs:documentation>Defines the jgroups stack used by the transport.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="executor" type="xs:string" >
            <xs:annotation>
                <xs:documentation>Defines the executor used for asynchronous transport communication.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="lock-timeout" type="xs:long" default="60000">
            <xs:annotation>
                <xs:documentation>
                    Infinispan uses a distributed lock to maintain a coherent transaction log during state transfer or rehashing, which means that only one cache can be doing state transfer or rehashing at the same time.
                    This constraint is in place because more than one cache could be involved in a transaction.
                    This timeout controls the time to wait to acquire acquire a lock on the distributed lock.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="site" type="xs:string">
            <xs:annotation>
                <xs:documentation>Identifies the site where this node runs.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="rack" type="xs:string">
            <xs:annotation>
                <xs:documentation>Identifies the rack where this node runs.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="machine" type="xs:string">
            <xs:annotation>
                <xs:documentation>Identifies the machine where this node runs.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="cache" abstract="true">
        <xs:sequence>
            <xs:element name="locking" type="tns:locking" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>The locking configuration of the cache.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="transaction" type="tns:transaction" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>The cache transaction configuration.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="eviction" type="tns:eviction" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>The cache eviction configuration.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="expiration" type="tns:expiration" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>The cache expiration configuration.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:choice minOccurs="0">
                <xs:element name="store" type="tns:custom-store">
                    <xs:annotation>
                        <xs:documentation>Defines a custom cache store.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="file-store" type="tns:file-store">
                    <xs:annotation>
                        <xs:documentation>Defines a file-based cache store.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="jdbc-store" type="tns:jdbc-store">
                    <xs:annotation>
                        <xs:documentation>Defines a database cache store accessed via JDBC.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="remote-store" type="tns:remote-store">
                    <xs:annotation>
                        <xs:documentation>
                            Defines a remote cache store accessed via HotRod.
                            Nested properties will be treated as HotRod client properties.
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:choice>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>Uniquely identifies this cache within its cache container.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="start" type="tns:controller-mode" default="LAZY">
            <xs:annotation>
                <xs:documentation>Should this cache be started on server startup, or lazily when requested by a service or deployment.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="batching" type="xs:boolean" default="false">
            <xs:annotation>
                <xs:documentation>
                    Use batching to group cache operations together. Defaults to false.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="indexing" type="tns:indexing" default="NONE">
            <xs:annotation>
                <xs:documentation>
                    The indexing mode of the cache. Defaults to NONE.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="local-cache">
        <xs:complexContent>
            <xs:extension base="tns:cache"/>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="locking">
        <xs:attribute name="isolation" type="tns:isolation" default="READ_COMMITTED">
            <xs:annotation>
                <xs:documentation>Sets the cache locking isolation level.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="striping" type="xs:boolean" default="false">
            <xs:annotation>
                <xs:documentation>If true, a pool of shared locks is maintained for all entries that need to be locked. Otherwise, a lock is created per entry in the cache. Lock striping helps control memory footprint but may reduce concurrency in the system.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="acquire-timeout" type="xs:long" default="15000">
            <xs:annotation>
                <xs:documentation>Maximum time to attempt a particular lock acquisition.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="concurrency-level" type="xs:int" default="1000">
            <xs:annotation>
                <xs:documentation>Concurrency level for lock containers. Adjust this value according to the number of concurrent threads interacting with Infinispan.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="transaction">
        <xs:attribute name="mode" type="tns:transaction-mode" default="NON_XA">
            <xs:annotation>
                <xs:documentation>Sets the cache transaction mode to one of NONE, NON_XA, NON_DURABLE_XA, FULL_XA.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="stop-timeout" type="xs:long" default="10000">
            <xs:annotation>
                <xs:documentation>If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish. The amount of time to wait for is defined by the cache stop timeout.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="eager-locking" type="tns:eager-locking" default="SINGLE">
            <xs:annotation>
                <xs:documentation></xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="eviction">
        <xs:attribute name="strategy" type="tns:eviction-strategy" default="NONE">
            <xs:annotation>
                <xs:documentation>Sets the cache eviction strategy. Available options are 'UNORDERED', 'FIFO', 'LRU', 'LIRS' and 'NONE' (to disable eviction).</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="max-entries" type="xs:int" default="-1">
            <xs:annotation>
                <xs:documentation>Maximum number of entries in a cache instance. If selected value is not a power of two the actual value will default to the least power of two larger than selected value. -1 means no limit.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="expiration">
        <xs:attribute name="max-idle" type="xs:long" default="-1">
            <xs:annotation>
                <xs:documentation>Maximum idle time a cache entry will be maintained in the cache, in milliseconds. If the idle time is exceeded, the entry will be expired cluster-wide. -1 means the entries never expire.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="lifespan" type="xs:long" default="-1">
            <xs:annotation>
                <xs:documentation>Maximum lifespan of a cache entry, after which the entry is expired cluster-wide, in milliseconds. -1 means the entries never expire.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="interval" type="xs:long" default="60000">
            <xs:annotation>
                <xs:documentation>Interval (in milliseconds) between subsequent runs to purge expired entries from memory and any cache stores. If you wish to disable the periodic eviction process altogether, set wakeupInterval to -1.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="clustered-cache" abstract="true">
        <xs:complexContent>
            <xs:extension base="tns:cache">
                <xs:attribute name="mode" type="tns:mode" use="required">
                    <xs:annotation>
                        <xs:documentation>Sets the clustered cache mode, ASYNC for asynchronous operation, or SYNC for synchronous operation.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="queue-size" type="xs:int" default="1000">
                    <xs:annotation>
                        <xs:documentation>In ASYNC mode, this attribute can be used to trigger flushing of the queue when it reaches a specific threshold.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="queue-flush-interval" type="xs:long" default="10">
                    <xs:annotation>
                        <xs:documentation>In ASYNC mode, this attribute controls how often the asynchronous thread used to flush the replication queue runs. This should be a positive integer which represents thread wakeup time in milliseconds.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="remote-timeout" type="xs:long" default="10000">
                    <xs:annotation>
                        <xs:documentation>In SYNC mode, the timeout (in ms) used to wait for an acknowledgment when making a remote call, after which the call is aborted and an exception is thrown.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="invalidation-cache">
        <xs:complexContent>
            <xs:extension base="tns:clustered-cache"/>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="replicated-cache">
        <xs:complexContent>
            <xs:extension base="tns:clustered-cache">
                <xs:sequence>
                    <xs:element name="state-transfer" type="tns:state-transfer" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>The state transfer configuration for distribution and replicated caches.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="distributed-cache">
        <xs:complexContent>
            <xs:extension base="tns:clustered-cache">
                <xs:sequence>
                    <xs:element name="rehashing" type="tns:rehashing" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>Rehashing configuration.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
                <xs:attribute name="owners" type="xs:int" default="2">
                    <xs:annotation>
                        <xs:documentation>Number of cluster-wide replicas for each cache entry.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="virtual-nodes" type="xs:int" default="1">
                    <xs:annotation>
                        <xs:documentation>Controls the number of virtual nodes per "real" node.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="l1-lifespan" type="xs:long" default="600000">
                    <xs:annotation>
                        <xs:documentation>Maximum lifespan in milliseconds of an entry placed in the L1 cache.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="store" abstract="true">
        <xs:sequence>
            <xs:element name="property" type="tns:property" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>A cache store property with name and value.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="shared" type="xs:boolean" default="false">
            <xs:annotation>
                <xs:documentation>This setting should be set to true when multiple cache instances share the same cache store (e.g., multiple nodes in a cluster using a JDBC-based CacheStore pointing to the same, shared database.) Setting this to true avoids multiple cache instances writing the same modification multiple times. If enabled, only the node where the modification originated will write to the cache store. If disabled, each individual cache reacts to a potential remote update by storing the data to the cache store.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="preload" type="xs:boolean" default="false">
            <xs:annotation>
                <xs:documentation>If true, when the cache starts, data stored in the cache store will be pre-loaded into memory. This is particularly useful when data in the cache store will be needed immediately after startup and you want to avoid cache operations being delayed as a result of loading this data lazily. Can be used to provide a 'warm-cache' on startup, however there is a performance penalty as startup time is affected by this process.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="passivation" type="xs:boolean" default="true">
            <xs:annotation>
                <xs:documentation>If true, data is only written to the cache store when it is evicted from memory, a phenomenon known as 'passivation'. Next time the data is requested, it will be 'activated' which means that data will be brought back to memory and removed from the persistent store. If false, the cache store contains a copy of the contents in memory, so writes to cache result in cache store writes. This essentially gives you a 'write-through' configuration.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="fetch-state" type="xs:boolean" default="true">
            <xs:annotation>
                <xs:documentation>If true, fetch persistent state when joining a cluster. If multiple cache stores are chained, only one of them can have this property enabled.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="purge" type="xs:boolean" default="true">
            <xs:annotation>
                <xs:documentation>If true, purges this cache store when it starts up.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="singleton" type="xs:boolean" default="false">
            <xs:annotation>
                <xs:documentation>If true, the singleton store cache store is enabled. SingletonStore is a delegating cache store used for situations when only one instance in a cluster should interact with the underlying store.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="custom-store">
        <xs:complexContent>
            <xs:extension base="tns:store">
                <xs:attribute name="class" type="xs:string" use="required">
                    <xs:annotation>
                        <xs:documentation>The class name of the cache store implementation.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="file-store">
        <xs:complexContent>
            <xs:extension base="tns:store">
                <xs:attribute name="relative-to" type="xs:string" default="jboss.server.data.dir">
                    <xs:annotation>
                        <xs:documentation>The base directory in which to store the cache state.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="path" type="xs:string">
                    <xs:annotation>
                        <xs:documentation>
                            The path within "relative-to" in which to store the cache state.
                            If undefined, the path defaults to the cache container name.
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="remote-store">
        <xs:complexContent>
            <xs:extension base="tns:store">
                <xs:sequence>
                    <xs:element name="remote-server" type="tns:remote-server" minOccurs="1" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="cache" type="xs:string">
                    <xs:annotation>
                        <xs:documentation>The name of the remote cache.  If undefined, the default cache will be used.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="socket-timeout" type="xs:long" default="60000">
                    <xs:annotation>
                        <xs:documentation>
                            Enable/disable SO_TIMEOUT on socket connections to remote Hot Rod servers with the specified timeout, in milliseconds.
                            A timeout of zero is interpreted as an infinite timeout.
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="tcp-no-delay" type="xs:boolean" default="true">
                    <xs:annotation>
                        <xs:documentation>
                            Enable/disable TCP_NODELAY on socket connections to remote Hot Rod servers.
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="remote-server">
       <xs:attribute name="outbound-socket-binding">
           <xs:annotation>
               <xs:documentation>An outbound socket binding for a remote server.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
    </xs:complexType>

    <xs:complexType name="jdbc-store">
        <xs:complexContent>
            <xs:extension base="tns:store">
                <xs:sequence>
                    <xs:element name="bucket-table" type="tns:bucket-table" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>
                                Defines the table used to store cache buckets.
                                If an entry-table is also defined, a mixed-mode cache store will be used.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="entry-table" type="tns:entry-table" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>
                                Defines the table used to store cache entries.
                                If a bucket-table is also defined, a mixed-mode cache store will be used.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
                <xs:attribute name="datasource" type="xs:string" use="required">
                    <xs:annotation>
                        <xs:documentation>Defines the jndi name of the datasource.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="entry-table">
        <xs:complexContent>
            <xs:extension base="tns:table">
                <xs:attribute name="prefix" type="xs:string" default="ispn_entry">
                    <xs:annotation>
                        <xs:documentation>Defines the prefix prepended to the cache name used when composing the name of the cache entry table.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="bucket-table">
        <xs:complexContent>
            <xs:extension base="tns:table">
                <xs:attribute name="prefix" type="xs:string" default="ispn_bucket">
                    <xs:annotation>
                        <xs:documentation>Defines the prefix prepended to the cache name used when composing the name of the cache bucket table.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="table">
        <xs:sequence>
            <xs:element name="id-column" type="tns:id-column" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Defines the column in which to store the cache key or bucket id.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="data-column" type="tns:data-column" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Defines the column in which to store the cache entry or bucket.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="timestamp-column" type="tns:timestamp-column" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Defines the column in which to store the timestamp of the cache entry or bucket.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="fetch-size" type="xs:int" default="100">
            <xs:annotation>
                <xs:documentation>The fetch size used when querying from this table.  Used to avoid heap memory exhaustion when query is large.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="batch-size" type="xs:int" default="100">
            <xs:annotation>
                <xs:documentation>The statement batch size used when modifying this table.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="id-column">
        <xs:attribute name="name" type="xs:string" default="id">
            <xs:annotation>
                <xs:documentation>The name of the column used to store the cache key or bucket id.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="type" type="xs:string" default="VARCHAR">
            <xs:annotation>
                <xs:documentation>The type of the column used to store the cache key or bucket id.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="data-column">
        <xs:attribute name="name" type="xs:string" default="datum">
            <xs:annotation>
                <xs:documentation>The name of the column used to store the cache entry or bucket.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="type" type="xs:string" default="BINARY">
            <xs:annotation>
                <xs:documentation>The type of the column used to store the cache entry or bucket.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="timestamp-column">
        <xs:attribute name="name" type="xs:string" default="version">
            <xs:annotation>
                <xs:documentation>The name of the column used to store the cache entry or bucket timestamp.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="type" type="xs:string" default="BIGINT">
            <xs:annotation>
                <xs:documentation>The type of the column used to store the cache entry or bucket timestamp.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="state-transfer">
        <xs:attribute name="enabled" type="xs:boolean" default="true">
            <xs:annotation>
                <xs:documentation>If enabled, this will cause the cache to ask neighboring caches for state when it starts up, so the cache starts 'warm', although it will impact startup time.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="timeout" type="xs:long" default="240000">
            <xs:annotation>
                <xs:documentation>The maximum amount of time (ms) to wait for state from neighboring caches, before throwing an exception and aborting startup.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="flush-timeout" type="xs:long" default="60000">
            <xs:annotation>
                <xs:documentation></xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="rehashing">
        <xs:attribute name="enabled" type="xs:boolean" default="true">
            <xs:annotation>
                <xs:documentation></xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="timeout" type="xs:long" default="600000">
            <xs:annotation>
                <xs:documentation></xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <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:simpleType name="isolation">
        <xs:restriction base="xs:token">
            <xs:enumeration value="NONE">
                <xs:annotation>
                    <xs:documentation>
                        No locking isolation will be performed. This is only valid in local mode. In clustered mode, READ_COMMITTED will be used instead.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="READ_UNCOMMITTED">
                <xs:annotation>
                    <xs:documentation>
                        Unsupported. Actually configures READ_COMMITTED.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="READ_COMMITTED">
                <xs:annotation>
                    <xs:documentation>
                        Read committed is an isolation level that guarantees that any data read is committed at the moment it is read. However, depending on the outcome of other transactions, successive reads may return different results.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="REPEATABLE_READ">
                <xs:annotation>
                    <xs:documentation>
                        Repeatable read is an isolation level that guarantees that any data read is committed at the moment it is read and that, within a transaction, successive reads will always return the same data.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="SERIALIZABLE">
                <xs:annotation>
                    <xs:documentation>
                        Unsupported. Actually configures REPEATABLE_READ.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="transaction-mode">
        <xs:restriction base="xs:token">
            <xs:enumeration value="NON_XA">
                <xs:annotation>
                    <xs:documentation>Cache will enlist within transactions as a javax.transaction.Synchronization</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="NON_DURABLE_XA">
                <xs:annotation>
                    <xs:documentation>Cache will enlist within transactions as a javax.transaction.xa.XAResource, without recovery.</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="FULL_XA">
                <xs:annotation>
                    <xs:documentation>Cache will enlist within transactions as a javax.transaction.xa.XAResource, with recovery.</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="eager-locking">
        <xs:restriction base="xs:token">
            <xs:enumeration value="NONE">
                <xs:annotation>
                    <xs:documentation></xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="SINGLE">
                <xs:annotation>
                    <xs:documentation></xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="ALL">
                <xs:annotation>
                    <xs:documentation></xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="indexing">
        <xs:restriction base="xs:token">
            <xs:enumeration value="NONE">
                <xs:annotation>
                    <xs:documentation>
                        Do not index data. This is the default.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="LOCAL">
                <xs:annotation>
                    <xs:documentation>
                        Only index changes made locally, ignoring remote changes. This is useful if indexes are shared across a cluster to prevent redundant indexing of updates.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="ALL">
                <xs:annotation>
                    <xs:documentation>
                        Index all data.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="eviction-strategy">
        <xs:restriction base="xs:token">
            <xs:enumeration value="NONE">
                <xs:annotation>
                    <xs:documentation>
                        Never evict entries. This is the default.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="UNORDERED">
                <xs:annotation>
                    <xs:documentation>
                        Actually activates LRU.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="FIFO">
                <xs:annotation>
                    <xs:documentation>
                        Deprecated. Actually activates LRU.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="LRU">
                <xs:annotation>
                    <xs:documentation>
                        Least-Recently Used policy.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="LIRS">
                <xs:annotation>
                    <xs:documentation>
                        Low Inter-reference Recency Set. An improved version of LRU which uses cache-locality access information to better decide which data to evict.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="mode">
        <xs:restriction base="xs:token">
            <xs:enumeration value="ASYNC">
                <xs:annotation>
                    <xs:documentation>
                        Enables asynchronous mode.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="SYNC">
                <xs:annotation>
                    <xs:documentation>
                        Enables synchronous mode.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="controller-mode">
        <xs:restriction base="xs:token">
            <xs:enumeration value="EAGER">
                <xs:annotation>
                    <xs:documentation>
                        Start the cache container on server startup.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="LAZY">
                <xs:annotation>
                    <xs:documentation>
                        Start the cache container lazily when requested by a service or deployment.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>
