<?xml version="1.0" encoding="UTF-8"?>
<!--
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - JASMINe
  - Copyright (C) 2012 Bull S.A.S.
  - Contact: jasmine@ow2.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
  -
  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - $Id$
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->

<appendix version="5.0" xml:lang="en" xml:id="jasmineprobe.config_schema" xmlns="http://docbook.org/ns/docbook"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:mml="http://www.w3.org/1998/Math/MathML"
      xmlns:html="http://www.w3.org/1999/xhtml"
      xmlns:db="http://docbook.org/ns/docbook">
 <title>Probe configuration schema</title>
 
 <para>Here is the grammar of the probe configuration XML file:</para>
 
 <screen>
 &lt;xsd:schema
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified"
        targetNamespace="org.ow2.jasmine.probe:probe-config"
        xmlns:pec="org.ow2.jasmine.probe:probe-config"&gt;

     &lt;xsd:element name="probe-config"&gt;
        &lt;!-- Use an inner type to avoid that unmarshall return a JAXBElement --&gt;
        &lt;xsd:complexType&gt;
            &lt;xsd:sequence&gt;
                &lt;xsd:element name="output" minOccurs="0" maxOccurs="unbounded" type="pec:output" /&gt;
                &lt;xsd:element name="target" minOccurs="0" maxOccurs="unbounded" type="pec:target" /&gt;
                &lt;xsd:element name="indicator" minOccurs="0" maxOccurs="unbounded" type="pec:indicator" /&gt;
                &lt;xsd:element name="probe" minOccurs="0" maxOccurs="unbounded" type="pec:probe" /&gt;
            &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;

    &lt;xsd:complexType name="output"&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name="property" minOccurs="0" maxOccurs="unbounded" type="pec:proptype" /&gt;
        &lt;/xsd:sequence&gt;
        &lt;xsd:attribute name="name" type="xsd:token" use="required"/&gt;
        &lt;xsd:attribute name="type" type="xsd:token" use="required" /&gt;
        &lt;xsd:attribute name="default" type="xsd:boolean" default="false" /&gt;
    &lt;/xsd:complexType&gt;

    &lt;xsd:complexType name="target"&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name="property" minOccurs="0" maxOccurs="unbounded" type="pec:proptype" /&gt;
        &lt;/xsd:sequence&gt;
        &lt;xsd:attribute name="name" type="xsd:token" use="required"/&gt;
        &lt;xsd:attribute name="type" type="xsd:token" default="jmx" /&gt;
    &lt;/xsd:complexType&gt;

    &lt;xsd:complexType name="indicator"&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name="property" minOccurs="0" maxOccurs="unbounded" type="pec:proptype" /&gt;
            &lt;xsd:element name="source" minOccurs="0" maxOccurs="unbounded" type="xsd:token" /&gt;
        &lt;/xsd:sequence&gt;
        &lt;xsd:attribute name="name" type="xsd:token" use="required" /&gt;
        &lt;xsd:attribute name="type" type="xsd:token" use="required" /&gt;
        &lt;xsd:attribute name="scale" type="xsd:integer" default="1" /&gt;
    &lt;/xsd:complexType&gt;

    &lt;xsd:complexType name="probe"&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name="output" minOccurs="0" maxOccurs="unbounded" type="xsd:token" /&gt;
            &lt;xsd:element name="indicator" minOccurs="1" maxOccurs="unbounded" type="xsd:token" /&gt;
            &lt;xsd:element name="target" minOccurs="0" maxOccurs="unbounded" type="xsd:token" /&gt;
        &lt;/xsd:sequence&gt;
        &lt;xsd:attribute name="id" type="xsd:token" use="required"/&gt;
        &lt;xsd:attribute name="period" type="xsd:integer" default="30" /&gt;
        &lt;xsd:attribute name="status" type="pec:statusType" /&gt;
    &lt;/xsd:complexType&gt;

    &lt;xsd:complexType name="proptype"&gt;
        &lt;xsd:attribute name="key" /&gt;
        &lt;xsd:attribute name="value" /&gt;
    &lt;/xsd:complexType&gt;

    &lt;xsd:simpleType name="statusType"&gt;
        &lt;xsd:restriction base="xsd:token"&gt;
            &lt;xsd:enumeration value="stopped"/&gt;
            &lt;xsd:enumeration value="started"/&gt;
        &lt;/xsd:restriction&gt;
    &lt;/xsd:simpleType&gt;


&lt;/xsd:schema&gt;
 </screen>

 </appendix>
