public MqttEntityIdentifierSuggestionService(
     IMqttIdentifierService mqttIdentifierService,
     IIdentifierDictionaryFileAccessor identifierDictionary,
     IApplicationDbContext dbContext)
 {
     _mqttIdentifierService = mqttIdentifierService;
     _identifierCandidates  = identifierDictionary.ListIdentifiers(IdentifierDictionaryFilePath);
     _dbContext             = dbContext;
     _rand = new Random();
 }
예제 #2
0
 public MqttMessageIngestionService(
     IDeviceService deviceService,
     IMqttIdentifierService mqttIdentifierService,
     IMosquittoBrokerService brokerService,
     ISensorValueService valueService,
     ILogger <MqttMessageIngestionService> logger
     )
 {
     _deviceService         = deviceService;
     _mqttIdentifierService = mqttIdentifierService;
     _brokerService         = brokerService;
     _valueService          = valueService;
     _logger = logger;
 }
예제 #3
0
 public DevicesController(
     ILogger <DevicesController> logger,
     IDeviceService service,
     IMqttEntityIdentifierSuggestionService identifierSuggestService,
     IMqttIdentifierService mqttService,
     ISecureKeySuggestionService SecureKeySuggestionService,
     IMqttClientConfigService configService,
     IServerHostAccessor hostAccessor,
     ISensorValueService valueService)
 {
     _logger      = logger;
     _service     = service;
     _mqttService = mqttService;
     _identifierSuggestService   = identifierSuggestService;
     _secureKeySuggestionService = SecureKeySuggestionService;
     _configService = configService;
     _hostAccessor  = hostAccessor;
     _valueService  = valueService;
 }
예제 #4
0
        public MqttMessageIngestionServiceTest()
        {
            _dbContext = ApplicationDbContextHelper.BuildTestDbContext();
            _initial   = SystemClock.Instance.GetCurrentInstant();
            _clock     = new FakeClock(_initial);

            var mock = new Mock <IMosquittoBrokerPidAccessor>();

            mock.SetupGet(a => a.BrokerPid).Returns(10000);
            var mockPlugin = new Mock <IMosquittoBrokerPluginPidService>();

            mockPlugin.SetupGet(a => a.BrokerPidFromAuthPlugin).Returns(10000);

            _brokerService = new MosquittoBrokerService(_clock, new NullLogger <MosquittoBrokerService>(), mock.Object, mockPlugin.Object);

            _mqttIdentifierService = new MqttIdentifierService(_clock);
            _deviceService         = new DeviceService(_dbContext, _mqttIdentifierService);
            _valueService          = new SensorValueService(_dbContext);

            _service = new MqttMessageIngestionService(_deviceService, _mqttIdentifierService, _brokerService, _valueService, new NullLogger <MqttMessageIngestionService>());
        }
예제 #5
0
 public DeviceService(IApplicationDbContext dbContext, IMqttIdentifierService identifierService)
 {
     _dbContext         = dbContext;
     _identifierService = identifierService;
 }