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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://jonas.ow2.org/ns/datasource/1.0"
            xmlns="http://jonas.ow2.org/ns/datasource/1.0"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
            jaxb:version="1.0"
            xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
            jaxb:extensionBindingPrefixes="xjc"
            >

  <xsd:annotation>
    <xsd:documentation>
      @(#)jonas-datasources-1.0.xsd  09/2010
    </xsd:documentation>
  </xsd:annotation>
  <xsd:annotation>
    <xsd:documentation>
      <![CDATA[
      JOnAS: Java(TM) Open Application Server
      Copyright (C) 2010 Bull S.A.S
      Contact: jonas-team@objectweb.org

      This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
      License as published by the Free Software Foundation; either
      version 2.1 of the License, or any later version.

      This library is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Lesser General Public License for more details.

      You should have received a copy of the GNU Lesser General Public
      License along with this library; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
      USA

      ]]>
    </xsd:documentation>
  </xsd:annotation>

  <xsd:annotation>
    <xsd:appinfo>
      <jaxb:globalBindings>
        <xjc:simple />
      </jaxb:globalBindings>
    </xsd:appinfo>
  </xsd:annotation>


  <!-- Type for the connchecklevel value that only takes 0-2 as values -->
  <xsd:simpleType name="connchecklevelType">
    <xsd:restriction base="xsd:integer">
      <xsd:minInclusive value="0" />
      <xsd:maxInclusive value="3" />
    </xsd:restriction>
  </xsd:simpleType>

  <!-- Datasource configuration type -->
  <xsd:complexType name="datasource-configurationType">
    <xsd:all>
      <xsd:element minOccurs="0" maxOccurs="1" name="name"
        type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="url"
        type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="classname"
        type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="username"
        type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="password"
        type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="mapper"
        type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="description"
        type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="isolationlevel"
        type="xsd:string" />
    </xsd:all>
  </xsd:complexType>

  <!-- Connection manager configuration type -->
  <xsd:complexType name="connectionManager-configurationType">
    <xsd:all>
      <xsd:element minOccurs="0" maxOccurs="1" name="connchecklevel"
        type="connchecklevelType" />
      <xsd:element minOccurs="0" maxOccurs="1" name="connmaxage"
        type="xsd:nonNegativeInteger" />
      <xsd:element minOccurs="0" maxOccurs="1" name="maxopentime"
        type="xsd:nonNegativeInteger" />
      <xsd:element minOccurs="0" maxOccurs="1" name="connteststmt"
        type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="initconpool"
        type="xsd:nonNegativeInteger" />
      <xsd:element minOccurs="0" maxOccurs="1" name="minconpool"
        type="xsd:nonNegativeInteger" />
      <xsd:element minOccurs="0" maxOccurs="1" name="maxconpool"
        type="xsd:positiveInteger" />
      <xsd:element minOccurs="0" maxOccurs="1" name="samplingperiod"
        type="xsd:nonNegativeInteger" />
      <xsd:element minOccurs="0" maxOccurs="1" name="maxwaittime"
        type="xsd:nonNegativeInteger" />
      <xsd:element minOccurs="0" maxOccurs="1" name="maxwaiters"
        type="xsd:nonNegativeInteger" />
      <xsd:element minOccurs="0" maxOccurs="1" name="pstmtmax"
        type="xsd:nonNegativeInteger" />
    </xsd:all>
  </xsd:complexType>

  <!-- The datasource type -->
  <xsd:complexType name="datasourceType">
    <xsd:sequence>
      <xsd:element name="datasource-configuration" type="datasource-configurationType" />
      <xsd:element name="connectionManager-configuration" type="connectionManager-configurationType" />
    </xsd:sequence>
  </xsd:complexType>

  <!-- Type for the root element -->
  <xsd:complexType name="datasourcesType">
    <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="unbounded" name="datasource"
        type="datasourceType" />
    </xsd:sequence>
  </xsd:complexType>

  <!-- Root element -->
  <xsd:element name="datasources" type="datasourcesType" />
</xsd:schema>
