Exemplo n.º 1
0
        public CloudConnectorService(IApiDispatcherService apiDispatcherService, ISettingsService settingsService, ILogService logService)
        {
            _log = logService?.CreatePublisher(nameof(CloudConnectorService)) ?? throw new ArgumentNullException(nameof(logService));
            _apiDispatcherService = apiDispatcherService ?? throw new ArgumentNullException(nameof(apiDispatcherService));

            _receiveRequestsUri = new Uri($"{BaseUri}/api/ControllerProxy/ReceiveRequests");
            _sendResponseUri    = new Uri($"{BaseUri}/api/ControllerProxy/SendResponse");

            _settings = settingsService?.GetSettings <CloudConnectorServiceSettings>() ?? throw new ArgumentNullException(nameof(settingsService));
        }
Exemplo n.º 2
0
        public CloudConnectorService(IApiDispatcherService apiDispatcherService, ISettingsService settingsService, ISystemInformationService systemInformationService, ILogService logService)
        {
            if (systemInformationService == null)
            {
                throw new ArgumentNullException(nameof(systemInformationService));
            }
            _log = logService?.CreatePublisher(nameof(CloudConnectorService)) ?? throw new ArgumentNullException(nameof(logService));
            _apiDispatcherService = apiDispatcherService ?? throw new ArgumentNullException(nameof(apiDispatcherService));

            _settings = settingsService?.GetSettings <CloudConnectorServiceSettings>() ?? throw new ArgumentNullException(nameof(settingsService));

            _receiveRequestsUri = $"{_settings.ServerAddress}/api/ControllerProxy/ReceiveRequests";
            _sendResponseUri    = $"{_settings.ServerAddress}/api/ControllerProxy/SendResponse";

            systemInformationService.Set("CloudConnector/IsConnected", () => _isConnected);
        }