/// <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="receivedMessageFactory">The received message factory.</param>
        /// <param name="commandCache">The command cache.</param>
        /// <param name="messageFactory">The message factory.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="serialization">The serialization.</param>
        /// <param name="getTimeFactory">The get time factory.</param>
        public ReceiveMessageQueryHandler(IPostgreSqlMessageQueueTransportOptionsFactory optionsFactory,
                                          ITableNameHelper tableNameHelper,
                                          IReceivedMessageFactory receivedMessageFactory,
                                          PostgreSqlCommandStringCache commandCache,
                                          IMessageFactory messageFactory,
                                          IHeaders headers,
                                          ICompositeSerialization serialization,
                                          IGetTimeFactory getTimeFactory)
        {
            Guard.NotNull(() => optionsFactory, optionsFactory);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => receivedMessageFactory, receivedMessageFactory);
            Guard.NotNull(() => commandCache, commandCache);
            Guard.NotNull(() => messageFactory, messageFactory);
            Guard.NotNull(() => serialization, serialization);
            Guard.NotNull(() => headers, headers);
            Guard.NotNull(() => getTimeFactory, getTimeFactory);

            _options                = new Lazy <PostgreSqlMessageQueueTransportOptions>(optionsFactory.Create);
            _tableNameHelper        = tableNameHelper;
            _receivedMessageFactory = receivedMessageFactory;
            _commandCache           = commandCache;
            _messageFactory         = messageFactory;
            _headers                = headers;
            _serialization          = serialization;
            _getTime                = getTimeFactory.Create();
        }
示例#2
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>
        /// <param name="getTimeFactory">The get time factory.</param>
        public SendMessageCommandHandlerAsync(ITableNameHelper tableNameHelper,
                                              ICompositeSerialization serializer,
                                              IPostgreSqlMessageQueueTransportOptionsFactory optionsFactory,
                                              IHeaders headers,
                                              PostgreSqlCommandStringCache commandCache,
                                              TransportConfigurationSend configurationSend,
                                              ICommandHandler <SetJobLastKnownEventCommand <NpgsqlConnection, NpgsqlTransaction> > sendJobStatus, IQueryHandler <DoesJobExistQuery <NpgsqlConnection, NpgsqlTransaction>, QueueStatuses> jobExistsHandler,
                                              IJobSchedulerMetaData jobSchedulerMetaData,
                                              IGetTimeFactory getTimeFactory)
        {
            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);
            Guard.NotNull(() => getTimeFactory, getTimeFactory);

            _tableNameHelper      = tableNameHelper;
            _serializer           = serializer;
            _options              = new Lazy <PostgreSqlMessageQueueTransportOptions>(optionsFactory.Create);
            _headers              = headers;
            _commandCache         = commandCache;
            _configurationSend    = configurationSend;
            _sendJobStatus        = sendJobStatus;
            _jobExistsHandler     = jobExistsHandler;
            _jobSchedulerMetaData = jobSchedulerMetaData;
            _getTime              = getTimeFactory.Create();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PostgreSqlMessageQueueSchema"/> class.
        /// </summary>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="options">The options.</param>
        public PostgreSqlMessageQueueSchema(ITableNameHelper tableNameHelper,
                                            IPostgreSqlMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => options, options);

            _tableNameHelper = tableNameHelper;
            _options         = new Lazy <PostgreSqlMessageQueueTransportOptions>(options.Create);
        }
        public OptionsSerialization(IPostgreSqlMessageQueueTransportOptionsFactory options,
                                    IInternalSerializer serializer)
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => serializer, serializer);

            _serializer = serializer;
            _options    = new Lazy <PostgreSqlMessageQueueTransportOptions>(options.Create);
        }
        /// <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,
            IPostgreSqlMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => options, options);

            _connectionInfo = connectionInfo;
            _options = new Lazy<PostgreSqlMessageQueueTransportOptions>(options.Create);
        }
