services:
    oro_sync.websocket_client:
        alias: oro_sync.websocket_client.basic
        public: true

    oro_sync.websocket_client.basic:
        class: Oro\Bundle\SyncBundle\Client\WebsocketClient
        arguments:
            - '@oro_sync.client.wamp.factory'
            - '@oro_sync.client.backend_websocket_parameters.provider'
            - '@oro_sync.authentication.ticket_provider'

    oro_sync.client.logger_aware_decorator:
        class: Oro\Bundle\SyncBundle\Client\LoggerAwareWebsocketClientDecorator
        decorates: oro_sync.websocket_client
        arguments:
            - '@.inner'
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: oro_websocket }

    oro_sync.client.manipulator:
        class: Oro\Bundle\SyncBundle\Client\ClientManipulator
        decorates: gos_web_socket.client.manipulator
        arguments:
            - '@.inner'
            - '@gos_web_socket.client.storage'
            - '@oro_user.security.provider'
            - '@oro_sync.authentication.ticket_provider'
            - '@oro_sync.authentication.websocket_authentication_by_ticket_provider'
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: oro_websocket }

    oro_sync.client.frontend_websocket_parameters.provider:
        class: Oro\Bundle\SyncBundle\Provider\WebsocketClientParametersProvider
        arguments:
            - '%websocket_frontend_dsn%'

    oro_sync.client.backend_websocket_parameters.provider:
        class: Oro\Bundle\SyncBundle\Provider\WebsocketClientParametersProvider
        arguments:
            - '%websocket_backend_dsn%'

    oro_sync.client.wamp.factory:
        class: Oro\Bundle\SyncBundle\Client\Wamp\Factory\WampClientFactory
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: oro_websocket }
