<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/LogGuard50Types" xmlns:tns="http://www.example.org/LogGuard50Types" elementFormDefault="qualified">

    <complexType name="XmlConfiguration">
    	<sequence minOccurs="0" maxOccurs="1">
    		<element name="schedulerParams" type="tns:SchedulerParams"
    			minOccurs="0" maxOccurs="1">
    		</element>
    		<element name="dataSources" type="tns:DataSources"
    			minOccurs="1" maxOccurs="1">
    		</element>
    		<element name="step" type="tns:Step" minOccurs="1" maxOccurs="unbounded"></element>
    	</sequence>
    	<attribute name="version" type="string"></attribute>
    	<attribute name="author" type="string"></attribute>
    	<attribute name="date" type="string"></attribute>
    	<attribute name="comment" type="string"></attribute>
    	<attribute name="file" type="string"></attribute>
    </complexType>


    <element name="configuration" type="tns:XmlConfiguration"></element>

    <complexType name="DataSources">
    	<sequence>
    		<element name="jdbcDataSource" type="tns:JdbcDataSource" minOccurs="0" maxOccurs="unbounded"></element>
    	</sequence>
    </complexType>

    <complexType name="JdbcDataSource">
    	<attribute name="name" type="string" use="required"></attribute>
    	<attribute name="type" use="required" type="tns:TDbmsType">
    	</attribute>
    	<attribute name="connectionString" type="string" use="required"></attribute>
    	<attribute name="user" type="string" use="required"></attribute>
    	<attribute name="password" type="string" use="required"></attribute>
    </complexType>

    <complexType name="SchedulerParams">
    	<sequence minOccurs="0" maxOccurs="1">
    		<element name="schedulerParams" type="string"></element>
    	</sequence>
    	<attribute name="maxThreadsNumber" type="int"></attribute>
    	<attribute name="schedulerSleep" type="int"></attribute>
    	<attribute name="debugMode" type="tns:TBool"></attribute>
    </complexType>

    <complexType name="Step">
    	<sequence maxOccurs="unbounded" minOccurs="1">
    		<element name="Task" type="tns:Task" minOccurs="1" maxOccurs="unbounded"></element>
    	</sequence>
    	<attribute name="name" type="string" use="required"></attribute>
    	<attribute name="description" type="string" use="optional"></attribute>
    </complexType>

    <complexType name="Task">
    	<choice minOccurs="1" maxOccurs="1">
    		<element name="ftp" type="tns:FtpClient"></element>
    		<element name="system" type="tns:SystemTask"></element>
    		<element name="logAgent" type="tns:LogAgent"></element>
    		<element name="fileParser" type="tns:FileParser"></element>
    		<element name="customComponent"
    			type="tns:CustomComponent">
    		</element>
    		<element name="scheduler" type="tns:SchedulerTask"></element>
    	</choice>
    	<attribute name="name" type="string" use="required"></attribute>
    	<attribute name="description" type="string" use="optional"></attribute>
    	<attribute name="priority" type="int"></attribute>
    	<attribute name="model" type="tns:TThreadModel">
    	</attribute>
    	<attribute name="secondPeriod" type="int"></attribute>
    </complexType>

    <complexType name="FtpClient">
    	<attribute name="localDir" type="string" use="required"></attribute>
    	<attribute name="remoteDir" type="string" use="required"></attribute>
    	<attribute name="deleteOriginals" type="tns:TBool" use="optional" default="false"></attribute>
    	<attribute name="isActionGet" type="tns:TBool" use="optional" default="true"></attribute>
    </complexType>

    <complexType name="SystemTask">
    	<sequence minOccurs="0" maxOccurs="1">
    		<element name="arg" type="tns:Argument" minOccurs="0" maxOccurs="unbounded"></element>
    	</sequence>
    	<attribute name="processName" type="string" use="required"></attribute>
    	<attribute name="excecutable" type="string" use="required"></attribute>
    </complexType>

    <complexType name="LogAgent">
    	<sequence>
    		<element name="jdbcDataSource" type="tns:JdbcDataSource"></element>
    	</sequence>
    	<attribute name="processName" type="string" use="required"
    		default="LogGuardFileParser">
    		<annotation>
    			<documentation>
    				This MUST be filled. This is stored in the LogGuard
    				Database as the the System Id that generated the log
    				results.
    			</documentation>
    		</annotation>
    	</attribute>
    	<attribute name="configFile" type="string" use="required"></attribute>
    	<attribute name="inputDirectory" type="string" use="required"></attribute>
    	<attribute name="outputDirectory" type="string"
    		use="required">
    	</attribute>
    	<attribute name="extendedDirectory" type="string"
    		use="required">
    	</attribute>
    	<attribute name="pendingDirectory" type="string"
    		use="required">
    	</attribute>
    	<attribute name="logDirectory" type="string" use="required"></attribute>
    	<attribute name="errorDirectory" type="string" use="required"></attribute>
    	<attribute name="inputFilePrefix" type="string"></attribute>
    	<attribute name="inputFileSuffix" type="string"></attribute>
    	<attribute name="inputFileLength" type="int" use="optional"></attribute>
    	<attribute name="extendedFileSuffix" type="string"
    		use="optional">
    	</attribute>
    	<attribute name="pendingFileSuffix" type="string"
    		use="optional">
    	</attribute>
    	<attribute name="jdbcDataSourceName" type="string"
    		use="optional">
    	</attribute>
    
    
    
    </complexType>

    <complexType name="FileParser">
    	<sequence>
    		<element name="jdbcDataSource" type="tns:JdbcDataSource"></element>
    	</sequence>
    	<attribute name="processName" type="string" use="required"
    		default="LogGuardFileParser">
    		<annotation>
    			<documentation>
    				This MUST be filled. This is stored in the LogGuard
    				Database as the the System Id that generated the log
    				results.
    			</documentation>
    		</annotation>
    	</attribute>
    	<attribute name="configFile" type="string" use="required"></attribute>
    	<attribute name="inputDirectory" type="string" use="required"></attribute>
    	<attribute name="outputDirectory" type="string"
    		use="required">
    	</attribute>
    	<attribute name="extendedDirectory" type="string"
    		use="required">
    	</attribute>
    	<attribute name="pendingDirectory" type="string"
    		use="required">
    	</attribute>
    	<attribute name="logDirectory" type="string" use="required"></attribute>
    	<attribute name="errorDirectory" type="string" use="required"></attribute>
    	<attribute name="inputFilePrefix" type="string"></attribute>
    	<attribute name="inputFileSuffix" type="string"></attribute>
    	<attribute name="inputFileLength" type="int" use="optional"></attribute>
    	<attribute name="extendedFileSuffix" type="string"
    		use="optional">
    	</attribute>
    	<attribute name="pendingFileSuffix" type="string"
    		use="optional">
    	</attribute>
    	<attribute name="jdbcDataSourceName" type="string"
    		use="optional">
    	</attribute>
    </complexType>
    
    <complexType name="CustomComponent">
    	<attribute name="configFile" type="string" use="required"></attribute>
    	<attribute name="className" type="string" use="required"></attribute>
    	<attribute name="classUri" type="string" use="required"></attribute>
    </complexType>

    <complexType name="SchedulerTask">
    	<attribute name="configFile" type="string" use="required"></attribute>
    </complexType>
    
    <simpleType name="TBool">
    	<restriction base="string">
    		<enumeration value="true"></enumeration>
    		<enumeration value="false"></enumeration>
    	</restriction>
    </simpleType>

    <simpleType name="TDbmsType">
    	<restriction base="string"></restriction>
    </simpleType>

    <simpleType name="TThreadModel">
    	<restriction base="string"></restriction>
    </simpleType>

    <complexType name="Argument">
    	<attribute name="value" type="string" use="required"></attribute>
    </complexType>
</schema>
