Esempio n. 1
0
        // TODO: Better dependency injection
        public InterNodeConnectionManager(IInfrastructureConfiguration configuration,
                                          GlobalConfigurationService globalConfigurationService)
        {
            this.configuration = configuration;
            this.globalConfigurationService = globalConfigurationService;
            this.server = new Grpc.Core.Server();

            var implementation =
                new CidaInfrastructureServiceImplementation(this.logger, this.globalConfigurationService);

            this.server.Services.Add(
                CidaInfrastructureService.BindService(implementation));

            implementation.OnSynchronize += this.ImplementationOnOnSynchronize;
        }
Esempio n. 2
0
        public FtpClient(GlobalConfigurationService globalConfiguration, ILogger logger)
        {
            this.logger = logger;
            globalConfiguration.ConfigurationChanged +=
                () => this.settings = globalConfiguration.ConfigurationManager.Ftp;

            if (System.IO.Directory.Exists(tempFolder))
            {
                logger.Info($"Clearing ftp temp folder : '{tempFolder}'");
                foreach (var file in System.IO.Directory.GetFiles(tempFolder))
                {
                    File.Delete(file);
                }
            }
        }
Esempio n. 3
0
 public CidaInfrastructureServiceImplementation(ILogger logger,
                                                GlobalConfigurationService globalConfigurationService)
 {
     this.logger = logger;
     this.globalConfigurationService = globalConfigurationService;
 }