public DirectoryWatchdog(string directoryPath, string filter, IWatchdogThread watchdogThread)
        {
            if (directoryPath == null)
            {
                throw new ArgumentNullException(nameof(directoryPath));
            }

            _directoryPath  = directoryPath;
            _filter         = filter;
            _watchdogThread = watchdogThread;
            _filterRegex    = GetFilterRegex(filter);
            if (directoryPath == null)
            {
                throw new ArgumentNullException(nameof(directoryPath));
            }
            if (!Directory.Exists(directoryPath))
            {
                throw new InvalidOperationException($"Directory {directoryPath} does not exist");
            }

            _watcher = new FileSystemWatcher(directoryPath, filter)
            {
                IncludeSubdirectories = true
            };
            _watcher.Created += OnCreated;
            _watcher.Renamed += OnRenamed;
            _watcher.Changed += OnChanged;
            _watcher.Deleted += OnDeleted;
        }
        public SynchronizerEngine
        (
            IWatchdogThread watchdogThread,
            IControllerFactory controllerFactory,
            IConfigurationReader configurationReader,

            IHealthChecker healthChecker
        )
            : base(watchdogThread, controllerFactory)
        {
            _configurationReader = configurationReader;
            _healthChecker       = healthChecker;
        }
Esempio n. 3
0
 public NodeEngine(IWatchdogThread watchdogThread, IControllerFactory controllerFactory, IConfigurationReader configurationReader)
     : base(watchdogThread, controllerFactory)
 {
     _configurationReader = configurationReader;
 }
Esempio n. 4
0
 protected Engine(IWatchdogThread watchdogThread, IControllerFactory controllerFactory)
 {
     _watchdogThread    = watchdogThread;
     _controllerFactory = controllerFactory;
 }
Esempio n. 5
0
 public EngineTester(IWatchdogThread watchdogThread, IControllerFactory controllerFactory, RestConfiguration restConfiguration)
     : base(watchdogThread, controllerFactory)
 {
     _restConfiguration = restConfiguration;
 }