/// <summary>
        /// Initializes a new instance of the <see cref="MoveRecordToErrorQueueCommandHandler{TConnection, TTransaction, TCommand}" /> class.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="deleteMetaCommandHandler">The delete meta command handler.</param>
        /// <param name="setStatusCommandHandler">The set status command handler.</param>
        /// <param name="dbConnectionFactory">The database connection factory.</param>
        /// <param name="transactionFactory">The transaction factory.</param>
        /// <param name="prepareCommand">The prepare command.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="setCommandHandler">The set command handler.</param>
        public MoveRecordToErrorQueueCommandHandler(
            ITransportOptionsFactory options,
            ICommandHandler <DeleteMetaDataCommand> deleteMetaCommandHandler,
            ICommandHandler <SetStatusTableStatusTransactionCommand> setStatusCommandHandler,
            IDbConnectionFactory dbConnectionFactory,
            ITransactionFactory transactionFactory,
            IPrepareCommandHandler <MoveRecordToErrorQueueCommand <long> > prepareCommand,
            IConnectionHeader <TConnection, TTransaction, TCommand> headers,
            ICommandHandler <SetStatusTableStatusCommand <long> > setCommandHandler)
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => transactionFactory, transactionFactory);
            Guard.NotNull(() => headers, headers);
            Guard.NotNull(() => prepareCommand, prepareCommand);
            Guard.NotNull(() => dbConnectionFactory, dbConnectionFactory);
            Guard.NotNull(() => deleteMetaCommandHandler, deleteMetaCommandHandler);
            Guard.NotNull(() => setStatusCommandHandler, setStatusCommandHandler);
            Guard.NotNull(() => setCommandHandler, setCommandHandler);

            _options = new Lazy <ITransportOptions>(options.Create);
            _deleteMetaCommandHandler = deleteMetaCommandHandler;
            _setStatusCommandHandler  = setStatusCommandHandler;
            _dbConnectionFactory      = dbConnectionFactory;
            _transactionFactory       = transactionFactory;
            _prepareCommand           = prepareCommand;
            _headers = headers;
            _setStatusNoTransactionCommandHandler = setCommandHandler;
        }
Exemplo n.º 2
0
 /// <inheritdoc />
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueStatusProvider" /> 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 QueueStatusProvider(IConnectionInformation connectionInformation,
                            IGetTimeFactory getTimeFactory,
                            ITransportOptionsFactory optionsFactory,
                            IInternalSerializer serializer,
                            QueueStatusQueries queries) : base(connectionInformation, getTimeFactory)
 {
     _serializer = serializer;
     _queries    = queries;
     _options    = new Lazy <ITransportOptions>(optionsFactory.Create);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildMoveToErrorQueueSql" /> class.
        /// </summary>
        /// <param name="tableNameHelper">The table name helper.</param>
        /// <param name="getColumns">The column query.</param>
        /// <param name="options">The options.</param>
        public BuildMoveToErrorQueueSql(ITableNameHelper tableNameHelper,
                                        IGetColumnsFromTable getColumns,
                                        ITransportOptionsFactory options)
        {
            Guard.NotNull(() => tableNameHelper, tableNameHelper);
            Guard.NotNull(() => getColumns, getColumns);
            Guard.NotNull(() => options, options);

            _tableNameHelper = tableNameHelper;
            _getColumns      = getColumns;
            _options         = new Lazy <ITransportOptions>(options.Create);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DeleteTransactionalMessageCommandHandler{TConnection, TTransaction, TCommand}"/> class.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="prepareCommand">The prepare command.</param>
        public DeleteTransactionalMessageCommandHandler(ITransportOptionsFactory options,
                                                        IConnectionHeader <TConnection, TTransaction, TCommand> headers,
                                                        IPrepareCommandHandler <DeleteMessageCommand> prepareCommand)
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => headers, headers);
            Guard.NotNull(() => prepareCommand, prepareCommand);

            _options        = new Lazy <ITransportOptions>(options.Create);
            _headers        = headers;
            _prepareCommand = prepareCommand;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageQueueCreation" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="options">The options.</param>
        /// <param name="creationScope">The creation scope.</param>
        public MessageQueueCreation(IConnectionInformation connectionInfo,
                                    ITransportOptionsFactory options,
                                    ICreationScope creationScope)
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => creationScope, creationScope);
            Guard.NotNull(() => connectionInfo, connectionInfo);

            _options       = new Lazy <TransportOptions>(options.Create);
            ConnectionInfo = connectionInfo;
            Scope          = creationScope;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DeleteMessageCommandHandler" /> class.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <param name="dbConnectionFactory">The database connection factory.</param>
        /// <param name="transactionFactory">The transaction factory.</param>
        /// <param name="prepareCommand">The prepare command.</param>
        public DeleteMessageCommandHandler(ITransportOptionsFactory options,
                                           IDbConnectionFactory dbConnectionFactory,
                                           ITransactionFactory transactionFactory,
                                           IPrepareCommandHandler <DeleteMessageCommand <long> > prepareCommand)
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => dbConnectionFactory, dbConnectionFactory);
            Guard.NotNull(() => transactionFactory, transactionFactory);
            Guard.NotNull(() => prepareCommand, prepareCommand);

            _options             = new Lazy <ITransportOptions>(options.Create);
            _transactionFactory  = transactionFactory;
            _prepareCommand      = prepareCommand;
            _dbConnectionFactory = dbConnectionFactory;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FindExpiredRecordsToDeleteQueryHandler{T}" /> class.
        /// </summary>
        /// <param name="dbConnectionFactory">The database connection factory.</param>
        /// <param name="options">The options.</param>
        /// <param name="readColumn">The read column.</param>
        /// <param name="prepareQuery">The prepare query.</param>
        public FindExpiredRecordsToDeleteQueryHandler(
            IDbConnectionFactory dbConnectionFactory,
            ITransportOptionsFactory options,
            IReadColumn readColumn,
            IPrepareQueryHandler <FindExpiredMessagesToDeleteQuery <T>, IEnumerable <T> > prepareQuery)
        {
            Guard.NotNull(() => dbConnectionFactory, dbConnectionFactory);
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => prepareQuery, prepareQuery);
            Guard.NotNull(() => readColumn, readColumn);

            _dbConnectionFactory = dbConnectionFactory;
            _readColumn          = readColumn;
            _prepareQuery        = prepareQuery;
            _options             = new Lazy <ITransportOptions>(options.Create);
        }