Exemplo n.º 1
0
 public IpWatchDogService(ILog log, AppConfig config, IIpPersistor persistor, IIpRetriever retriever, IIpNotifier notifier)
 {
     _log = log;
     _persistor = persistor;
     _retriever = retriever;
     _notifier = notifier;
     _config = config;
 }
Exemplo n.º 2
0
 public CommandIpNotifier(ILog log, AppConfig config)
 {
     _log = log;
     _command = config.Command.Trim();
     if (String.IsNullOrEmpty(_command))
     {
         throw new ArgumentException("Command cannot be null or empty");
     }
 }
Exemplo n.º 3
0
 private IIpNotifier CreateNotifier(AppConfig config)
 {
     if (string.IsNullOrEmpty(config.Command))
     {
         return new MailIpNotifier(_log, config);
     }
     else
     {
         return new CommandIpNotifier(_log, config);
     }
 }
Exemplo n.º 4
0
        private IService CreateWatchDogService()
        {
            var config = new AppConfig();

            return new IpWatchDogService(
                _log, 
                config,
                new IpPersistor(_log), 
                new WebIpRetriever(_log), 
                new MailIpNotifier(_log, config));
        }
Exemplo n.º 5
0
 public MailIpNotifier(ILog log, AppConfig config)
 {
     _log = log;
     _config = config;
 }
Exemplo n.º 6
0
 public WebIpRetriever(ILog log, AppConfig config)
 {
     _log    = log;
     _config = config;
 }