Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
 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));
 }
Ejemplo n.º 5
0
 public ReadinessReportMessageHandler(IBusPublisher busPublisher, IPosTopicClassifier posTopicClassifier, IPosFeatureVerifier featureVerifier, ILogger <ReadinessReportMessageHandler> logger)
     : base(posTopicClassifier, logger, featureVerifier)
 {
     _busPublisher = busPublisher ?? throw new ArgumentNullException(nameof(busPublisher));
 }