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

<!--
 (c) Copyright, Real-Time Innovations, 2009-2016.
 All rights reserved.
 No duplications, whole or partial, manual or electronic, may be made
 without express written permission.  Any such copies, or
 revisions thereof, must display this notice unaltered.
 This code contains trade secrets of Real-Time Innovations, Inc.
-->

<!-- =================================================================== -->
<!-- RTI Recorder XML Schema File                                        -->
<!-- =================================================================== -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified"
           attributeFormDefault="unqualified">

    <xs:include schemaLocation="definitions/rti_recorder_common_definitions.xsd" />


    <!-- ================================================================== -->
    <!-- Recorder Session                                                   -->
    <!-- ================================================================== -->

    <!-- =================================================================== -->
    <xs:complexType name="fieldSelection">
        <xs:annotation>
            <xs:documentation>
                <![CDATA[
                Not supported in version 0.1.
                Included for feedback purposes.
                ]]>
            </xs:documentation>
        </xs:annotation>
        <xs:all>
            <xs:element name="allow_field_filter"
                        minOccurs="0"
                        type="nameFilterList"/>
            <xs:element name="allow_sampleinfo_field_filter"
                        minOccurs="0"
                        type="nameFilterList"/>
        </xs:all>
    </xs:complexType>

    <!-- =================================================================== -->
    <xs:complexType name="recorderTopic">
        <xs:sequence>
            <xs:element name="topic_name"
                        type="xs:string"
                        minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="en-US">
                        <![CDATA[
                        When defined, this represents the name of the DDS topic
                        to be recorded. If not present, that name is taken from
                        the name attribute of the parent <topic> tag.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>

            <xs:element name="registered_type_name"
                        type="xs:string"/>

            <!--  Inputs  -->
            <xs:element name="datareader_qos"
                        type="dataReaderQosProfileChild"
                        minOccurs="0"/>

            <xs:element name="content_filter"
                        type="filter"
                        minOccurs="0"/>

            <!-- Data settings -->
            <xs:element name="transformation"
                        type="transformation"
                        minOccurs="0" />

            <!-- Outputs -->
            <!--xs:element name="field_selection"
                        type="fieldSelection"
                        minOccurs="0"/-->
        </xs:sequence>
        <xs:attributeGroup ref="entityNameAttrGroup">
            <xs:annotation>
                <xs:documentation xml:lang="en-US">
                    <![CDATA[
                    Name of this Recorder topic description. If the <topic_name>
                    tag is not present, this will also be the name of the DDS
                    topic to be recorded.
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attributeGroup>
        <!-- Participant to be used by this group of Topics -->
        <xs:attribute name="participant_ref"
                      type="elementReference" />
    </xs:complexType>

    <xs:complexType name="recorderStream">
        <xs:sequence>
            <xs:element name="stream_name"
                        type="xs:string"
                        minOccurs="0"/>

            <xs:element name="registered_type_name"
                        type="xs:string"/>

            <xs:element name="property"
                        type="property"
                        minOccurs="0"/>
            <xs:element name="transformation"
                        type="transformation"
                        minOccurs="0" />
        </xs:sequence>
               
        <xs:attributeGroup ref="entityNameAttrGroup">
            <xs:annotation>
                <xs:documentation xml:lang="en-US">
                    <![CDATA[
                    Name of this Recorder Stream description. If the <stream_name>
                    tag is not present, this will also be the name of the Stream
                    to be recorded.
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attributeGroup>
         <xs:attribute name="connection_ref"
                      type="elementReference"
                      use="required"/>
    </xs:complexType>


    <!-- =================================================================== -->
    <xs:complexType name="recorderTopicGroup">
        <xs:all>
            <xs:element name="allow_topic_name_filter"
                        type="nameFilterList"
                        minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        A regular expression describing which Topics should be
                        recorded.  Topics with names that match this filter are
                        allowed to be recorded, unless they do not pass the
                        additional filters.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="deny_topic_name_filter"
                       minOccurs="0"
                       type="nameFilterList">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        A regular expression describing which Topics should not
                        be recorded.  This is applied after the allow filter.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="allow_type_name_filter"
                       minOccurs="0"
                       type="nameFilterList">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        A regular expression describing a set of type names
                        registerd in the DDS domains.  Topics with data types
                        that match this filter are allowed to be recorded.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="deny_type_name_filter"
                       minOccurs="0"
                       type="nameFilterList">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        A regular expression describing a set of type names
                        registerd in the DDS domains to be filtered out.
                        Topics with data types that match this regex are not
                        allowed to be recorded.  This is applied after the
                        allow_type_name_filter.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <!--  Inputs  -->
            <xs:element name="datareader_qos"
                        type="dataReaderQosProfileChild"
                        minOccurs="0"/>

            <xs:element name="content_filter"
                        type="filter"
                        minOccurs="0"/>
        </xs:all>       
        <xs:attributeGroup ref="entityNameAttrGroup">
            <xs:annotation>
                <xs:documentation xml:lang="en-US">
                    <![CDATA[
                    Topic group name
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attributeGroup>
        <!-- Participant to be used by this group of Topics -->
        <xs:attribute name="participant_ref"
                      type="elementReference"/>
    </xs:complexType>

    <!-- =================================================================== -->
    <xs:complexType name="recorderStreamGroup">
        <xs:all>
            <xs:element name="allow_stream_name_filter"
                        type="nameFilterList"
                        minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        A regular expression describing which Streams should be
                        recorded.  Streams with names that match this filter are
                        allowed to be recorded, unless they do not pass the
                        additional filters.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="deny_stream_name_filter"
                       minOccurs="0"
                       type="nameFilterList">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        A regular expression describing which Streams should not
                        be recorded.  This is applied after the allow filter.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="allow_type_name_filter"
                       minOccurs="0"
                       type="nameFilterList">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        A regular expression describing a set of type names
                        registerd in the adapter domain.  Streams with data types
                        that match this filter are allowed to be recorded.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="deny_type_name_filter"
                       minOccurs="0"
                       type="nameFilterList">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        A regular expression describing a set of type names
                        registerd in the adapter domain to be filtered out.
                        Topics with data types that match this regex are not
                        allowed to be recorded.  This is applied after the
                        allow_type_name_filter.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <!--  Inputs  -->
            <xs:element name="property"
                        type="property"
                        minOccurs="0"/>
        </xs:all>       
        <xs:attributeGroup ref="entityNameAttrGroup">
            <xs:annotation>
                <xs:documentation xml:lang="en-US">
                    <![CDATA[
                    Stream group name
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attributeGroup>
         <!-- Participant to be used by this group of Topics -->
        <xs:attribute name="connection_ref"
                      type="elementReference"/>
    </xs:complexType>

    <!-- =================================================================== -->
    <xs:complexType name="recordingSession">
        <xs:sequence>
            <xs:element name="subscriber_qos"
                        minOccurs="0"
                        type="subscriberQosProfileChild">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        QoS of the Subscriber associated with the Session
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="thread_pool"
                        type="threadPoolSettings"
                        minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        Thread settings configuring the Session thread
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:choice maxOccurs="unbounded">
                <xs:element name="topic_group"
                            maxOccurs="unbounded"
                            type="recorderTopicGroup">
                    <xs:annotation>
                        <xs:documentation>
                            <![CDATA[
                            Group of Topics to record
                            ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="topic"
                            maxOccurs="unbounded"
                            type="recorderTopic">
                    <xs:annotation>
                        <xs:documentation>
                            <![CDATA[
                            Single Topic to record
                            ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--
                    Internal use only: currently this capability is not available
                    for users since it's not complete. Future versions may
                    enable it as experimental and or fully supported. If you
                    have questions, contact support@rti.com.
                    
                    <xs:element name="stream_group"
                                maxOccurs="unbounded"
                                type="recorderStreamGroup">
                        <xs:annotation>
                            <xs:documentation>
                                <![CDATA[
                                Group of Streams to record (INTERNAL USE ONLY)
                                ]]>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="stream"
                                maxOccurs="unbounded"
                                type="recorderStream">
                        <xs:annotation>
                            <xs:documentation>
                                <![CDATA[
                                Single Stream to record (INTERNAL USE ONLY)
                                ]]>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                -->
            </xs:choice>

        </xs:sequence>
        <xs:attribute name="default_participant_ref"
                      type="elementReference">
            <xs:annotation>
                <xs:documentation>
                    <![CDATA[
                    The DomainParticipant (and domain) to use when recording
                    this data.
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attributeGroup ref="entityNameAttrGroup">
            <xs:annotation>
                <xs:documentation xml:lang="en-US">
                    <![CDATA[
                    Participant reference name
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attributeGroup>
    </xs:complexType>

    <!-- ================================================================== -->
    <!-- Storage Settings                                                   -->
    <!-- ================================================================== -->

    <xs:complexType name="sqliteSettings">
        <xs:sequence>
            <xs:element name="storage_format"
                        minOccurs="0"
                        type="sqliteStorageFormatKind" />
            <xs:choice>
                <xs:element name="fileset"
                            type="complexSqliteSettings" />
                <xs:sequence>
                    <xs:element name="file"
                                type="xs:string"
                                minOccurs="0" />
                    <xs:element name="file_suffix"
                                type="xs:string"
                                minOccurs="0" />
                </xs:sequence>
            </xs:choice>
            <xs:element name="overwrite_policy_kind"
                        minOccurs="0"
                        type="overwritePolicyKind" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        Defines what to do when database files are already
                        present in the current recorder execution directory.
                        There are two options:
                        - OVERWRITE: delete old files and replace them with
                          newly created ones.
                        - DO_NOT_TOUCH: do not delete any old files and just
                          exit.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="index"
                        minOccurs="0"
                        type="xs:boolean" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        Choice to enable database indexing for faster replay.
                        Not supported current version.
                        Included for feedback purposes.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>

             <xs:element name="sql_initialization_string"
                        minOccurs="0"
                        type="xs:string" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        Allows configuring a SQLite SQL expression to use when
                        establishing sqlite connections using this plugin.
                        Default:
                        PRAGMA SYNCHRONOUS = OFF; PRAGMA JOURNAL_MODE = MEMORY;
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>

        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="fileTimeLimit">
        <xs:annotation>
            <xs:documentation>
                <![CDATA[
                A type representing a period of time. It goes from any number of
                days into a resolution of seconds.
                ]]>
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="days"
                        type="xs:nonNegativeInteger"
                        minOccurs="0" />
            <xs:element name="hours"
                        type="dateTimeHour"
                        minOccurs="0" />
            <xs:element name="minutes"
                        type="dateTimeMinuteOrSec"
                        minOccurs="0" />
            <xs:element name="seconds"
                        type="dateTimeMinuteOrSec"
                        minOccurs="0" />
        </xs:sequence>
        <xs:attribute name="start_time"
                      use="optional"
                      type="xs:time">
            <xs:annotation>
                <xs:documentation>
                    <![CDATA[
                    The time at which the first file rollover will happen.
                    When defined, this setting puts the time limit period on hold
                    until the first file swap happens. After that, time period
                    will apply normally.
                    Format is 24 hours.
                    Note: the type xsd:time is used for this attribute, but
                    Recorder will only parse the time part of the string value
                    (so nothing will be parsed after the hh:mm:ss part - for
                    example, timezone information). Timezone is assumed to be
                    the current locale's timezone.
                    ]]>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="rolloverSettings">
        <xs:all>
            <xs:element name="enabled"
                        type="xs:boolean"
                        minOccurs="0" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        This setting applies to file set configurations using a
                        bounded number of files (the only parameter that allows
                        this for the moment is the auto-numeric parameter).
                        Rollover represents the ability for Recorder to
                        overwrite the oldest data file in the same execution
                        when the last file in the set has been filled entirely.
                        Default: false.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="file_size_limit"
                        type="dataSize"
                        minOccurs="0" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        The maximum allowed size (orientative) for a file in a
                        set.
                        Take into account that setting this to a very low value
                        (e.g. 1 KB) may yield unexpected behaviour, because
                        SQLite will take up more than that for even the simplest
                        file.
                        Note: the unit refers to the decimal prefix and not the
                        binary prefix of the number, meaning, 1 MEGABYTES =
                        1000 KB (and not 1024 KB), and so on and so forth. This
                        is usually the standard way to refer to storage size.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="time_limit"
                        type="fileTimeLimit"
                        minOccurs="0" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        The maximum allowed time Recorder should record to the
                        same file in a set.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:all>
    </xs:complexType>

    <xs:complexType name="complexSqliteSettings">
        <xs:all>
            <xs:element name="workspace_dir"
                        type="xs:string"
                        minOccurs="0" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        The workspace directory for Recorder. Depending on the
                        value of the <execution_dir_expression> parameter, this
                        could be the directory where the database files are
                        stored or it could just be a base directory where a new
                        subdirectory is created for every execution.
                        Default: current directory.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="execution_dir_expression"
                        type="xs:string"
                        minOccurs="0" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        When Recorder is executed and this setting is defined,
                        it will create a new directory based on it. Every
                        execution of Recorder will do this (stopping and
                        restarting remotely is considered a new execution too).
                        This execution directory is a parameterisable expression
                        and accepts text and any combination of the following
                        parameters in it:
                            - autonumeric. Format: %auto:M-N%. This parameter
                              describes an integer that auto-increments every
                              time recorder is started. However, the numeric
                              sequence is restarted with every execution of the
                              Recorder binary. M has to be lower than N and they
                              together define a numeric range, both inclusive.
                              N could be omitted (%auto:M%) resulting on an
                              unlimited sequence of numbers starting at M.
                            - timestamp. Format: %ts%. This parameter will take
                              the current timestamp in the system (the time
                              represented as number of seconds since Epoch).
                            - time. Format: %T%. Current time expressed in ISO
                              8601 time format (THHMMSS). Example: T145502.
                              This parameter uses the strftime() parameter %T.
                            - short date. Format: %F%. Short date in YYYY-MM-DD
                              format. Example: 2001-08-23.
                              This parameter uses the strftime() parameter %F.
                            - date and time. Format: %c%. Date and time
                              representation, locale-dependent.
                              This parameter is based on the strftime() parameter %c 
                              but we use the time expressed in ISO 8601
                              format (THHMMSS). 
                              Example: Thu Aug 23 T145502 2001
                        Note: using no parameters will yield the same execution
                        directory every time the service is started, thus, if
                        the directory already contained database files, they may
                        be overwritten (see the <overwrite> tag).
                        Default: %ts% (current timestamp number since Epoch).
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="filename_expression"
                        type="xs:string"
                        minOccurs="0" >
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        Once Recorder knows the exact directory where to put the
                        database files, it will use this parameter to determine
                        the name(s) of the user data file(s) to be created.
                        Right before the recording starts and every time
                        Recorder has to change its current file to a new one, it
                        will use this parameterisable expression to generate the
                        next file's name.
                        This setting accepts text and any combination of the
                        following parameters in it:
                            - autonumeric. Format: %auto:M-N%. This parameter
                              describes an integer that auto-increments every
                              time recorder is started. However, the numeric
                              sequence is restarted with every execution of the
                              Recorder binary. M has to be lower than N and they
                              together define a numeric range, both inclusive.
                              N could be omitted (%auto:M%) resulting on an
                              unlimited sequence of numbers starting at M.
                            - timestamp. Format: %ts%. This parameter will take
                              the current timestamp in the system (the time
                              represented as number of seconds since Epoch).
                            - time. Format: %T%. Current time expressed in ISO
                              8601 time format (THHMMSS). Example: T145502.
                              This parameter uses the strftime() parameter %T.
                            - short date. Format: %F%. Short date in YYYY-MM-DD
                              format. Example: 2001-08-23.
                              This parameter uses the strftime() parameter %F.
                              Note: this parameter will not vary in 24 hours, so
                              use with caution in combination with the rollover
                              time limit feature (time limit should be greater
                              than 1 day, otherwise, you may overwrite the same
                              file continously).
                            - date and time. Format: %c%. Date and time
                              representation, locale-dependent.
                              This parameter is based on the strftime() parameter %c 
                              but we use the time expressed in ISO 8601 
                              format (THHMMSS). 
                              Example: Thu Aug 23 T145502 2001
                        Note: using no parameters will yield the same file name
                        every time and thus, if a file rollover command is
                        received or scheduled, it will result in Recorder being
                        stopped (no more data can be stored without overwriting
                        the current only file).
                        Default: rti_recorder_default_%auto:0%.db (auto-numeric
                        starting at zero, unlimited).
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="rollover"
                        type="rolloverSettings"
                        minOccurs="0" />
        </xs:all>
    </xs:complexType>

    <xs:complexType name="InstanceIndexingType">
        <xs:all>
            <xs:element name="enabled"
                        minOccurs="0"
                        maxOccurs="1"
                        type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        Set this to true to enable instance indexing.
                        It's recommended to enable instance indexing only when
                        Replay is going to be used enabling the instance history
                        replay mode. You can also perform instance indexing
                        offline, see section [placeholder] in the User's Manual.
                        Default: false.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="timestamps" minOccurs="0" maxOccurs="1">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        The type of timestamp (reception, source or both) to
                        use when building the instance history index.
                        Default: RECEPTION.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="RECEPTION" />
                        <xs:enumeration value="SOURCE" />
                        <xs:enumeration value="BOTH" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:all>
    </xs:complexType>

    <xs:complexType name="storageSettings">
        <xs:sequence>
            <xs:choice minOccurs="0">
                <xs:element name="sqlite"
                            type="sqliteSettings"/>
                <xs:element name="plugin"
                            type="storagePlugin"/>
            </xs:choice>
            <xs:choice minOccurs="0">
                <xs:element minOccurs="0" name="flush_period" type="duration" >
                    <xs:annotation>
                        <xs:documentation>
                        <![CDATA[
                        The flush period defines the rate at which Recording
                        Service will automatically flush samples into permanent
                        storage. It's defined as a duration (seconds and
                        nanoseconds).
                        This setting can increase the performance when storing
                        the data on disk, since more samples will be flushed
                        together, making better usage of paging. However, very
                        long periods could potentially reduce the scalability
                        and responsiveness of the service, causing the
                        underlying thread to spend more time accessing the disk.
                        For large data samples, long periods could starve other
                        topics.
                        When this setting is not enabled, a pure event-driven
                        model is used, which performs well while keeping a
                        high reactiveness.
                        This setting is optional.
                        This setting cannot be set at the same time as the
                        <enable_buffering_mode> setting.
                        Default: not used (if not specified).
                        ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element minOccurs="0"
                            name="enable_buffering_mode"
                            type="xs:boolean" >
                    <xs:annotation>
                        <xs:documentation>
                        <![CDATA[
                        When this setting is true, Recording Service will start
                        in buffering mode. In this mode, no data flushing to
                        permanent storage will happen automatically, instead
                        happening only upon reception of a remote administration
                        'flush' command.
                        This setting is optional, and cannot be set at the same
                        time as the <flush_period> setting.
                        This feature requires Recording Service's remote
                        administration to be enabled. If it isn't enabled by
                        configuration, Recording Service will enable it
                        automatically if this setting is true.
                        Default: false.
                        ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:choice>
            <xs:element name="instance_indexing"
                        minOccurs="0"
                        maxOccurs="1"
                        type="InstanceIndexingType">
                    <xs:annotation>
                        <xs:documentation>
                        <![CDATA[
                        When this setting is enabled, Recorder will keep an
                        internal index about instances and their values. It will
                        also store this instance to disk once Recorder is
                        shutting down. This can affect the recording
                        performance. However, Replay startup time will be
                        improved when the Instance History Replay setting is
                        enabled (see section [placeholder] in the User’s
                        Manual).
                        If this setting is not enabled, Replay will build the
                        indexes while starting up, delaying the startup process.
                        Indexing can also be done offline, see section
                        [placeholder] in the User’s Manual.
                        ]]>
                        </xs:documentation>
                    </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- =================================================================== -->
    <!-- Recording Service configuration                                     -->
    <!-- =================================================================== -->
    <xs:complexType name="recordingService">
        <xs:complexContent>
            <xs:extension base="abstractService">
                <xs:sequence>
                    <!-- Output config -->
                    <xs:element name="storage"
                                minOccurs="0"
                                maxOccurs="1"
                                type="storageSettings"/>
                    <!-- Input config -->
                    <xs:element name="domain_participant"
                                minOccurs="0"
                                maxOccurs="unbounded"
                                type="userParticipant"/>
<!--                    <xs:element name="connection"
                                minOccurs="0"
                                maxOccurs="unbounded"
                                type="userConnection">
                        <xs:annotation>
                            <xs:documentation>
                                <![CDATA[
                                For internal use only.
                                 ]]>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>-->
                    <!-- Session -->
                    <xs:element name="session"
                                minOccurs="0"
                                maxOccurs="unbounded"
                                type="recordingSession"/>
                </xs:sequence>
                <xs:attribute name="verbosity" type="xs:integer"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- =================================================================== -->
    <!-- Root Element                                                        -->
    <!-- =================================================================== -->
    <xs:element name="dds">
        <xs:annotation>
            <xs:documentation>
                <![CDATA[
                Configuration of RTI Connext and RTI Recording Service.
                ]]>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">

                <!-- User Env -->
                <xs:element name="configuration_variables" type="KeyValuePairSeq">
                    <xs:annotation>
                        <xs:documentation>
                            <![CDATA[
                            Defines a set of default values for user variables.
                            The values specified in this section can be overridden
                            by command-line arguments, Library API, or
                            environment variables.
                            ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!-- Type definitions -->
                <xs:element name="types">
                    <xs:annotation>
                        <xs:documentation>
                            <![CDATA[
                            Defines types that can be used by
                            RTI Recording Service
                            ]]>
                        </xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:group ref="moduleElements"/>
                    </xs:complexType>
                </xs:element>

                <!-- QoS definitions -->
                <xs:element name="qos_library" type="qosLibrary">
                    <xs:annotation>
                        <xs:documentation>
                            <![CDATA[
                            Specifies a QoS library and profiles. The
                            contents of this tag are specified in the same
                            manner as for an RTI Connext QoS profile file
                            ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>

                <!-- Transformation and Storage plugins -->
                <xs:element name="plugin_library"
                                type="recorderPluginLibrary">
                    <xs:annotation>
                        <xs:documentation>
                            <![CDATA[
                            Specifies a library of transformation and
                            storage plugins.
                            ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>

                <!-- Recording Service Configuration -->
                <xs:element name="recording_service"
                                type="recordingService">
                    <xs:annotation>
                        <xs:documentation>
                            <![CDATA[
                            Specifies a named Recording Service instance
                            ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:choice>
        </xs:complexType>
    </xs:element>

</xs:schema>
