public ReadCardMessageHandler(IBusPublisher busPublisher, IOffersService offersService,
                               IPosTopicClassifier posTopicClassifier, IPosFeatureVerifier featureVerifier, ILogger <ReadCardMessageHandler> logger)
     : base(posTopicClassifier, logger, featureVerifier)
 {
     _busPublisher  = busPublisher ?? throw new ArgumentNullException(nameof(busPublisher));
     _offersService = offersService ?? throw new ArgumentNullException(nameof(offersService));
 }
Beispiel #2
0
        public MqttListenerService(IManagedMqttClient client, IManagedMqttClientOptions options, IConfiguration configuration, IServiceId serviceId,
                                   ILogger <MqttListenerService> logger, IPointsOfSaleService posService, IServiceProvider serviceProvider, IPosTopicClassifier posTopicClassifier)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (serviceId == null)
            {
                throw new ArgumentNullException(nameof(serviceId));
            }

            _client             = client ?? throw new ArgumentNullException(nameof(client));
            _options            = options ?? throw new ArgumentNullException(nameof(options));
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _posService         = posService ?? throw new ArgumentNullException(nameof(posService));
            _posTopicClassifier = posTopicClassifier ?? throw new ArgumentNullException(nameof(posTopicClassifier));

            _client.UseApplicationMessageReceivedHandler(OnMqttMessageReceived);
            _client.UseConnectedHandler(args => OnConnectedHandler(args));
            _client.UseDisconnectedHandler(args => OnDisconnectedHandler(args));

            _messageHandlers = serviceProvider.GetServices <IMqttMessageHandler>().ToArray();
        }
 public DispenseProductCommandHandler(IMqttMessagePublisher messagePublisher, IPosFeatureVerifier featureVerifier, IPosTopicClassifier posTopicClassifier)
 {
     _messagePublisher   = messagePublisher ?? throw new ArgumentNullException(nameof(messagePublisher));
     _featureVerifier    = featureVerifier ?? throw new ArgumentNullException(nameof(featureVerifier));
     _posTopicClassifier = posTopicClassifier ?? throw new ArgumentNullException(nameof(posTopicClassifier));
 }
 protected FeatureLimitedPosMessageHandlerBase(IPosTopicClassifier posTopicClassifier, ILogger logger, IPosFeatureVerifier featureVerifier)
 {
     PosTopicClassifier = posTopicClassifier ?? throw new ArgumentNullException(nameof(posTopicClassifier));
     Logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     FeatureVerifier    = featureVerifier ?? throw new ArgumentNullException(nameof(featureVerifier));
 }
 public ReadinessReportMessageHandler(IBusPublisher busPublisher, IPosTopicClassifier posTopicClassifier, IPosFeatureVerifier featureVerifier, ILogger <ReadinessReportMessageHandler> logger)
     : base(posTopicClassifier, logger, featureVerifier)
 {
     _busPublisher = busPublisher ?? throw new ArgumentNullException(nameof(busPublisher));
 }