/// <summary> /// Extension method for adding the MSSQL watcher to the the WardenConfiguration with the default name of MSSQL Watcher. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="configuration">Configuration of MsSqlWatcher.</param> /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder AddMsSqlWatcher( this WardenConfiguration.Builder builder, MsSqlWatcherConfiguration configuration, Action <WatcherHooksConfiguration.Builder> hooks = null) { builder.AddWatcher(MsSqlWatcher.Create(configuration), hooks); return(builder); }
/// <summary> /// Extension method for adding the MSSQL watcher to the the WardenConfiguration with the default name of MSSQL Watcher. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="configuration">Configuration of MsSqlWatcher.</param> /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param> /// <param name="interval">Optional interval (5 seconds by default) after which the next check will be invoked.</param> /// <param name="group">Optional name of the group that MsSqlWatcher belongs to.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder AddMsSqlWatcher( this WardenConfiguration.Builder builder, MsSqlWatcherConfiguration configuration, Action <WatcherHooksConfiguration.Builder> hooks = null, TimeSpan?interval = null, string group = null) { builder.AddWatcher(MsSqlWatcher.Create(configuration, group), hooks, interval); return(builder); }
protected MsSqlWatcher(string name, MsSqlWatcherConfiguration configuration) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException("Watcher name can not be empty."); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration), "MSSQL Watcher configuration has not been provided."); } Name = name; _configuration = configuration; _msSql = _configuration.MsSqlProvider(); }
/// <summary> /// Factory method for creating a new instance of MsSqlWatcher. /// </summary> /// <param name="name">Name of the MsSqlWatcher.</param> /// <param name="configuration">Configuration of MsSqlWatcher.</param> /// <returns>Instance of MsSqlWatcher.</returns> public static MsSqlWatcher Create(string name, MsSqlWatcherConfiguration configuration) => new MsSqlWatcher(name, configuration);
/// <summary> /// Factory method for creating a new instance of MsSqlWatcher with default name of MSSQL Watcher. /// </summary> /// <param name="configuration">Configuration of MsSqlWatcher.</param> /// <returns>Instance of MsSqlWatcher.</returns> public static MsSqlWatcher Create(MsSqlWatcherConfiguration configuration) => Create(DefaultName, configuration);
public Default(MsSqlWatcherConfiguration configuration) : base(configuration) { SetInstance(this); }
protected Configurator(MsSqlWatcherConfiguration configuration) : base(configuration) { }
protected Configurator(string connectionString) { Configuration = new MsSqlWatcherConfiguration(connectionString); }
/// <summary> /// Factory method for creating a new instance of MsSqlWatcher. /// </summary> /// <param name="name">Name of the MsSqlWatcher.</param> /// <param name="configuration">Configuration of MsSqlWatcher.</param> /// <param name="group">Optional name of the group that MsSqlWatcher belongs to.</param> /// <returns>Instance of MsSqlWatcher.</returns> public static MsSqlWatcher Create(string name, MsSqlWatcherConfiguration configuration, string group = null) => new MsSqlWatcher(name, configuration, group);
/// <summary> /// Factory method for creating a new instance of MsSqlWatcher with default name of MSSQL Watcher. /// </summary> /// <param name="configuration">Configuration of MsSqlWatcher.</param> /// <param name="group">Optional name of the group that MsSqlWatcher belongs to.</param> /// <returns>Instance of MsSqlWatcher.</returns> public static MsSqlWatcher Create(MsSqlWatcherConfiguration configuration, string group = null) => Create(DefaultName, configuration, group);