public UiConfigurationService(IFileSystemService fileSystemService, IWebHostEnvironment hostingEnvironment, IJsonSerializerService jsonSerializerService, IAdapterSettingService adapterSettingService)
 {
     _fileSystemService     = fileSystemService;
     _hostingEnvironment    = hostingEnvironment;
     _jsonSerializerService = jsonSerializerService;
     _adapterSettingService = adapterSettingService;
 }
Exemplo n.º 2
0
 public ApiController(IAdapterService adapterService, IAdapterSettingService adapterSettingService, ILogService logService, IHostApplicationLifetime hostApplicationLifetime)
 {
     _adapterService          = adapterService;
     _adapterSettingService   = adapterSettingService;
     _logService              = logService;
     _hostApplicationLifetime = hostApplicationLifetime;
 }
Exemplo n.º 3
0
 public ConfigurationController(IUiConfigurationService uiConfigurationService, IAdapterSettingService adapterSettingService)
 {
     _uiConfigurationService = uiConfigurationService;
     _adapterSettingService  = adapterSettingService;
 }
Exemplo n.º 4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IWebHostEnvironment env,
                              ILogService logService,
                              ILogMessageFactory logMessageFactory,
                              IConnectionProvider connectionProvider,
                              IMqttRepository repository,
                              IMqttCommandAdapter commandAdapter,
                              IAdapterSettingService adapterSettingService,
                              IUiConfigurationService uiConfigurationService,
                              INotificationService notificationService,
                              ISettingsService settingsService,
                              IFileSystemService fileSystemService,
                              ILogFormatterService logFormatterService,
                              ILogFileService logFileService,
                              ISettingsProvider settingsProvider)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });

            settingsProvider.ReadSettings();

            logService.RegisterSinks(new List <IlogSink>
            {
                new ConsoleLogSink(),
                new MemoryLogSink(logMessageFactory, notificationService),
                new FileLogSink(fileSystemService, logFormatterService, logFileService)
            });

            if (Debugger.IsAttached)
            {
                logService.RegisterSink(new DebugLogSink());
            }

            logService.Log(LogSeverity.Info, "Logging started.");

            var repo = new DatabaseRepository();

            repo.InitializeDatabase();

            commandAdapter.Initialize();
            connectionProvider.InitializeConnection();
            repository.Initialize();
            adapterSettingService.Initialize();
            uiConfigurationService.ReadAllConfigurationFiles();

            ConfigureSystemSpecifics(app.ApplicationServices);
            app.ApplicationServices.GetService <ICustomCommandConfigurationService>().ReloadConfiguration();
        }