/// <summary>
        /// Initializes a new instance of the <see cref="SqLiteMessageQueueSchema"/> class.
        /// </summary>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="options">The options.</param>
        public SqLiteMessageQueueSchema(TableNameHelper tableNameHelper,
            ISqLiteMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => options, options);

            _tableNameHelper = tableNameHelper;
            _options = new Lazy<SqLiteMessageQueueTransportOptions>(options.Create);
        } 
        /// <summary>
        /// Initializes a new instance of the <see cref="SqLiteMessageQueueSchema"/> class.
        /// </summary>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="options">The options.</param>
        public SqLiteMessageQueueSchema(ITableNameHelper tableNameHelper,
                                        ISqLiteMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => options, options);

            _tableNameHelper = tableNameHelper;
            _options         = new Lazy <SqLiteMessageQueueTransportOptions>(options.Create);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="OptionsSerialization"/> class.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="serializer">The serializer.</param>
        public OptionsSerialization(ISqLiteMessageQueueTransportOptionsFactory options,
                                    IInternalSerializer serializer)
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => serializer, serializer);

            _serializer = serializer;
            _options    = new Lazy <SqLiteMessageQueueTransportOptions>(options.Create);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SqLiteQueueStatusProvider" /> class.
 /// </summary>
 /// <param name="connectionInformation">The connection information.</param>
 /// <param name="getTimeFactory">The get time factory.</param>
 /// <param name="optionsFactory">The options factory.</param>
 /// <param name="serializer">The serializer.</param>
 /// <param name="queries">The queries.</param>
 public SqLiteQueueStatusProvider(IConnectionInformation connectionInformation,
     IGetTimeFactory getTimeFactory,
     ISqLiteMessageQueueTransportOptionsFactory optionsFactory,
     IInternalSerializer serializer, 
     SqLiteMessageQueueStatusQueries queries) : base(connectionInformation, getTimeFactory)
 {
     _serializer = serializer;
     _queries = queries;
     _options = new Lazy<SqLiteMessageQueueTransportOptions>(optionsFactory.Create);
 }
 /// <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>
 /// <param name="dbFactory">The database factory.</param>
 /// <param name="databaseExists">The database exists.</param>
 public RollbackMessageCommandHandler(IGetTimeFactory getUtcDateQuery,
                                      ISqLiteMessageQueueTransportOptionsFactory options,
                                      ITableNameHelper tableNameHelper,
                                      IConnectionInformation connectionInformation,
                                      IDbCommandStringCache commandCache,
                                      IDbFactory dbFactory,
                                      DatabaseExists databaseExists)
 {
     _getUtcDateQuery       = getUtcDateQuery;
     _options               = new Lazy <SqLiteMessageQueueTransportOptions>(options.Create);
     _tableNameHelper       = tableNameHelper;
     _connectionInformation = connectionInformation;
     _commandCache          = commandCache;
     _rollbackDictionary    = new ConcurrentDictionary <string, string>();
     _dbFactory             = dbFactory;
     _databaseExists        = databaseExists;
 }
        /// <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="getTimeFactory">The get time factory.</param>
        /// <param name="dbFactory">The database factory.</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>
        /// <param name="databaseExists">The database exists.</param>
        /// <param name="readerAsync">The reader asynchronous.</param>
        public SendMessageCommandHandlerAsync(TableNameHelper tableNameHelper,
                                              ICompositeSerialization serializer,
                                              ISqLiteMessageQueueTransportOptionsFactory optionsFactory,
                                              IHeaders headers,
                                              IDbCommandStringCache commandCache,
                                              TransportConfigurationSend configurationSend,
                                              IGetTimeFactory getTimeFactory,
                                              IDbFactory dbFactory,
                                              ICommandHandler <SetJobLastKnownEventCommand <IDbConnection, IDbTransaction> > sendJobStatus,
                                              IQueryHandler <DoesJobExistQuery <IDbConnection, IDbTransaction>, QueueStatuses> jobExistsHandler,
                                              IJobSchedulerMetaData jobSchedulerMetaData,
                                              DatabaseExists databaseExists,
                                              IReaderAsync readerAsync)
        {
            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(() => getTimeFactory, getTimeFactory);
            Guard.NotNull(() => sendJobStatus, sendJobStatus);
            Guard.NotNull(() => jobExistsHandler, jobExistsHandler);
            Guard.NotNull(() => jobSchedulerMetaData, jobSchedulerMetaData);
            Guard.NotNull(() => databaseExists, databaseExists);
            Guard.NotNull(() => readerAsync, readerAsync);

            _tableNameHelper      = tableNameHelper;
            _serializer           = serializer;
            _options              = new Lazy <SqLiteMessageQueueTransportOptions>(optionsFactory.Create);
            _headers              = headers;
            _commandCache         = commandCache;
            _configurationSend    = configurationSend;
            _getTime              = getTimeFactory.Create();
            _dbFactory            = dbFactory;
            _sendJobStatus        = sendJobStatus;
            _jobExistsHandler     = jobExistsHandler;
            _jobSchedulerMetaData = jobSchedulerMetaData;
            _databaseExists       = databaseExists;
            _readerAsync          = readerAsync;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ReceiveMessageQueryHandler" /> class.
        /// </summary>
        /// <param name="optionsFactory">The options factory.</param>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="connectionInformation">The connection information.</param>
        /// <param name="buildDequeueCommand">The build dequeue command.</param>
        /// <param name="messageDeQueue">The message de queue.</param>
        /// <param name="dbFactory">The transaction factory.</param>
        /// <param name="databaseExists">The database exists.</param>
        public ReceiveMessageQueryHandler(ISqLiteMessageQueueTransportOptionsFactory optionsFactory,
                                          TableNameHelper tableNameHelper,
                                          IConnectionInformation connectionInformation,
                                          BuildDequeueCommand buildDequeueCommand,
                                          MessageDeQueue messageDeQueue,
                                          IDbFactory dbFactory,
                                          DatabaseExists databaseExists)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => buildDequeueCommand, buildDequeueCommand);
            Guard.NotNull(() => messageDeQueue, messageDeQueue);
            Guard.NotNull(() => databaseExists, databaseExists);
            Guard.NotNull(() => dbFactory, dbFactory);

            _options               = new Lazy <SqLiteMessageQueueTransportOptions>(optionsFactory.Create);
            _tableNameHelper       = tableNameHelper;
            _connectionInformation = connectionInformation;
            _buildDequeueCommand   = buildDequeueCommand;
            _messageDeQueue        = messageDeQueue;
            _dbFactory             = dbFactory;
            _databaseExists        = databaseExists;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqLiteMessageQueueCreation" /> 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 SqLiteMessageQueueCreation(IConnectionInformation connectionInfo, IQueryHandler <GetTableExistsQuery, bool> queryTableExists,
                                          ISqLiteMessageQueueTransportOptionsFactory options,
                                          SqLiteMessageQueueSchema 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 <SqLiteMessageQueueTransportOptions>(options.Create);
            _createSchema     = createSchema;
            _queryTableExists = queryTableExists;
            _createCommand    = createCommand;
            _deleteCommand    = deleteCommand;
            ConnectionInfo    = connectionInfo;
            Scope             = creationScope;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqLiteMessageQueueCreation" /> 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 SqLiteMessageQueueCreation(IConnectionInformation connectionInfo,
            IQueryHandler<GetTableExistsQuery, bool> queryTableExists,
            ISqLiteMessageQueueTransportOptionsFactory options, 
            SqLiteMessageQueueSchema 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<SqLiteMessageQueueTransportOptions>(options.Create);
            _createSchema = createSchema;
            _queryTableExists = queryTableExists;
            _createCommand = createCommand;
            _deleteCommand = deleteCommand;
            ConnectionInfo = connectionInfo;
            Scope = creationScope;
        }
Exemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TransportOptionsFactory"/> class.
 /// </summary>
 /// <param name="factory">The factory.</param>
 public TransportOptionsFactory(ISqLiteMessageQueueTransportOptionsFactory factory)
 {
     Guard.NotNull(() => factory, factory);
     _factory = factory;
 }
Exemplo n.º 11
0
 private SqLiteMessageQueueSchema Create(ISqLiteMessageQueueTransportOptionsFactory options, TableNameHelper tableNameHelper)
 {
     return(new SqLiteMessageQueueSchema(tableNameHelper, options));
 }
Exemplo n.º 12
0
 private SqLiteMessageQueueSchema Create(ISqLiteMessageQueueTransportOptionsFactory options)
 {
     return(Create(options, GetTableNameHelper()));
 }
 private SqLiteMessageQueueSchema Create(ISqLiteMessageQueueTransportOptionsFactory options, TableNameHelper tableNameHelper)
 {
     return new SqLiteMessageQueueSchema(tableNameHelper, options);
 }
 private SqLiteMessageQueueSchema Create(ISqLiteMessageQueueTransportOptionsFactory options)
 {
     return Create(options, GetTableNameHelper());
 }