<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema attributeFormDefault="unqualified"
   elementFormDefault="qualified" version="1.0" targetNamespace="urn:infinispan:config:store:leveldb:9.0"
   xmlns:tns="urn:infinispan:config:store:leveldb:9.0" xmlns:config="urn:infinispan:config:9.0"
   xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:import namespace="urn:infinispan:config:9.0"
              schemaLocation="http://www.infinispan.org/schemas/infinispan-config-9.0.xsd" />

  <xs:element name="leveldb-store" type="tns:leveldb-store"/>

  <xs:complexType name="leveldb-store">
    <xs:complexContent>
      <xs:extension base="config:store">
        <xs:sequence>
          <xs:element name="expiration" type="tns:leveldb-expiration" minOccurs="0">
            <xs:annotation>
              <xs:documentation>
                Defines the expiration settings for the LevelDB cache store.
              </xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="implementation" type="tns:leveldb-implementation" minOccurs="0">
            <xs:annotation>
              <xs:documentation>
                Defines the LevelDB store implementation to use.
              </xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compression" type="tns:leveldb-compression" minOccurs="0">
            <xs:annotation>
              <xs:documentation>
                Defines the data compression to use in the LevelDB store.
              </xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <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:attribute name="block-size" type="xs:integer">
          <xs:annotation>
            <xs:documentation>Cache store block size.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="cache-size" type="xs:long">
          <xs:annotation>
            <xs:documentation>Cache size for the cache store.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="clear-threshold" type="xs:integer">
          <xs:annotation>
            <xs:documentation>Cache store cache clear threshold.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="leveldb-expiration">
    <xs:attribute name="path" type="xs:string">
      <xs:annotation>
        <xs:documentation>The base directory in which to store expired cache state.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="queue-size" type="xs:integer" default="10000">
      <xs:annotation>
        <xs:documentation>Expired entry queue size.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="leveldb-compression">
    <xs:attribute name="type" type="tns:leveldb-compression-mode" default="NONE">
      <xs:annotation>
        <xs:documentation>The type of compression to be used by LevelDB store.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:simpleType name="leveldb-compression-mode">
    <xs:restriction base="xs:token">
      <xs:enumeration value="NONE">
        <xs:annotation>
          <xs:documentation>No compression.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SNAPPY">
        <xs:annotation>
          <xs:documentation>Snappy compression.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="leveldb-implementation">
    <xs:attribute name="type" type="tns:leveldb-implementation-type" default="AUTO">
      <xs:annotation>
        <xs:documentation>The LevelDB store implementation to use.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:simpleType name="leveldb-implementation-type">
    <xs:restriction base="xs:token">
      <xs:enumeration value="AUTO">
        <xs:annotation>
          <xs:documentation>LevelDB implementation selection left to the library.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="JAVA">
        <xs:annotation>
          <xs:documentation>Selects LevelDB Java implementation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="JNI">
        <xs:annotation>
          <xs:documentation>Selects LevelDB JNI implementation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
