コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SendMessageCommandHandler" /> class.
        /// </summary>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="serializer">The serializer.</param>
        /// <param name="optionsFactory">The options factory.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="commandCache">The command cache.</param>
        /// <param name="configurationSend">The configuration send.</param>
        /// <param name="sendJobStatus">The send job status.</param>
        /// <param name="jobExistsHandler">The job exists handler.</param>
        /// <param name="jobSchedulerMetaData">The job scheduler meta data.</param>
        public SendMessageCommandHandler(ITableNameHelper tableNameHelper,
                                         ICompositeSerialization serializer,
                                         ISqlServerMessageQueueTransportOptionsFactory optionsFactory,
                                         IHeaders headers,
                                         SqlServerCommandStringCache commandCache,
                                         TransportConfigurationSend configurationSend,
                                         ICommandHandler <SetJobLastKnownEventCommand <SqlConnection, SqlTransaction> > sendJobStatus, IQueryHandler <DoesJobExistQuery <SqlConnection, SqlTransaction>, QueueStatuses> jobExistsHandler,
                                         IJobSchedulerMetaData jobSchedulerMetaData)
        {
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => serializer, serializer);
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => headers, headers);
            Guard.NotNull(() => commandCache, commandCache);
            Guard.NotNull(() => configurationSend, configurationSend);
            Guard.NotNull(() => sendJobStatus, sendJobStatus);
            Guard.NotNull(() => jobExistsHandler, jobExistsHandler);
            Guard.NotNull(() => jobSchedulerMetaData, jobSchedulerMetaData);

            _tableNameHelper      = tableNameHelper;
            _serializer           = serializer;
            _options              = new Lazy <SqlServerMessageQueueTransportOptions>(optionsFactory.Create);
            _headers              = headers;
            _commandCache         = commandCache;
            _configurationSend    = configurationSend;
            _sendJobStatus        = sendJobStatus;
            _jobExistsHandler     = jobExistsHandler;
            _jobSchedulerMetaData = jobSchedulerMetaData;
        }
コード例 #2
0
        private SqlServerMessageQueueSchema Create(ISqlServerMessageQueueTransportOptionsFactory options, TableNameHelper tableNameHelper)
        {
            var connection = Substitute.For <IConnectionInformation>();

            connection.QueueName.Returns("test");
            return(Create(options, tableNameHelper, connection));
        }
コード例 #3
0
        public BuildDequeueCommand(ISqlServerMessageQueueTransportOptionsFactory optionsFactory,
                                   CreateDequeueStatement createDequeueStatement)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => createDequeueStatement, createDequeueStatement);

            _options = new Lazy <SqlServerMessageQueueTransportOptions>(optionsFactory.Create);
            _createDequeueStatement = createDequeueStatement;
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionHolderFactory" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="options">The options.</param>
        public ConnectionHolderFactory(IConnectionInformation connectionInfo,
                                       ISqlServerMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => options, options);

            _connectionInfo = connectionInfo;
            _options        = new Lazy <SqlServerMessageQueueTransportOptions>(options.Create);
        }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionFactory" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="options">The options.</param>
        public ConnectionFactory(IConnectionInformation connectionInfo,
            ISqlServerMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => options, options);

            _connectionInfo = connectionInfo;
            _options = new Lazy<SqlServerMessageQueueTransportOptions>(options.Create);
        }
コード例 #6
0
        public OptionsSerialization(ISqlServerMessageQueueTransportOptionsFactory options,
                                    IInternalSerializer serializer)
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => serializer, serializer);

            _serializer = serializer;
            _options    = new Lazy <SqlServerMessageQueueTransportOptions>(options.Create);
        }
コード例 #7
0
        public BuildDequeueCommand(ISqlServerMessageQueueTransportOptionsFactory optionsFactory,
            CreateDequeueStatement createDequeueStatement)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => createDequeueStatement, createDequeueStatement);

            _options = new Lazy<SqlServerMessageQueueTransportOptions>(optionsFactory.Create);
            _createDequeueStatement = createDequeueStatement;
        }
コード例 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerMessageQueueSchema"/> class.
        /// </summary>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="options">The options.</param>
        public SqlServerMessageQueueSchema(TableNameHelper tableNameHelper,
            ISqlServerMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => options, options);

            _tableNameHelper = tableNameHelper;
            _options = new Lazy<SqlServerMessageQueueTransportOptions>(options.Create);
        } 
コード例 #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerMessageQueueSchema"/> class.
        /// </summary>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="options">The options.</param>
        public SqlServerMessageQueueSchema(TableNameHelper tableNameHelper,
                                           ISqlServerMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => options, options);

            _tableNameHelper = tableNameHelper;
            _options         = new Lazy <SqlServerMessageQueueTransportOptions>(options.Create);
        }
コード例 #10
0
        public CreateDequeueStatement(ISqlServerMessageQueueTransportOptionsFactory optionsFactory,
                                      ITableNameHelper tableNameHelper,
                                      SqlServerCommandStringCache commandCache)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => commandCache, commandCache);

            _options         = new Lazy <SqlServerMessageQueueTransportOptions>(optionsFactory.Create);
            _tableNameHelper = tableNameHelper;
            _commandCache    = commandCache;
        }
コード例 #11
0
        public CreateDequeueStatement(ISqlServerMessageQueueTransportOptionsFactory optionsFactory,
            TableNameHelper tableNameHelper,
            SqlServerCommandStringCache commandCache)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => commandCache, commandCache);

            _options = new Lazy<SqlServerMessageQueueTransportOptions>(optionsFactory.Create);
            _tableNameHelper = tableNameHelper;
            _commandCache = commandCache;
        }
