Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventHandler"/>.
 /// </summary>
 /// <param name="streamProcessors">The <see cref="IStreamProcessors" />.</param>
 /// <param name="filterValidationForAllTenants">The <see cref="IValidateFilterForAllTenants" /> for validating the filter definition.</param>
 /// <param name="streamDefinitions">The<see cref="IStreamDefinitions" />.</param>
 /// <param name="arguments">Connecting arguments.</param>
 /// <param name="filterProcessorForTenant"></param>
 /// <param name="eventProcessorForTenant">The event processor.</param>
 /// <param name="acceptRegistration">Accepts the event handler registration.</param>
 /// <param name="rejectRegistration">Rejects the event handler registration.</param>
 /// <param name="logger">Logger for logging.</param>
 /// <param name="executionContext">The execution context for the event handler.</param>
 /// <param name="cancellationToken">Cancellation token that can cancel the hierarchy.</param>
 public EventHandler(
     IStreamProcessors streamProcessors,
     IValidateFilterForAllTenants filterValidationForAllTenants,
     IStreamDefinitions streamDefinitions,
     EventHandlerRegistrationArguments arguments,
     Func <TenantId, IFilterProcessor <TypeFilterWithEventSourcePartitionDefinition> > filterProcessorForTenant,
     Func <TenantId, IEventProcessor> eventProcessorForTenant,
     Func <CancellationToken, Task> acceptRegistration,
     Func <Failure, CancellationToken, Task> rejectRegistration,
     ILogger logger,
     ExecutionContext executionContext,
     CancellationToken cancellationToken)
 {
     _logger                   = logger;
     _streamProcessors         = streamProcessors;
     _filterValidator          = filterValidationForAllTenants;
     _streamDefinitions        = streamDefinitions;
     _arguments                = arguments;
     _filterProcessorForTenant = filterProcessorForTenant;
     _executionContext         = executionContext;
     _eventProcessorForTenant  = eventProcessorForTenant;
     _acceptRegistration       = acceptRegistration;
     _rejectRegistration       = rejectRegistration;
     _cancellationTokenSource  = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FiltersService"/> class.
 /// </summary>
 /// <param name="hostApplicationLifetime">The <see cref="IHostApplicationLifetime" />.</param>
 /// <param name="streamProcessors">The <see cref="IStreamProcessors" />.</param>
 /// <param name="filterForAllTenants">The <see cref="IValidateFilterForAllTenants" />.</param>
 /// <param name="executionContextCreator">The <see cref="ICreateExecutionContexts" />.</param>
 /// <param name="streamDefinitions">The <see cref="IFilterDefinitions" />.</param>
 /// <param name="reverseCallServices">The <see cref="IInitiateReverseCallServices" />.</param>
 /// <param name="unpartitionedFiltersProtocol">The <see cref="IUnpartitionedFiltersProtocol" />.</param>
 /// <param name="partitionedFiltersProtocol">The <see cref="IPartitionedFiltersProtocol" />.</param>
 /// <param name="publicFiltersProtocol">The <see cref="IPublicFiltersProtocol" />.</param>
 /// <param name="createUnpartitionedFilterProcessorFor">The factory to use to create unpartitioned filter processors.</param>
 /// <param name="createPartitionedFilterProcessorFor">The factory to use to create partitioned filter processors.</param>
 /// <param name="createPublicFilterProcessorFor">The factory to use to create public filter processors.</param>
 /// <param name="logger">The logger to use for logging.</param>
 public FiltersService(
     IHostApplicationLifetime hostApplicationLifetime,
     IStreamProcessors streamProcessors,
     IValidateFilterForAllTenants filterForAllTenants,
     ICreateExecutionContexts executionContextCreator,
     IStreamDefinitions streamDefinitions,
     IInitiateReverseCallServices reverseCallServices,
     IUnpartitionedFiltersProtocol unpartitionedFiltersProtocol,
     IPartitionedFiltersProtocol partitionedFiltersProtocol,
     IPublicFiltersProtocol publicFiltersProtocol,
     Func <TenantId, ScopeId, FilterDefinition, UnpartitionedFilterDispatcher, Unpartitioned.FilterProcessor> createUnpartitionedFilterProcessorFor,
     Func <TenantId, ScopeId, FilterDefinition, PartitionedFilterDispatcher, Partitioned.FilterProcessor> createPartitionedFilterProcessorFor,
     Func <TenantId, PublicFilterDefinition, PublicFilterDispatcher, PublicFilterProcessor> createPublicFilterProcessorFor,
     ILogger logger)
 {
     _hostApplicationLifetime               = hostApplicationLifetime;
     _streamProcessors                      = streamProcessors;
     _filterForAllTenants                   = filterForAllTenants;
     _executionContextCreator               = executionContextCreator;
     _streamDefinitions                     = streamDefinitions;
     _reverseCallServices                   = reverseCallServices;
     _unpartitionedFiltersProtocol          = unpartitionedFiltersProtocol;
     _partitionedFiltersProtocol            = partitionedFiltersProtocol;
     _publicFiltersProtocol                 = publicFiltersProtocol;
     _createUnpartitionedFilterProcessorFor = createUnpartitionedFilterProcessorFor;
     _createPartitionedFilterProcessorFor   = createPartitionedFilterProcessorFor;
     _createPublicFilterProcessorFor        = createPublicFilterProcessorFor;
     _logger = logger;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventHandlerFactory"/> class.
 /// </summary>
 /// <param name="streamProcessors">The <see cref="IStreamProcessors"/>.</param>
 /// <param name="filterValidator">The <see cref="IValidateFilterForAllTenants"/>.</param>
 /// <param name="getEventsToStreamsWriter">The <see cref="Func{TResult}"/> for getting a tenant scoped <see cref="IWriteEventsToStreams"/>.</param>
 /// <param name="streamDefinitions">The <see cref="IStreamDefinitions"/>.</param>
 /// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
 /// <param name="filterStreamProcessors">The <see cref="IFilterStreamProcessors"/>.</param>
 public EventHandlerFactory(
     IStreamProcessors streamProcessors,
     IValidateFilterForAllTenants filterValidator,
     Func <TenantId, IWriteEventsToStreams> getEventsToStreamsWriter,
     IStreamDefinitions streamDefinitions,
     ILoggerFactory loggerFactory,
     IFilterStreamProcessors filterStreamProcessors)
 {
     _streamProcessors         = streamProcessors;
     _filterValidator          = filterValidator;
     _getEventsToStreamsWriter = getEventsToStreamsWriter;
     _streamDefinitions        = streamDefinitions;
     _loggerFactory            = loggerFactory;
     _filterStreamProcessors   = filterStreamProcessors;
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventHandlersService"/> class.
 /// </summary>
 /// <param name="hostApplicationLifetime">The <see cref="IHostApplicationLifetime" />.</param>
 /// <param name="filterForAllTenants">The <see cref="IValidateFilterForAllTenants" />.</param>
 /// <param name="streamProcessors">The <see cref="IStreamProcessors" />.</param>
 /// <param name="getEventsToStreamsWriter">The <see cref="FactoryFor{T}" /> <see cref="IWriteEventsToStreams" />.</param>
 /// <param name="streamDefinitions">The<see cref="IStreamDefinitions" />.</param>
 /// <param name="reverseCallDispatchers">The <see cref="IReverseCallDispatchers"/> for working with reverse calls.</param>
 /// <param name="executionContextManager">The <see cref="IExecutionContextManager" />.</param>
 /// <param name="loggerManager">The <see cref="ILoggerManager"/>.</param>
 public EventHandlersService(
     IHostApplicationLifetime hostApplicationLifetime,
     IValidateFilterForAllTenants filterForAllTenants,
     IStreamProcessors streamProcessors,
     FactoryFor <IWriteEventsToStreams> getEventsToStreamsWriter,
     IStreamDefinitions streamDefinitions,
     IReverseCallDispatchers reverseCallDispatchers,
     IExecutionContextManager executionContextManager,
     ILoggerManager loggerManager)
 {
     _filterForAllTenants      = filterForAllTenants;
     _streamProcessors         = streamProcessors;
     _getEventsToStreamsWriter = getEventsToStreamsWriter;
     _streamDefinitions        = streamDefinitions;
     _reverseCallDispatchers   = reverseCallDispatchers;
     _executionContextManager  = executionContextManager;
     _loggerManager            = loggerManager;
     _logger = loggerManager.CreateLogger <EventHandlersService>();
     _hostApplicationLifetime = hostApplicationLifetime;
 }