예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LiteDbMessageQueueSchema"/> class.
        /// </summary>
        /// <param name="options">The options.</param>
        public LiteDbMessageQueueSchema(
            ILiteDbMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => options, options);

            _options = new Lazy <LiteDbMessageQueueTransportOptions>(options.Create);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SendMessageCommandHandlerAsync"/> class.
        /// </summary>
        /// <param name="connectionInformation">The connection information.</param>
        /// <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="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>
        /// <param name="databaseExists">The database exists.</param>
        public SendMessageCommandHandlerAsync(
            LiteDbConnectionManager connectionInformation,
            TableNameHelper tableNameHelper,
            ICompositeSerialization serializer,
            ILiteDbMessageQueueTransportOptionsFactory optionsFactory,
            IHeaders headers,
            TransportConfigurationSend configurationSend,
            ICommandHandler <SetJobLastKnownEventCommand> sendJobStatus, IQueryHandler <DoesJobExistQuery, QueueStatuses> jobExistsHandler,
            IJobSchedulerMetaData jobSchedulerMetaData,
            DatabaseExists databaseExists)
        {
            Guard.NotNull(() => connectionInformation, connectionInformation);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => serializer, serializer);
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => headers, headers);
            Guard.NotNull(() => configurationSend, configurationSend);
            Guard.NotNull(() => sendJobStatus, sendJobStatus);
            Guard.NotNull(() => jobExistsHandler, jobExistsHandler);
            Guard.NotNull(() => jobSchedulerMetaData, jobSchedulerMetaData);
            Guard.NotNull(() => databaseExists, databaseExists);

            _connectionInformation = connectionInformation;
            _tableNameHelper       = tableNameHelper;
            _serializer            = serializer;
            _options              = new Lazy <LiteDbMessageQueueTransportOptions>(optionsFactory.Create);
            _headers              = headers;
            _configurationSend    = configurationSend;
            _sendJobStatus        = sendJobStatus;
            _jobExistsHandler     = jobExistsHandler;
            _jobSchedulerMetaData = jobSchedulerMetaData;
            _databaseExists       = databaseExists;
        }
예제 #3
0
        /// <summary>Initializes a new instance of the <see cref="LiteDbMessageQueueCreation"/> 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>
        /// <param name="connectionManager">DB Connection manager</param>
        public LiteDbMessageQueueCreation(IConnectionInformation connectionInfo, IQueryHandler <GetTableExistsQuery, bool> queryTableExists,
                                          ILiteDbMessageQueueTransportOptionsFactory options,
                                          LiteDbMessageQueueSchema createSchema,
                                          ICommandHandlerWithOutput <CreateQueueTablesAndSaveConfigurationCommand <ITable>, QueueCreationResult> createCommand,
                                          ICommandHandlerWithOutput <DeleteQueueTablesCommand, QueueRemoveResult> deleteCommand,
                                          ICreationScope creationScope,
                                          LiteDbConnectionManager connectionManager
                                          )
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => createSchema, createSchema);
            Guard.NotNull(() => queryTableExists, queryTableExists);
            Guard.NotNull(() => createCommand, createCommand);
            Guard.NotNull(() => deleteCommand, deleteCommand);
            Guard.NotNull(() => creationScope, creationScope);
            Guard.NotNull(() => connectionManager, connectionManager);

            _options           = new Lazy <LiteDbMessageQueueTransportOptions>(options.Create);
            _createSchema      = createSchema;
            _queryTableExists  = queryTableExists;
            _createCommand     = createCommand;
            _deleteCommand     = deleteCommand;
            ConnectionInfo     = connectionInfo;
            Scope              = creationScope;
            _connectionManager = connectionManager;
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateJobTablesCommandHandler"/> class.
        /// </summary>
        /// <param name="connectionInformation">The connection information.</param>
        /// <param name="optionsFactory">The options factory.</param>
        /// <param name="tableNameHelper">The table name helper.</param>
        public CreateJobTablesCommandHandler(LiteDbConnectionManager connectionInformation,
                                             ILiteDbMessageQueueTransportOptionsFactory optionsFactory,
                                             TableNameHelper tableNameHelper)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => connectionInformation, connectionInformation);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);

            _options = new Lazy <LiteDbMessageQueueTransportOptions>(optionsFactory.Create);
            _connectionInformation = connectionInformation;
            _tableNameHelper       = tableNameHelper;
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateQueueTablesAndSaveConfigurationCommandHandler"/> class.
        /// </summary>
        /// <param name="connectionInformation">The connection information.</param>
        /// <param name="optionsFactory">The options factory.</param>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="serializer">The serializer.</param>
        public CreateQueueTablesAndSaveConfigurationCommandHandler(LiteDbConnectionManager connectionInformation,
                                                                   ILiteDbMessageQueueTransportOptionsFactory optionsFactory,
                                                                   TableNameHelper tableNameHelper,
                                                                   IInternalSerializer serializer)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => connectionInformation, connectionInformation);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => serializer, serializer);

            _options = new Lazy <LiteDbMessageQueueTransportOptions>(optionsFactory.Create);
            _connectionInformation = connectionInformation;
            _tableNameHelper       = tableNameHelper;
            _serializer            = serializer;
        }
        /// <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="databaseExists">The database exists.</param>
        /// <param name="messageDeQueue">The message de queue.</param>
        public ReceiveMessageQueryHandler(ILiteDbMessageQueueTransportOptionsFactory optionsFactory,
                                          TableNameHelper tableNameHelper,
                                          LiteDbConnectionManager connectionInformation,
                                          DatabaseExists databaseExists,
                                          MessageDeQueue messageDeQueue)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => databaseExists, databaseExists);
            Guard.NotNull(() => messageDeQueue, messageDeQueue);
            Guard.NotNull(() => connectionInformation, connectionInformation);

            _options               = new Lazy <LiteDbMessageQueueTransportOptions>(optionsFactory.Create);
            _tableNameHelper       = tableNameHelper;
            _connectionInformation = connectionInformation;
            _databaseExists        = databaseExists;
            _messageDeQueue        = messageDeQueue;
        }
예제 #7
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="databaseExists">The database exists.</param>
        public RollbackMessageCommandHandler(IGetTimeFactory getUtcDateQuery,
                                             ILiteDbMessageQueueTransportOptionsFactory options,
                                             TableNameHelper tableNameHelper,
                                             LiteDbConnectionManager connectionInformation,
                                             DatabaseExists databaseExists)
        {
            Guard.NotNull(() => connectionInformation, connectionInformation);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => getUtcDateQuery, getUtcDateQuery);
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => databaseExists, databaseExists);

            _getUtcDateQuery       = getUtcDateQuery;
            _options               = new Lazy <LiteDbMessageQueueTransportOptions>(options.Create);
            _tableNameHelper       = tableNameHelper;
            _connectionInformation = connectionInformation;
            _databaseExists        = databaseExists;
        }