コード例 #1
0
        public MessageConstructor(IOptions <CommonModels.Configurations> configurations, ITransactions transactions, ILoggingService loggingService)
        {
            _loggingService = loggingService;
            _deviceService  = new MessageConstructorDeviceService(configurations);
            _dataPopulator  = new DataPopulator();
            _kafkaPublisher = new DeviceMessageKafkaPublisher(configurations.Value, transactions);
            _dataValidator  = new DataValidator();

            _updateRequestStatusEventBuilder = new UpdateDeviceRequestStatusBuilder(new LocationUpdateRequestEventGenerator(), new FuelUpdateRequestEventGenerator(), new ECMInfoUpdateRequestEventGenerator(),
                                                                                    new TPMSPingUpdateRequestEventGenerator(), new PTOHoursVia1939UpdateRequestEventGenerator(), new BatteryVoltageVia1939UpdateRequestEventGenerator(),
                                                                                    new EventDiagonsticUpdateRequestEventGenerator());
            _updateEventMessageBuilder = new UpdateDeviceRequestMessageBuilder(_updateRequestStatusEventBuilder);
            _deviceTypeFamilyContainer = _deviceService.GetDeviceTypeFamily();
            _groupContainer            = GetGroupBuilderTypes();
        }
コード例 #2
0
 protected DeviceConfigRepositoryServiceBase(IInjectConfig injectInfo, IDeviceConfigRepository deviceConfigRepository, IParameterAttributeCache parameterAttributeCache, IMapper mapper,
                                             IAssetDeviceRepository assetDeviceRepository,
                                             IMessageConstructor messageConstructor,
                                             IAckBypasser ackBypasser,
                                             IDeviceConfigSettingConfig settingsConfig,
                                             IOptions <Configurations> configurations,
                                             ITransactions transactions,
                                             ILoggingService loggingService) : base(parameterAttributeCache, mapper, loggingService)
 {
     this._attributeMaps          = injectInfo.ResolveKeyed <DeviceConfigAttributeToRequestMaps>("DeviceConfigAttributeToRequestMaps");
     this._deviceConfigRepository = deviceConfigRepository;
     this._loggingService.CreateLogger(this.GetType());
     this._messageConstructor        = messageConstructor;
     this._ackBypasser               = ackBypasser;
     this._settingsConfig            = settingsConfig;
     this._assetDeviceRepository     = assetDeviceRepository;
     this._deviceService             = new MessageConstructorDeviceService(configurations);
     this._deviceTypeFamilyContainer = _deviceService.GetDeviceTypeFamily();
     this._configurations            = configurations;
     //this._assetDeviceConfigApiUrl = ConfigurationManager.AppSettings["PendingDeviceConfigApiUri"];
     this._pendingClearOffDeviceTypes = _configurations.Value.AppSettings.ClearOffPendingValueForDeviceTypes.Split(',').ToList();
     this._pendingClearOffDays        = _configurations.Value.AppSettings.ClearOffPendingValueGreaterThanNoOfDays;
     this._transactions = transactions;
 }