/// <summary> /// Creates a new instance of a SubscriptionsManager that uses the specified connection to manage subscriptions. /// </summary> /// <param name="connectionHandler">The connection handler that will be used to subscribe to topics.</param> /// <param name="publishingManager">The punlishing manager that handles the receipt of messages from the broker.</param> public SubscriptionsManager(IMqttConnectionHandler connectionHandler, IPublishingManager publishingManager) { this.connectionHandler = connectionHandler; this.publishingManager = publishingManager; this.connectionHandler.RegisterForMessage(MqttMessageType.SubscribeAck, ConfirmSubscription); this.connectionHandler.RegisterForMessage(MqttMessageType.UnsubscribeAck, ConfirmUnsubscribe); }
public Runner(IAppointmentChecker appointmentChecker , IPublishingManager publishingManager , IInputManager inputManager) { var configTextRaw = File.ReadAllText(@"./config/configuration.json"); _configuration = JsonConvert.DeserializeObject <Configuration>(configTextRaw); _zipConfigPath = _configuration.zipFilePath; _csvConfigPath = _configuration.csvFilePath; stopWatch = new Stopwatch(); stopWatch.Start(); _appointmentChecker = appointmentChecker; _publishingManager = publishingManager; _inputManager = inputManager; AppointmentChecker.SetAppointmentEndpointUrl(_configuration.endpoint); _appointmentChecker.SetHeader("accept-language", "en-US,en;q=0.9"); _appointmentChecker.SetHeader("cookie", _configuration.cookie); _appointmentChecker.SetHeader("x-xsrf-token", _configuration.xsrfToken); }