Exemplo n.º 1
0
        void ConfigurateETL()
        {
            string  path   = AppDomain.CurrentDomain.BaseDirectory;
            IParser parser = new Converter.Converter();
            OptionsManager <EtlOptions> optionsManager = new OptionsManager <EtlOptions>(path, parser);

            etlOptions = optionsManager.GetOptions <EtlOptions>() as EtlOptions;

            Directory.CreateDirectory(etlOptions.DirectoryOptions.SourceDirectory);
            Directory.CreateDirectory(etlOptions.DirectoryOptions.TargetDirectory);

            sourceWatcher        = new FileSystemWatcher(etlOptions.DirectoryOptions.SourceDirectory);
            sourceWatcher.Filter = "*.txt";
            sourceWatcher.Filter = "*.xml";
            sourceWatcher.EnableRaisingEvents   = true;
            sourceWatcher.IncludeSubdirectories = true;
            sourceWatcher.Created            += SourceWatcher_Created;
            sourceWatcher.EnableRaisingEvents = true;

            logger = new Logger(etlOptions.LoggingOptions);
            Thread loggerThread = new Thread(new ThreadStart(logger.Start));

            loggerThread.Start();
            logger.Log($"Domain directory: {path}");
            logger.Log(optionsManager.log);
            logger.Log($"Source Directory: {etlOptions.DirectoryOptions.SourceDirectory}");
            logger.Log($"Encryption Enabled: {etlOptions.EncryptionOptions.EncryptionEnabled}");
            logger.Log($"Compression Enabled: {etlOptions.ArchiveOptions.CompressionEnabled}");
        }
Exemplo n.º 2
0
        public EtlXmlOptions(string xml)
        {
            IParser    parser        = new Converter.Converter();
            EtlOptions etlXmlOptions = parser.DeserializeXML <EtlOptions>(xml);

            DirectoryOptions  = etlXmlOptions.DirectoryOptions;
            EncryptionOptions = etlXmlOptions.EncryptionOptions;
            ArchiveOptions    = etlXmlOptions.ArchiveOptions;
            LoggingOptions    = etlXmlOptions.LoggingOptions;
        }