Esempio n. 1
0
 /// <summary>
 /// Initializes a new <see cref="SQLSubscriptionTrackingService"/> with the specified connection
 /// provider and dialect
 /// </summary>
 /// <param name="connectionProvider">The connection provider to use to connect to
 ///     the SQL database</param>
 /// <param name="commandBuilders">A collection of factories capable of
 ///     generating database commands for manipulating subscriptions that conform to the SQL
 ///     syntax required by the underlying connection provider</param>
 /// <param name="diagnosticService">(Optional) The service through which diagnostic events
 ///     are reported and processed</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="connectionProvider"/>
 /// or <paramref name="commandBuilders"/> is <c>null</c></exception>
 public SQLSubscriptionTrackingService(IDbConnectionProvider connectionProvider,
                                       ISubscriptionTrackingCommandBuilders commandBuilders,
                                       IDiagnosticService diagnosticService = null)
 {
     DiagnosticService  = diagnosticService ?? Diagnostics.DiagnosticService.DefaultInstance;
     ConnectionProvider = connectionProvider ?? throw new ArgumentNullException(nameof(connectionProvider));
     _commandBuilders   = commandBuilders ?? throw new ArgumentNullException(nameof(commandBuilders));
 }
        protected void WhenInitializingBuilders()
        {
            var factory = new CommandBuildersFactory(ConnectionStringSettings);

            MessageJournalingCommandBuilders    = factory.InitMessageJournalingCommandBuilders();
            MessageQueueingCommandBuilders      = factory.InitMessageQueueingCommandBuilders();
            SubscriptionTrackingCommandBuilders = factory.InitSubscriptionTrackingCommandBuilders();
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new <see cref="SQLSubscriptionTrackingService"/> with the specified connection
 /// string settings and dialect
 /// </summary>
 /// <param name="connectionStringSettings">The connection string settings to use to connect to
 ///     the SQL database</param>
 /// <param name="commandBuilders">(Optional) A collection of factories capable of
 ///     generating database commands for manipulating subscriptions that conform to the SQL
 ///     syntax required by the underlying connection provider (if needed)</param>
 /// <param name="diagnosticService">(Optional) The service through which diagnostic events
 ///     are reported and processed</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="connectionStringSettings"/>
 ///     is <c>null</c></exception>
 /// <remarks>
 /// If a SQL dialect is not specified, then one will be selected based on the supplied
 /// connection string settings
 /// </remarks>
 /// <seealso cref="ISubscriptionTrackingCommandBuildersProvider"/>
 public SQLSubscriptionTrackingService(ConnectionStringSettings connectionStringSettings, ISubscriptionTrackingCommandBuilders commandBuilders = null, IDiagnosticService diagnosticService = null)
 {
     if (connectionStringSettings == null)
     {
         throw new ArgumentNullException(nameof(connectionStringSettings));
     }
     DiagnosticService  = diagnosticService ?? Diagnostics.DiagnosticService.DefaultInstance;
     ConnectionProvider = new DefaultConnectionProvider(connectionStringSettings, DiagnosticService);
     _commandBuilders   = commandBuilders ??
                          new CommandBuildersFactory(connectionStringSettings, DiagnosticService)
                          .InitSubscriptionTrackingCommandBuilders();
 }