コード例 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RollbackMessageCommandHandler" /> class.
 /// </summary>
 /// <param name="getUtcDateQuery">The get UTC date query.</param>
 /// <param name="options">The options.</param>
 /// <param name="tableNameHelper">The table name helper.</param>
 /// <param name="connectionInformation">The connection information.</param>
 /// <param name="commandCache">The command cache.</param>
 public RollbackMessageCommandHandler(IGetTimeFactory getUtcDateQuery,
                                      ISqlServerMessageQueueTransportOptionsFactory options,
                                      TableNameHelper tableNameHelper,
                                      IConnectionInformation connectionInformation,
                                      SqlServerCommandStringCache commandCache)
 {
     _getUtcDateQuery       = getUtcDateQuery;
     _options               = new Lazy <SqlServerMessageQueueTransportOptions>(options.Create);
     _tableNameHelper       = tableNameHelper;
     _connectionInformation = connectionInformation;
     _commandCache          = commandCache;
     _rollbackDictionary    = new ConcurrentDictionary <string, string>();
 }
コード例 #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerMessageQueueCreation" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="queryTableExists">The query table exists.</param>
        /// <param name="options">The options.</param>
        /// <param name="createSchema">The create schema.</param>
        /// <param name="createCommand">The create command.</param>
        /// <param name="deleteCommand">The delete command.</param>
        /// <param name="creationScope">The creation scope.</param>
        public SqlServerMessageQueueCreation(IConnectionInformation connectionInfo, RelationalDatabase.IQueryHandler <GetTableExistsQuery, bool> queryTableExists,
                                             ISqlServerMessageQueueTransportOptionsFactory options,
                                             SqlServerMessageQueueSchema createSchema,
                                             ICommandHandlerWithOutput <CreateQueueTablesAndSaveConfigurationCommand <ITable>, QueueCreationResult> createCommand,
                                             ICommandHandlerWithOutput <DeleteQueueTablesCommand, QueueRemoveResult> deleteCommand,
                                             ICreationScope creationScope
                                             )
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => createSchema, createSchema);
            Guard.NotNull(() => queryTableExists, queryTableExists);
            Guard.NotNull(() => createCommand, createCommand);
            Guard.NotNull(() => deleteCommand, deleteCommand);
            Guard.NotNull(() => creationScope, creationScope);

            _options          = new Lazy <SqlServerMessageQueueTransportOptions>(options.Create);
            _createSchema     = createSchema;
            _queryTableExists = queryTableExists;
            _createCommand    = createCommand;
            _deleteCommand    = deleteCommand;
            ConnectionInfo    = connectionInfo;
            Scope             = creationScope;
        }
コード例 #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerMessageQueueCreation" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="queryTableExists">The query table exists.</param>
        /// <param name="options">The options.</param>
        /// <param name="createSchema">The create schema.</param>
        /// <param name="createCommand">The create command.</param>
        /// <param name="deleteCommand">The delete command.</param>
        /// <param name="creationScope">The creation scope.</param>
        public SqlServerMessageQueueCreation(IConnectionInformation connectionInfo,
            IQueryHandler<GetTableExistsQuery, bool> queryTableExists,
            ISqlServerMessageQueueTransportOptionsFactory options, 
            SqlServerMessageQueueSchema createSchema,
            ICommandHandlerWithOutput<CreateQueueTablesAndSaveConfigurationCommand, QueueCreationResult> createCommand,
            ICommandHandlerWithOutput<DeleteQueueTablesCommand, QueueRemoveResult> deleteCommand,
            ICreationScope creationScope
            )
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => createSchema, createSchema);
            Guard.NotNull(() => queryTableExists, queryTableExists);
            Guard.NotNull(() => createCommand, createCommand);
            Guard.NotNull(() => deleteCommand, deleteCommand);
            Guard.NotNull(() => creationScope, creationScope);

            _options = new Lazy<SqlServerMessageQueueTransportOptions>(options.Create);
            _createSchema = createSchema;
            _queryTableExists = queryTableExists;
            _createCommand = createCommand;
            _deleteCommand = deleteCommand;
            ConnectionInfo = connectionInfo;
            Scope = creationScope;
        }
コード例 #15
0
 private SqlServerMessageQueueSchema Create(ISqlServerMessageQueueTransportOptionsFactory options)
 {
     return(Create(options, GetTableNameHelper()));
 }
コード例 #16
0
 private SqlServerMessageQueueSchema Create(ISqlServerMessageQueueTransportOptionsFactory options)
 {
     return Create(options, GetTableNameHelper());
 }
コード例 #17
0
 private SqlServerMessageQueueSchema Create(ISqlServerMessageQueueTransportOptionsFactory options, TableNameHelper tableNameHelper)
 {
     return new SqlServerMessageQueueSchema(tableNameHelper, options);
 }
コード例 #18
0
 private SqlServerMessageQueueSchema Create(ISqlServerMessageQueueTransportOptionsFactory options, TableNameHelper tableNameHelper, IConnectionInformation connectionInformation)
 {
     return(new SqlServerMessageQueueSchema(tableNameHelper, options, new SqlSchema(connectionInformation)));
 }
コード例 #19
0
 private SqlServerMessageQueueSchema Create(ISqlServerMessageQueueTransportOptionsFactory options, TableNameHelper tableNameHelper)
 {
     return(new SqlServerMessageQueueSchema(tableNameHelper, options));
 }
コード例 #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TransportOptionsFactory"/> class.
 /// </summary>
 /// <param name="factory">The factory.</param>
 public TransportOptionsFactory(ISqlServerMessageQueueTransportOptionsFactory factory)
 {
     Guard.NotNull(() => factory, factory);
     _factory = factory;
 }