示例#6
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,
                                       IPostgreSqlMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => options, options);

            _connectionInfo = connectionInfo;
            _options        = new Lazy <PostgreSqlMessageQueueTransportOptions>(options.Create);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PostgreSqlMessageQueueSchema"/> class.
        /// </summary>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="options">The options.</param>
        public PostgreSqlMessageQueueSchema(TableNameHelper tableNameHelper,
            IPostgreSqlMessageQueueTransportOptionsFactory options)
        {
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => options, options);

            _tableNameHelper = tableNameHelper;
            _options = new Lazy<PostgreSqlMessageQueueTransportOptions>(options.Create);
        } 
 /// <summary>
 /// Initializes a new instance of the <see cref="PostgreSqlQueueStatusProvider" /> 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 PostgreSqlQueueStatusProvider(IConnectionInformation connectionInformation,
     IGetTimeFactory getTimeFactory,
     IPostgreSqlMessageQueueTransportOptionsFactory optionsFactory,
     IInternalSerializer serializer, 
     PostgreSqlMessageQueueStatusQueries queries) : base(connectionInformation, getTimeFactory)
 {
     _serializer = serializer;
     _queries = queries;
     _options = new Lazy<PostgreSqlMessageQueueTransportOptions>(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>
 public RollbackMessageCommandHandler(IGetTimeFactory getUtcDateQuery,
                                      IPostgreSqlMessageQueueTransportOptionsFactory options,
                                      TableNameHelper tableNameHelper,
                                      IConnectionInformation connectionInformation,
                                      PostgreSqlCommandStringCache commandCache)
 {
     _getUtcDateQuery       = getUtcDateQuery;
     _options               = new Lazy <PostgreSqlMessageQueueTransportOptions>(options.Create);
     _tableNameHelper       = tableNameHelper;
     _connectionInformation = connectionInformation;
     _commandCache          = commandCache;
     _rollbackDictionary    = new ConcurrentDictionary <string, string>();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="PostgreSqlMessageQueueCreation" /> 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 PostgreSqlMessageQueueCreation(IConnectionInformation connectionInfo, IQueryHandler <GetTableExistsQuery, bool> queryTableExists,
                                              IPostgreSqlMessageQueueTransportOptionsFactory options,
                                              PostgreSqlMessageQueueSchema 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 <PostgreSqlMessageQueueTransportOptions>(options.Create);
            _createSchema     = createSchema;
            _queryTableExists = queryTableExists;
            _createCommand    = createCommand;
            _deleteCommand    = deleteCommand;
            ConnectionInfo    = connectionInfo;
            Scope             = creationScope;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PostgreSqlMessageQueueCreation" /> 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 PostgreSqlMessageQueueCreation(IConnectionInformation connectionInfo,
            IQueryHandler<GetTableExistsQuery, bool> queryTableExists,
            IPostgreSqlMessageQueueTransportOptionsFactory options, 
            PostgreSqlMessageQueueSchema 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<PostgreSqlMessageQueueTransportOptions>(options.Create);
            _createSchema = createSchema;
            _queryTableExists = queryTableExists;
            _createCommand = createCommand;
            _deleteCommand = deleteCommand;
            ConnectionInfo = connectionInfo;
            Scope = creationScope;
        }
示例#12
0
 private PostgreSqlMessageQueueSchema Create(IPostgreSqlMessageQueueTransportOptionsFactory options, TableNameHelper tableNameHelper)
 {
     return(new PostgreSqlMessageQueueSchema(tableNameHelper, options));
 }
示例#13
0
 private PostgreSqlMessageQueueSchema Create(IPostgreSqlMessageQueueTransportOptionsFactory options)
 {
     return(Create(options, GetTableNameHelper()));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TransportOptionsFactory"/> class.
 /// </summary>
 /// <param name="factory">The factory.</param>
 public TransportOptionsFactory(IPostgreSqlMessageQueueTransportOptionsFactory factory)
 {
     Guard.NotNull(() => factory, factory);
     _factory = factory;
 }
 private PostgreSqlMessageQueueSchema Create(IPostgreSqlMessageQueueTransportOptionsFactory options, TableNameHelper tableNameHelper)
 {
     return new PostgreSqlMessageQueueSchema(tableNameHelper, options);
 }
 private PostgreSqlMessageQueueSchema Create(IPostgreSqlMessageQueueTransportOptionsFactory options)
 {
     return Create(options, GetTableNameHelper());
 }