<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="shopware.benchmark_bundle.guzzle_config" type="collection">
            <parameter type="collection" key="defaults">
                <parameter key="timeout">7</parameter>
                <parameter key="connect_timeout">5</parameter>
            </parameter>
        </parameter>
    </parameters>

    <services>
        <defaults public="true" />

        <!-- Providers & Collectors -->
        <service id="shopware.benchmark_bundle.collector" class="Shopware\Bundle\BenchmarkBundle\BenchmarkCollector">
            <argument type="tagged" tag="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.shop"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\ShopProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.shopware"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\ShopwareProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="shopware.release"/>
            <argument type="service" id="Shopware\Components\License\Service\LocalLicenseUnpackService"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.manufacturers"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\ManufacturerProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.products"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\ProductsProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.emotions"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\EmotionsProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.categories"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\CategoriesProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.analytics"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\AnalyticsProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.plugins"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\PluginsProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.payments"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\PaymentsProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="shopware.benchmark_bundle.matcher_payment"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.customers"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\CustomersProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.shipments"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\ShipmentsProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="shopware.benchmark_bundle.matcher_shipping"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.orders"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\OrdersProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="shopware.benchmark_bundle.matcher_payment"/>
            <argument type="service" id="shopware.benchmark_bundle.matcher_shipping"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <service id="shopware.benchmark_bundle.providers.updated_orders"
                 class="Shopware\Bundle\BenchmarkBundle\Provider\UpdatedOrdersProvider"
                 public="false">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="shopware.benchmark_bundle.matcher_payment"/>
            <argument type="service" id="shopware.benchmark_bundle.matcher_shipping"/>
            <tag name="shopware.benchmark_provider" />
        </service>

        <!-- Services-->
        <service id="shopware.benchmark_bundle.repository.config" class="Shopware\Models\Benchmark\Repository">
            <factory service="Shopware\Components\Model\ModelManager" method="getRepository" />
            <argument type="string">\Shopware\Models\Benchmark\BenchmarkConfig</argument>
        </service>

        <service id="shopware.benchmark_bundle.components.template_caching_handler"
                 class="Shopware\Bundle\BenchmarkBundle\Service\TemplateCachingHandler">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
        </service>

        <service id="shopware.benchmark_bundle.components.translation"
                 class="Shopware\Bundle\BenchmarkBundle\Service\TranslationService">
            <argument type="service" id="Shopware_Components_Snippet_Manager"/>
            <argument type="service" id="Shopware\Components\Model\ModelManager"/>
        </service>

        <service id="shopware.benchmark_bundle.matcher_shipping" class="Shopware\Bundle\BenchmarkBundle\Service\MatcherService">
            <argument>%shopware.benchmark_bundle.shipment_mapping%</argument>
        </service>

        <service id="shopware.benchmark_bundle.matcher_payment" class="Shopware\Bundle\BenchmarkBundle\Service\MatcherService">
            <argument>%shopware.benchmark_bundle.payment_mapping%</argument>
        </service>

        <!-- Transmission services -->
        <service id="shopware.benchmark_bundle.commands.send_data" class="Shopware\Bundle\BenchmarkBundle\Commands\SendStatisticsCommand">
            <tag name="console.command" command="sw:benchmark:send"/>
        </service>

        <service id="shopware.benchmark_bundle.commands.receive_data" class="Shopware\Bundle\BenchmarkBundle\Commands\ReceiveStatisticsCommand">
            <tag name="console.command" command="sw:benchmark:receive"/>
        </service>

        <service id="shopware.benchmark_bundle.bi_transmission"
                 class="Shopware\Bundle\BenchmarkBundle\Service\BusinessIntelligenceService">
            <argument type="service" id="shopware.benchmark_bundle.bi_client"/>
            <argument type="service" id="shopware.benchmark_bundle.repository.config"/>
        </service>

        <service id="shopware.benchmark_bundle.statistics_transmission"
                 class="Shopware\Bundle\BenchmarkBundle\Service\StatisticsService">
            <argument type="service" id="shopware.benchmark_bundle.collector"/>
            <argument type="service" id="shopware.benchmark_bundle.statistics_client"/>
            <argument type="service" id="shopware.benchmark_bundle.repository.config"/>
            <argument type="service" id="Shopware\Bundle\StoreFrontBundle\Service\ContextServiceInterface"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
        </service>

        <service id="shopware.benchmark_bundle.benchmark_statistics"
                 class="Shopware\Bundle\BenchmarkBundle\Service\BenchmarkStatisticsService">
            <argument type="service" id="shopware.benchmark_bundle.repository.config"/>
            <argument type="service" id="shopware.benchmark_bundle.statistics_transmission"/>
            <argument type="service" id="shopware.benchmark_bundle.bi_transmission"/>
        </service>

        <service id="shopware.benchmark_bundle.bi_client"
                 class="Shopware\Bundle\BenchmarkBundle\BusinessIntelligenceClient"
                 public="false">
            <argument type="string">%shopware.bi.endpoint.benchmark%</argument>
            <argument type="service" id="shopware.benchmark_bundle.client"/>
            <argument type="service" id="shopware.benchmark_bundle.hydrator.bi_response_hydrator"/>
            <argument type="service" id="shopware_benchmark_bundle.benchmark_encryption"/>
            <argument type="service" id="corelogger"/>
        </service>

        <service id="shopware.benchmark_bundle.statistics_client"
                 class="Shopware\Bundle\BenchmarkBundle\StatisticsClient"
                 public="false">
            <argument type="string">%shopware.bi.endpoint.statistics%</argument>
            <argument type="service" id="shopware.benchmark_bundle.client"/>
            <argument type="service" id="shopware.benchmark_bundle.hydrator.statistics_response_hydrator"/>
            <argument type="service" id="corelogger"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
        </service>

        <service id="shopware.benchmark_bundle.hydrator.statistics_response_hydrator"
                 class="Shopware\Bundle\BenchmarkBundle\Hydrator\StatisticsResponseHydrator"/>

        <service id="shopware.benchmark_bundle.hydrator.bi_response_hydrator"
                 class="Shopware\Bundle\BenchmarkBundle\Hydrator\BusinessIntelligenceResponseHydrator"
                 public="false" />

        <service id="shopware.benchmark_bundle.client"
                 class="Shopware\Components\HttpClient\GuzzleHttpClient"
                 public="false">
            <argument type="service" id="guzzle_http_client_factory"/>
            <argument type="collection" id="shopware.benchmark_bundle.guzzle_config" />
        </service>

        <service id="shopware_benchmark_bundle.benchmark_encryption"
                 class="Shopware\Bundle\BenchmarkBundle\BenchmarkEncryption"
                 public="false">
            <argument type="string">%kernel.root_dir%/engine/Shopware/Components/HttpClient/public.key</argument>
        </service>

        <service id="shopware_attribute.backend_controllers_benchmark" class="Shopware_Controllers_Backend_Benchmark">
            <tag name="shopware.controller" module="backend" controller="Benchmark"/>
        </service>

        <service id="shopware_attribute.backend_controllers_benchmark_local_overview" class="Shopware_Controllers_Backend_BenchmarkLocalOverview">
            <tag name="shopware.controller" module="backend" controller="BenchmarkLocalOverview"/>
        </service>

        <service id="shopware_attribute.backend_controllers_benchmark_overview" class="Shopware_Controllers_Backend_BenchmarkOverview">
            <tag name="shopware.controller" module="backend" controller="BenchmarkOverview"/>
        </service>

    </services>
</container>
