<?xml version="1.0" encoding="UTF-8"?>
<!--
 - Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors.
 - 
 - Licensed under the Apache License, Version 2.0 (the "License");
 - you may not use this file except in compliance with the License.
 - You may obtain a copy of the License at
 - http://www.apache.org/licenses/LICENSE-2.0
 - Unless required by applicable law or agreed to in writing, software
 - distributed under the License is distributed on an "AS IS" BASIS,
 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 - See the License for the specific language governing permissions and
 - limitations under the License.
 -->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:switchyard="urn:switchyard-config:switchyard:2.0"
    elementFormDefault="qualified">

    <import namespace="urn:switchyard-config:switchyard:2.0"/>

    <complexType name="BaseCamelBinding">
        <complexContent>
            <extension base="switchyard:SwitchYardBindingType">
                <sequence>
                    <element name="contextMapper" type="switchyard:ContextMapperType"  minOccurs="0" maxOccurs="1"/>
                    <element name="messageComposer" type="switchyard:MessageComposerType" minOccurs="0" maxOccurs="1"/>
                    <element name="additionalUriParameters" minOccurs="0" maxOccurs="1">
                        <complexType>
                            <sequence>
                                <element name="parameter" minOccurs="0" maxOccurs="unbounded">
                                    <complexType>
                                        <attribute name="name" type="string" use="required"/>
                                        <attribute name="value" type="string" use="required"/>
                                    </complexType>
                                </element>
                            </sequence>
                        </complexType>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <group name="GenericFileBindingType">
        <sequence>
            <element name="autoCreate" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="bufferSize" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="fileName" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="flatten" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="charset" type="string" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </group>

    <group name="CamelRemoteBindingType">
        <sequence>
            <element name="host" type="string"  minOccurs="0" maxOccurs="1"/>
            <element name="port" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="username" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="password" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="binary" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="connectTimeout" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="disconnect" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="maximumReconnectAttempts" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="reconnectDelay" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="separator" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="stepwise" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="throwExceptionOnConnectFailed" type="boolean" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </group>

    <group name="ScheduledPollConsumerType">
        <sequence>
            <element name="initialDelay" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="delay" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="useFixedDelay" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="sendEmptyMessageWhenIdle" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="timeUnit" minOccurs="0" maxOccurs="1">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="NANOSECONDS" />
                        <enumeration value="MICROSECONDS" />
                        <enumeration value="MILLISECONDS" />
                        <enumeration value="SECONDS" />
                        <enumeration value="MINUTES" />
                        <enumeration value="HOURS" />
                        <enumeration value="DAYS" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </group>

    <group name="ScheduledBatchPollConsumerType">
        <sequence>
            <element name="maxMessagesPerPoll" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </group>

    <group name="GenericFileConsumerType">
        <sequence>
            <element name="delete" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="recursive" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="noop" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="preMove" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="move" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="moveFailed" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="include" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="exclude" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="idempotent" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="idempotentRepository" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="inProgressRepository" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="filter" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="sorter" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="sortBy" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="readLock" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="readLockTimeout " type="switchyard:propLong" minOccurs="0" maxOccurs="1"/>
            <element name="readLockCheckInterval" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="exclusiveReadLockStrategy" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="processStrategy" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="startingDirectoryMustExist" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="directoryMustExist" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="doneFileName" type="string" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </group>

    <group name="GenericFileProducerType">
        <sequence>
            <element name="fileExist" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="tempPrefix" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="tempFileName" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="keepLastModified" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="eagerDeleteTargetFile" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="doneFileName" type="string" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </group>

    <group name="JmsBindingType">
        <sequence>
            <choice minOccurs="1">
                <element name="queue" type="string"/>
                <element name="topic" type="string"/>
            </choice>
            <element name="connectionFactory" type="string" />
            <element name="username" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="password" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="clientId" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="durableSubscriptionName" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="concurrentConsumers" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="maxConcurrentConsumers" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="disableReplyTo" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="preserveMessageQos" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="deliveryPersistent" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="priority" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="explicitQosEnabled" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="replyTo" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="replyToType" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="requestTimeout" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="selector" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="timeToLive" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
            <element name="transacted" type="boolean" minOccurs="0" maxOccurs="1"/>
            <element name="transactionManager" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="acknowledgementModeName" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="acknowledgementMode" type="switchyard:propInteger" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </group>

</schema>
