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

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0"
           targetNamespace="urn:infinispan:config:store:rest:8.0"
           xmlns:tns="urn:infinispan:config:store:rest:8.0"
           xmlns:config="urn:infinispan:config:8.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import namespace="urn:infinispan:config:8.0"
             schemaLocation="http://www.infinispan.org/schemas/infinispan-config-8.0.xsd" />

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

  <xs:complexType name="rest-store">
    <xs:complexContent>
      <xs:extension base="config:store">
        <xs:sequence>
          <xs:element name="remote-server" type="config:remote-server" minOccurs="1" maxOccurs="unbounded"/>
          <xs:element name="connection-pool" type="tns:rest-connection-pool" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>

        <xs:attribute name="append-cache-name-to-path" type="xs:boolean" default="false">
          <xs:annotation>
            <xs:documentation>Whether to append the name of the cache to the path.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="path" type="xs:string" default="/rest/___defaultcache">
          <xs:annotation>
            <xs:documentation>The path portion of the URI of the remote REST endpoint.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="key-to-string-mapper" type="xs:string" default="org.infinispan.persistence.keymappers.MarshalledValueOrPrimitiveMapper">
          <xs:annotation>
            <xs:documentation>
              The name of a class to use for converting keys to strings. Defaults to
              org.infinispan.persistence.keymappers.MarshalledValueOrPrimitiveMapper
            </xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="raw-values">
          <xs:annotation>
            <xs:documentation>
              Whether to disable unmarshalling of values.
            </xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="rest-connection-pool">
    <xs:attribute name="buffer-size" type="xs:int" default="8192">
      <xs:annotation>
        <xs:documentation>The size of the socket buffer.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="connection-timeout" type="xs:int" default="60000">
      <xs:annotation>
        <xs:documentation>A connection timeout for remote cache communication.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="max-connections-per-host" type="xs:int" default="4">
      <xs:annotation>
        <xs:documentation>The maximum number of connections per host.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="max-total-connections" type="xs:int" default="20">
      <xs:annotation>
        <xs:documentation>The maximum number of total connections.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="socket-timeout" type="xs:int" default="60000">
      <xs:annotation>
        <xs:documentation>A socket timeout for remote cache communication.</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:complexType>

</xs:schema>

