<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.logitags.com"
        targetNamespace="http://www.logitags.com" elementFormDefault="qualified">

        <element name="cibet">
                <complexType>
                        <sequence>
                                <element name="authenticationProvider"
                                        type="tns:ClassDefBinding" minOccurs="0" maxOccurs="1">
                                </element>
                                <element name="notificationProvider"
                                        type="tns:ClassDefBinding" minOccurs="0" maxOccurs="1">
                                </element>
                <element name="securityProvider" type="tns:ClassDefBinding" minOccurs="0" maxOccurs="1"></element>
                <element name="control" minOccurs="0"
                                        maxOccurs="unbounded" type="tns:ControlDefBinding">
                                </element>
                                <element name="actuator" type="tns:ActuatorBinding"
                                        maxOccurs="unbounded" minOccurs="0">
                                        <annotation>
                                                <documentation>
                                                        definition of actuators
                                                </documentation>
                                        </annotation>
                                </element>
                                <element name="setpoint" type="tns:SetpointBinding"
                                        maxOccurs="unbounded" minOccurs="0">
                                        <annotation>
                                                <documentation>
                                                        definition of setpoints
                                                </documentation>
                                        </annotation>
                                </element>

                        </sequence>
                </complexType>

                <key name="ControlDefBindingKey">
                        <selector xpath="tns:control" />
                        <field xpath="@name" />
                </key>

                <key name="ActuatorBindingKey">
                        <selector xpath="tns:actuator" />
                        <field xpath="@name" />
                </key>

                <keyref name="customControlKeyref" refer="tns:ControlDefBindingKey">
                        <selector xpath="tns:setpoint/tns:controls/tns:customControl" />
                        <field xpath="@name" />
                </keyref>

        </element>

        <complexType name="ControlsBinding">
                <choice maxOccurs="unbounded" minOccurs="1">
                        <element name="tenant" type="token" minOccurs="0" maxOccurs="1" />

                        <element name="event" type="token" minOccurs="0" maxOccurs="1" />

                        <element name="target" type="token" maxOccurs="1" minOccurs="0">
                                <annotation>
                                        <documentation>control for a class</documentation>
                                </annotation>
                        </element>

                        <element name="method" type="token" maxOccurs="1" minOccurs="0" />

                        <element name="invoker" type="tns:InExAttributeBinding"
                                maxOccurs="1" minOccurs="0">
                                <annotation>
                                        <documentation>
                                                comma separated list of class and methods from
                                                which
                                                the current method sensor was executed
                                                which shall be included or
                                                excluded into control
                                        </documentation>
                                </annotation>
                        </element>

                        <element name="stateChange" type="tns:InExAttributeBinding"
                                maxOccurs="1" minOccurs="0">
                                <annotation>
                                        <documentation>
                                                comma separated list of class properties which
                                                shall
                                                be included or excluded into control
                                        </documentation>
                                </annotation>
                        </element>

                        <element name="condition" type="token" maxOccurs="1"
                                minOccurs="0">
                                <annotation>
                                        <documentation>
                                                condition expression which must be fulfilled for
                                                the
                                                method to be included into control
                                        </documentation>
                                </annotation>
                        </element>


                        <element name="customControl" type="tns:CustomControlBinding"
                                minOccurs="0" maxOccurs="unbounded"></element>
                </choice>
        </complexType>

        <complexType name="PropertiesBinding">
                <sequence>
                        <any processContents="skip" minOccurs="0" maxOccurs="unbounded">
                                <annotation>
                                        <documentation>any property. A bean property of the same
                                                name with
                                                setter method must be present in the
                                                implementation
                                        </documentation>
                                </annotation>
                        </any>
                </sequence>
        </complexType>


        <complexType name="SetpointBinding">
                <sequence>
                        <element name="controls" type="tns:ControlsBinding"
                                maxOccurs="1" minOccurs="1">
                                <annotation>
                                        <documentation>
                                                controllables configuration. Defines what shall be
                                                controlled.
                                        </documentation>
                                </annotation>
                        </element>

                        <element name="actuator" type="tns:SetpointActuatorBinding"
                                maxOccurs="unbounded" minOccurs="1">
                                <annotation>
                                        <documentation>
                                                list of actuators which shall be applied in the
                                                setpoint.
                                        </documentation>
                                </annotation>
                        </element>
                </sequence>
                <attribute name="id" type="ID" use="required" />
                <attribute name="extends" type="IDREF" use="optional" />
        </complexType>

        <complexType name="ActuatorBinding">
                <sequence>
                        <element name="class" type="token" maxOccurs="1" minOccurs="0">
                                <annotation>
                                        <documentation>
                                                full qualified actuator class
                                        </documentation>
                                </annotation>
                        </element>
                        <element name="properties" type="tns:PropertiesBinding"
                                maxOccurs="1" minOccurs="0">
                                <annotation>
                                        <documentation>actuator properties</documentation>
                                </annotation>
                        </element>
                </sequence>
                <attribute name="name" type="token" use="required">
                        <annotation>
                                <documentation>unique name of the actuator.</documentation>
                        </annotation>
                </attribute>
        </complexType>

        <complexType name="SetpointActuatorBinding">
                <attribute name="name" type="token" use="required">
                        <annotation>
                                <documentation>name of the actuator to apply</documentation>
                        </annotation>
                </attribute>
        </complexType>

        <complexType name="InExAttributeBinding">
                <simpleContent>
                        <extension base="token">
                                <attribute name="exclude" type="boolean" default="false"
                                        use="optional"></attribute>
                        </extension>
                </simpleContent>
        </complexType>

        <complexType name="ControlDefBinding">
                <sequence>
                        <element name="class" type="token" minOccurs="1" maxOccurs="1"></element>
                        <element name="properties" type="tns:PropertiesBinding"
                                minOccurs="0" maxOccurs="1">
                        </element>
                </sequence>
                <attribute name="name" type="token" use="required"></attribute>
        </complexType>

        <complexType name="ClassDefBinding">
                <sequence>
                        <element name="class" type="token" minOccurs="1" maxOccurs="1"></element>
                        <element name="properties" type="tns:PropertiesBinding"
                                minOccurs="0" maxOccurs="1">
                        </element>
                </sequence>
        </complexType>


        <complexType name="CustomControlBinding">
                <simpleContent>
                        <extension base="token">
                                <attribute name="name" type="token" use="required"></attribute>
                        </extension>
                </simpleContent>
        </complexType>
</schema>