/// <summary>Parameterized constructor.
 /// </summary>
 /// <param name="waitingCommandService"></param>
 /// <param name="aggregateRootTypeCodeProvider"></param>
 /// <param name="aggregateRootFactory"></param>
 /// <param name="eventStreamConvertService"></param>
 /// <param name="eventSourcingService"></param>
 /// <param name="memoryCache"></param>
 /// <param name="aggregateStorage"></param>
 /// <param name="retryCommandService"></param>
 /// <param name="eventStore"></param>
 /// <param name="eventPublisher"></param>
 /// <param name="actionExecutionService"></param>
 /// <param name="eventSynchronizerProvider"></param>
 /// <param name="loggerFactory"></param>
 public DefaultCommitEventService(
     IWaitingCommandService waitingCommandService,
     IAggregateRootTypeCodeProvider aggregateRootTypeCodeProvider,
     IAggregateRootFactory aggregateRootFactory,
     IEventStreamConvertService eventStreamConvertService,
     IEventSourcingService eventSourcingService,
     IMemoryCache memoryCache,
     IAggregateStorage aggregateStorage,
     IRetryCommandService retryCommandService,
     IEventStore eventStore,
     IEventPublisher eventPublisher,
     IActionExecutionService actionExecutionService,
     IEventSynchronizerProvider eventSynchronizerProvider,
     ILoggerFactory loggerFactory)
 {
     _waitingCommandService = waitingCommandService;
     _aggregateRootTypeCodeProvider = aggregateRootTypeCodeProvider;
     _aggregateRootFactory = aggregateRootFactory;
     _eventStreamConvertService = eventStreamConvertService;
     _eventSourcingService = eventSourcingService;
     _memoryCache = memoryCache;
     _aggregateStorage = aggregateStorage;
     _retryCommandService = retryCommandService;
     _eventStore = eventStore;
     _eventPublisher = eventPublisher;
     _actionExecutionService = actionExecutionService;
     _eventSynchronizerProvider = eventSynchronizerProvider;
     _logger = loggerFactory.Create(GetType().Name);
 }
        protected override global::Ninject.IKernel CreateKernel()
        {
            Store = Bootstrapper.Instance.Get<IEventStore>();
            DataCache = Bootstrapper.Instance.Get<IRepositoryCache>();

            return Bootstrapper.Instance.Kernel;
        }
Beispiel #3
0
        public DefaultCommandExecutor(
            IProcessingCommandCache processingCommandCache,
            ICommandAsyncResultManager commandAsyncResultManager,
            ICommandHandlerProvider commandHandlerProvider,
            IAggregateRootTypeProvider aggregateRootTypeProvider,
            IMemoryCache memoryCache,
            IRepository repository,
            IRetryCommandService retryCommandService,
            IEventStore eventStore,
            IEventPublisher eventPublisher,
            IEventPersistenceSynchronizerProvider eventPersistenceSynchronizerProvider,
            ICommandContext commandContext,
            ILoggerFactory loggerFactory)
        {
            _processingCommandCache = processingCommandCache;
            _commandAsyncResultManager = commandAsyncResultManager;
            _commandHandlerProvider = commandHandlerProvider;
            _aggregateRootTypeProvider = aggregateRootTypeProvider;
            _memoryCache = memoryCache;
            _repository = repository;
            _retryCommandService = retryCommandService;
            _eventStore = eventStore;
            _eventPublisher = eventPublisher;
            _eventPersistenceSynchronizerProvider = eventPersistenceSynchronizerProvider;
            _commandContext = commandContext;
            _trackingContext = commandContext as ITrackingContext;
            _logger = loggerFactory.Create(GetType().Name);

            if (_trackingContext == null)
            {
                throw new Exception("command context must also implement ITrackingContext interface.");
            }
        }
 public void Initialize(IEventStore eventStore, bool purgeExistingViews = false)
 {
     foreach (var batch in eventStore.Stream().Batch(1000))
     {
         Dispatch(eventStore, batch.Select(e => _domainEventSerializer.Deserialize(e)));
     }
 }
 public RegistrationApplicationService( IEventStore eventStore,IDomainIdentityService ids, IUserIndexService uniqueness,  PasswordGenerator generator)
 {
     _eventStore = eventStore;
     _ids = ids;
     _uniqueness = uniqueness;
     _generator = generator;
 }
 public void Arrange()
 {
     // Arrange.
     eventStore = MockRepository.GenerateMock<IEventStore>();
     repository = new Repository<SchedulerJob>(eventStore);
     schedulerJobCommandHandlers = new SchedulerJobCommandHandlers(repository);
 }
        public MagistrateRegistry(IEventStore store)
        {
            Scan(a =>
            {
                a.TheCallingAssembly();
                a.WithDefaultConventions();

                a.AddAllTypesOf(typeof(IRequestHandler<,>));
                a.AddAllTypesOf(typeof(INotificationHandler<>));
                a.AddAllTypesOf(typeof(IController));
            });

            For<SingleInstanceFactory>().Use<SingleInstanceFactory>(ctx => t => ctx.GetInstance(t));
            For<MultiInstanceFactory>().Use<MultiInstanceFactory>(ctx => t => ctx.GetAllInstances(t));
            For<IMediator>().Use<Mediator>();

            Policies.Add<ServicePolicy>();
            Policies.Add<ReadModelPolicy>();

            For<Projectionist>().Singleton();
            For<IEventStore>()
                .Use(context => new ProjectionStore(store, context.GetInstance<Projectionist>().Apply));
            For<AggregateStore<Guid>>().Use(ctx => new AggregateStore<Guid>(ctx.GetInstance<IEventStore>()));

            For<JsonSerializerSettings>().Use(new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            });
        }
Beispiel #8
0
        public void Start()
        {
            _eventStore = new SqlEventStore(() => EventStoreDbContext.Create());

            //_eventStore = new EventStore();

            _eventPublisher = new EventPublisher(_bus);
            _notificationPublisher = new NotificationPublisher(_bus);

            _repository = new MyRepository(_eventStore, _eventPublisher);
            _session = new MySession(_repository);

            //_repository = new Repository(_eventStore, _eventPublisher);
            //_session = new Session(_repository);

            _ndch = new NetworkDeviceCommandHandler(_session, _notificationPublisher);
            _ndvb = new NetworkDeviceViewBuilder();

            _bus.SubscribeHandler<CreateNetworkDevice>(_ndch.Handle);
            _bus.SubscribeHandler<ChangeNetworkDeviceHostName>(_ndch.Handle);
            _bus.SubscribeHandler<NetworkDeviceSetStatus>(_ndch.Handle);

            _bus.SubscribeHandler<NetworkDeviceCreated>(_ndvb.Handle);
            _bus.SubscribeHandler<NetworkDeviceHostnameChanged>(_ndvb.Handle);
            _bus.SubscribeHandler<NetworkDeviceOnlineStatusChanged>(_ndvb.Handle);
        }
Beispiel #9
0
 public CollectionService(
     IEventStore eventStore, 
     IPublishEvents eventsPublisher)
 {
     this.eventStore = eventStore;
     this.eventsPublisher = eventsPublisher;
 }
Beispiel #10
0
 public EventApplier(IEventStore eventstore, HandlerRegistry handlerregistry, IHandlerInstanceResolver resolver,IParameterResolver parameterresolver)
 {
     this.eventstore = eventstore;
     this.handlerregistry = handlerregistry;
     this.resolver = resolver;
     this.parameterresolver = parameterresolver;
 }
        public void SetUp()
        {
            _publisher = new StubEventPublisher();
            _eventStore = new global::InMemoryEventStore.InMemoryEventStore(_publisher);

            _eventStore.SaveEvents(_aggregateId, EventStreamToSave(), -1);
        }
        static void Main(string[] args)
        {
            EventBus bus = new EventBus();
            _eventStore = new MemoryEventStore(bus);

            IEventSourcedRepository<Column> eventSourcedRepository = UseSnapshotting
                ? CreateSnapshottingRepository(EventsPerSnapshot)
                : CreateNonSnapshottingRepository();

            ColumnCommandHandler commandHandler = new ColumnCommandHandler(eventSourcedRepository);
            _columnRepository = new MemoryRepository<ColumnDTO>();
            _calculationRepository = new MemoryRepository<CalculationDTO>();
            ColumnView columnView = new ColumnView(_columnRepository);
            CalculationView calculationView = new CalculationView(_calculationRepository);

            //bus.Subscribe<IEvent>(ev => _log.Information("New Event: {@Event}", ev));

            bus.Subscribe<ColumnCreated>(columnView.Handle);
            bus.Subscribe<ColumnRenamed>(columnView.Handle);
            bus.Subscribe<ColumnDataTypeChanged>(columnView.Handle);
            bus.Subscribe<ColumnMadePrimary>(columnView.Handle);
            bus.Subscribe<ColumnPrimaryCleared>(columnView.Handle);
            bus.Subscribe<CalculationAdded>(columnView.Handle);
            bus.Subscribe<CalculationRemoved>(columnView.Handle);

            bus.Subscribe<CalculationAdded>(calculationView.Handle);
            bus.Subscribe<CalculationRemoved>(calculationView.Handle);
            bus.Subscribe<CalculationOperandChanged>(calculationView.Handle);
            bus.Subscribe<CalculationOperatorChanged>(calculationView.Handle);

            PerformSomeActions(commandHandler);
            ShowReadModel();

            PerformLotsOfActions(commandHandler);
        }
Beispiel #13
0
 public UserStoryService(
     IEventStore eventStore,
     IPublishEvents eventsPublisher)
 {
     this.eventsPublisher = eventsPublisher;
     this.eventStore = eventStore;
 }
Beispiel #14
0
 public ErrorQueueLoader(ITransactor transactor, IEventStore eventStore, IEventErrorStoreRepository eventErrorStoreRepository, IHandlerSequenceRespository handlerSequenceRepRespository)
 {
     _transactor = transactor;
     _eventStore = eventStore;
     _eventErrorStoreRepository = eventErrorStoreRepository;
     _handlerSequenceRepRespository = handlerSequenceRepRespository;
 }
 public void Dispatch(IEventStore eventStore, IEnumerable<DomainEvent> events)
 {
     foreach (var e in events)
     {
         Console.WriteLine(e);
     }
 }
Beispiel #16
0
        public void Setup()
        {
            this.eventStorage = CreateEventStorage();
            this.eventStore = new EventStore(this.eventStorage, this.bus, this.serializer);

            this.OnSetUp();
        }
 public EventViewerController()
     : base()
 {
     _storage = ServiceLocator.EventStore;
     PageSize = 15;
     _saveSessionVars = true;
 }
        public void SetUp()
        {
            _eventStore = new global::InMemoryEventStore.InMemoryEventStore(new StubEventPublisher());
            _eventStore.SaveEvents(_aggregateId, EventStreamToSave(), -1);

            _retrievedEvents = _eventStore.GetEventsForAggregateSinceVersion(_aggregateId, 3).ToList();
        }
Beispiel #19
0
 public DefaultEventService(
     IJsonSerializer jsonSerializer,
     IScheduleService scheduleService,
     ITypeNameProvider typeNameProvider,
     IMemoryCache memoryCache,
     IAggregateRootFactory aggregateRootFactory,
     IAggregateStorage aggregateStorage,
     IEventStore eventStore,
     IMessagePublisher<DomainEventStreamMessage> domainEventPublisher,
     IOHelper ioHelper,
     ILoggerFactory loggerFactory)
 {
     _eventMailboxDict = new ConcurrentDictionary<string, EventMailBox>();
     _ioHelper = ioHelper;
     _jsonSerializer = jsonSerializer;
     _scheduleService = scheduleService;
     _typeNameProvider = typeNameProvider;
     _memoryCache = memoryCache;
     _aggregateRootFactory = aggregateRootFactory;
     _aggregateStorage = aggregateStorage;
     _eventStore = eventStore;
     _domainEventPublisher = domainEventPublisher;
     _logger = loggerFactory.Create(GetType().FullName);
     _batchSize = ENodeConfiguration.Instance.Setting.EventMailBoxPersistenceMaxBatchSize;
 }
Beispiel #20
0
 public CommandBus(IEventStore eventstore, HandlerRegistry handlerregistry, IHandlerInstanceResolver resolver,IParameterResolver ParameterResolver)
 {
     this.eventstore = eventstore;
     this.handlerregistry = handlerregistry;
     this.resolver = resolver;
     this.ParameterResolver = ParameterResolver;
 }
 public ResetAllEventsForAllSubscriptionsTask(
         IEventSubscriptionManager eventSubcriptionManager,
         IEventStore eventStore
     )
 {
     _eventSubscriptionManager = eventSubcriptionManager;
     _eventStore = eventStore;
 }
        public FactoryBasedAggregateRootRepository(IEventStore eventStore, IDomainEventSerializer domainEventSerializer, IDomainTypeNameMapper domainTypeNameMapper, Func<Type, AggregateRoot> aggregateRootFactoryMethod)
            : base(eventStore, domainEventSerializer, domainTypeNameMapper)
        {
            if (aggregateRootFactoryMethod == null)
                throw new ArgumentNullException("aggregateRootFactoryMethod");

            _aggregateRootFactoryMethod = aggregateRootFactoryMethod;
        }
 public void NotifyChanges(IEventStore eventStore, EventStream streamOfEvents)
 {
     foreach( var notifierType in _notifiers ) 
     {
         var notifier = _container.Get(notifierType) as IEventStoreChangeNotifier;
         notifier.Notify(eventStore, streamOfEvents);
     }  
 }
 public SequencedEventSelector(ITransactor transactor,
                               IEventStore eventStore,
                               IHandlerSequenceRespository handlerSequenceRespository)
 {
     _transactor = transactor;
     _eventStore = eventStore;
     _handlerSequenceRespository = handlerSequenceRespository;
 }
 public void Arrange()
 {
     // Arrange.
     eventAggregator = new EventAggregator();
     eventStore = new InMemoryEventStore(eventAggregator);
     repository = new Repository<SchedulerJob>(eventStore);
     scheduler = new SchedulerService(new EventAggregator(), repository);
 }
Beispiel #26
0
        public MindReader(IEventStore store, StreamName streamName,  EmoEngine engine)
        {
            this.engine = engine;
            this.store = store;
            this.streamName = streamName;

            RegisterHandlers();
        }
Beispiel #27
0
 public void resolving_objects()
 {
     _eventStore = _container.Resolve<IEventStore>();
     _eventPublisher = _container.Resolve<IEventPublisher>();
     _repository = _container.Resolve<IRepository>();
     //_commandHandlers.AddRange(new List<Consumes<Command>.All> { _container.Resolve<Consumes<RequestClassifyDocuments>.All>(), _container.Resolve<Consumes<RequestSeparateDocuments>.All>() });
     //_requestClassifyDocumentsCommandHandler = _container.Resolve<Consumes<RequestClassifyDocuments>.All>();
     //_requestSeparateDocumentsCommandHandler = _container.Resolve<Consumes<RequestSeparateDocuments>.All>();
 }
        public static IEnumerable<object> BuildApplicationServices(IEventStore eventStore, IDocumentStore projectionStore)
        {
            var loginIndexService = new LoginIndexLookupService(projectionStore);

            yield return new Security.SecurityApplicationService(eventStore);
            yield return new Profile.ProfileApplicationService(eventStore);
            yield return new Registration.RegistrationApplicationService(eventStore, loginIndexService);
            yield break;
        }
        public EventStorePublisher(IEventStore store, IEventPublisher publisher, IDocumentStoreFactory documentStoreFactory)
        {
            Condition.Requires(store, "store").IsNotNull();
              Condition.Requires(publisher, "publisher").IsNotNull();

              EventStore = store;
              EventPublisher = publisher;
              LastPublishedIdRepository = new DocumentRepository(documentStoreFactory);
        }
 public SlothMqNotificationPublisher(IEventStore eventStore, 
     IPublishedNotificationTrackerStore publishedNotificationTrackerStore,
     object messagingLocator)
 {
     this._eventStore = eventStore;
     this._publishedNotificationTrackerStore = publishedNotificationTrackerStore;
     this._exchangeName = messagingLocator.ToString();
     this._exchangePublisher = new ExchangePublisher(this._exchangeName);
 }
 public BookingSaga(IBus bus, IEventStore eventStore, IRepository repository)
     : base(bus, eventStore)
 {
     _repository = repository;
 }
 public AddManufacturerCommandHandler(IEventStore eventStore)
 {
     _eventStore = eventStore;
 }
Beispiel #33
0
 public Repository(IEventStore storage)
 {
     _storage = storage;
 }
Beispiel #34
0
 protected DelegateEventStore(IEventStore eventStore)
 {
     _eventStore = eventStore;
 }
Beispiel #35
0
 public AggregateStore(IEventStore eventStore, IEventSerializer serializer)
 {
     _eventStore = eventStore;
     _serializer = serializer;
 }
Beispiel #36
0
 public CustomerCreatedHandler(ICRMDbContext context, IEventStore eventStore)
 {
     _context    = context;
     _eventStore = eventStore;
 }
 public void RemoveItems(int[] productCatalogueIds, IEventStore eventStore)
 {
     items.RemoveWhere(i => productCatalogueIds.Contains(i.ProductCatalogueId));
 }
        public BoundedContextListener(
            KafkaConnectionString connectionString,
            ListenerConfiguration configuration,
            IEventConverter eventConverter,
            IUncommittedEventStreamCoordinator uncommittedEventStreamCoordinator,
            ISerializer serializer,
            ILogger logger,
            IApplicationResourceIdentifierConverter applicationResourceIdentifierConverter,
            IImplementationsOf <IEvent> eventTypes,
            IEventStore eventStore,
            IEventEnvelopes eventEnvelopes,
            IEventSequenceNumbers eventSequenceNumbers,
            IEventSourceVersions eventSourceVersions,
            ICommittedEventStreamBridge committedEventStreamBridge)
        {
            _serializer     = serializer;
            _eventConverter = eventConverter;
            _uncommittedEventStreamCoordinator = uncommittedEventStreamCoordinator;
            _logger = logger;
            _applicationResourceIdentifierConverter = applicationResourceIdentifierConverter;
            _eventTypes                 = eventTypes;
            _eventSequenceNumbers       = eventSequenceNumbers;
            _eventStore                 = eventStore;
            _eventEnvelopes             = eventEnvelopes;
            _eventSourceVersions        = eventSourceVersions;
            _committedEventStreamBridge = committedEventStreamBridge;



            logger.Information($"Listening on topic '{configuration.Topic}' from '{connectionString}'");

            var config = new Dictionary <string, object>
            {
                { "bootstrap.servers", connectionString },
                { "group.id", "simple-consumer" },
                { "enable.auto.commit", true },
                { "auto.commit.interval.ms", 1000 },
                {
                    "default.topic.config",
                    new Dictionary <string, object>()
                    {
                        { "auto.offset.reset", "smallest" }
                    }
                }
            };

            _consumer = new Consumer <Ignore, string>(config, null, new StringDeserializer(Encoding.UTF8));
            _consumer.Assign(new [] { new TopicPartition(configuration.Topic, 0) });
            _consumer.OnMessage += (_, msg) =>
            {
                try
                {
                    logger.Trace($"Message received '{msg.Value}'");
                    var raw = _serializer.FromJson <dynamic[]>(msg.Value);

                    foreach (var rawContentAndEnvelope in raw)
                    {
                        var eventSourceId   = (EventSourceId)Guid.Parse(rawContentAndEnvelope.Content.EventSourceId.ToString());
                        var eventIdentifier = _applicationResourceIdentifierConverter.FromString(rawContentAndEnvelope.Envelope.Event.ToString());
                        var version         = EventSourceVersion.FromCombined((double)rawContentAndEnvelope.Envelope.Version);
                        var correlationId   = (TransactionCorrelationId)Guid.Parse(rawContentAndEnvelope.Envelope.CorrelationId.ToString());
                        CorrelationId = correlationId;

                        _logger.Trace($"Received event of with resource name '{eventIdentifier.Resource.Name}' from '{eventSourceId}' with version '{version}' in correlation '{correlationId}'");
                        var eventType = _eventTypes.SingleOrDefault(et => et.Name == eventIdentifier.Resource.Name);
                        if (eventType != null)
                        {
                            _logger.Trace("Matching Event Type : " + eventType.AssemblyQualifiedName);
                            var @event = Activator.CreateInstance(eventType, eventSourceId) as IEvent;
                            _serializer.FromJson(@event, rawContentAndEnvelope.Content.ToString());

                            var eventSource            = new ExternalSource(eventSourceId);
                            var uncommittedEventStream = new UncommittedEventStream(eventSource);
                            uncommittedEventStream.Append(@event, version);


                            _logger.Information($"Committing uncommitted event stream with correlationId '{correlationId}'");
                            var envelopes        = _eventEnvelopes.CreateFrom(eventSource, uncommittedEventStream.EventsAndVersion);
                            var envelopesAsArray = envelopes.ToArray();
                            var eventsAsArray    = uncommittedEventStream.ToArray();

                            _logger.Trace("Create an array of events and envelopes");
                            var eventsAndEnvelopes = new List <EventAndEnvelope>();
                            for (var eventIndex = 0; eventIndex < eventsAsArray.Length; eventIndex++)
                            {
                                var envelope     = envelopesAsArray[eventIndex];
                                var currentEvent = eventsAsArray[eventIndex];
                                eventsAndEnvelopes.Add(new EventAndEnvelope(
                                                           envelope
                                                           .WithTransactionCorrelationId(correlationId)
                                                           .WithSequenceNumber(_eventSequenceNumbers.Next())
                                                           .WithSequenceNumberForEventType(_eventSequenceNumbers.NextForType(envelope.Event)),
                                                           currentEvent
                                                           ));
                            }

                            _logger.Trace("Committing events to event store");
                            _eventStore.Commit(eventsAndEnvelopes);

                            _logger.Trace($"Set event source versions for the event source '{envelopesAsArray[0].EventSource}' with id '{envelopesAsArray[0].EventSourceId}'");
                            _eventSourceVersions.SetFor(envelopesAsArray[0].EventSource, envelopesAsArray[0].EventSourceId, envelopesAsArray[envelopesAsArray.Length - 1].Version);

                            _logger.Trace("Create a committed event stream");
                            var committedEventStream = new CommittedEventStream(uncommittedEventStream.EventSourceId, eventsAndEnvelopes);
                            _committedEventStreamBridge.Send(committedEventStream);

                            CorrelationId = Guid.Empty;
                        }
                    }
                }
                catch (Exception ex)
                {
                    _logger.Error(ex, "Error during receiving");
                }
            };
        }
Beispiel #39
0
        public EventStoreTestSuit(IEventStore eventStore, IProjectionSerializer projectionSerializer = null)
        {
            _projectionSerializer = projectionSerializer;

            _eventStore = new EventStoreWrapper(eventStore);
        }
Beispiel #40
0
 public EventsController(IEventStore eventStore)
 {
     _eventStore = eventStore;
 }
Beispiel #41
0
 public NotificationLogFactory(IEventStore eventStore)
 {
     this.eventStore = eventStore;
 }
 public Handler(IEventStore eventStore) => _eventStore = eventStore;
 public Repository(IEventStore eventStore)
 {
     _eventStore = eventStore;
 }
Beispiel #44
0
 /// <summary>
 /// Initialize a new instance of SnapshotRepository
 /// </summary>
 /// <param name="snapshotStore">ISnapshotStore snapshots should be saved to and fetched from</param>
 /// <param name="snapshotStrategy">ISnapshotStrategy on when to take and if to restore from snapshot</param>
 /// <param name="repository">Reposiory that gets aggregate from event store</param>
 /// <param name="eventStore">Event store where events after snapshot can be fetched from</param>
 public SnapshotRepository(ISnapshotStore snapshotStore, ISnapshotStrategy snapshotStrategy, IRepository repository, IEventStore eventStore)
 {
     _snapshotStore    = snapshotStore ?? throw new ArgumentNullException(nameof(snapshotStore));
     _snapshotStrategy = snapshotStrategy ?? throw new ArgumentNullException(nameof(snapshotStrategy));
     _repository       = repository ?? throw new ArgumentNullException(nameof(repository));
     _eventStore       = eventStore ?? throw new ArgumentNullException(nameof(eventStore));
 }
Beispiel #45
0
 public InMemoryBus(IEventStore eventStore)
 {
     _eventStore = eventStore;
 }
 public EventSourcedAggregateTransactionnalRepository(IEventStore <TAggregateId> eventStore,
                                                      IEventBus publisher,
                                                      IEmptyAggregateFactory <TAggregate, TAggregateId, TEntityId> emptyAggregateFactory,
                                                      IIdProvider <TAggregateId> idProvider)
     : base(eventStore, publisher, emptyAggregateFactory) => _idProvider = idProvider;
Beispiel #47
0
 public Repository(IEventStore eventStore)
 {
     _eventStore = eventStore ?? throw new ArgumentNullException(nameof(eventStore));
 }
Beispiel #48
0
 public Repository(IEventStore eventStore, IEventBus eventBus)
 {
     _eventStore = eventStore;
     _eventBus   = eventBus;
 }
Beispiel #49
0
 public Handler(IEventStore store) => _store = store;
Beispiel #50
0
 void Dispatch(IEventStore eventStore, IEnumerable <EventData> events)
 {
     Dispatch(eventStore, events.Select(e => _domainEventSerializer.Deserialize(e)));
 }
Beispiel #51
0
        public XmlDocumentCapturer(IValidator <XDocument> validator, IEventParser <XElement> xmlEventParser, IEventStore eventStore)
        {
            if (validator == null)
            {
                throw new ArgumentNullException("validator");
            }
            if (xmlEventParser == null)
            {
                throw new ArgumentNullException("xmlEventParser");
            }
            if (eventStore == null)
            {
                throw new ArgumentNullException("eventStore");
            }

            _validator      = validator;
            _xmlEventParser = xmlEventParser;
            _eventStore     = eventStore;
        }
 public EventDispatcher(IUserContext userContext, IEventStore <T> eventStore)
 {
     _userContext = userContext;
     _eventStore  = eventStore;
 }
 public Counter(IEventStore eventStore, string actorId)
 {
     _persistence = Persistence.WithEventSourcing(eventStore, actorId, ApplyEvent);
 }
Beispiel #54
0
 /// <summary>
 /// Construct the event handler
 /// </summary>
 /// <param name="eventStore">The event store</param>
 public CustomAttributeEventHandler(IEventStore eventStore)
 {
     EventStore = eventStore ?? throw new ArgumentNullException(nameof(eventStore));
 }
        public ViewManagerEventDispatcher(IAggregateRootRepository aggregateRootRepository, IEventStore eventStore,
                                          IDomainEventSerializer domainEventSerializer, IDomainTypeNameMapper domainTypeNameMapper, params IViewManager[] viewManagers)
        {
            if (aggregateRootRepository == null)
            {
                throw new ArgumentNullException("aggregateRootRepository");
            }
            if (eventStore == null)
            {
                throw new ArgumentNullException("eventStore");
            }
            if (domainEventSerializer == null)
            {
                throw new ArgumentNullException("domainEventSerializer");
            }
            if (domainTypeNameMapper == null)
            {
                throw new ArgumentNullException("domainTypeNameMapper");
            }
            if (viewManagers == null)
            {
                throw new ArgumentNullException("viewManagers");
            }

            _aggregateRootRepository = aggregateRootRepository;
            _eventStore            = eventStore;
            _domainEventSerializer = domainEventSerializer;
            _domainTypeNameMapper  = domainTypeNameMapper;

            viewManagers.ToList().ForEach(AddViewManager);

            _worker = new Thread(DoWork)
            {
                IsBackground = true
            };

            _automaticCatchUpTimer.Elapsed += delegate
            {
                _work.Enqueue(PieceOfWork.FullCatchUp(false));
            };

            AutomaticCatchUpInterval = TimeSpan.FromSeconds(1);
        }
 public RePublishEventToEventStoreEventHandler(ILogger <RePublishEventToEventStoreEventHandler> logger, IEventStore eventStore)
 {
     _logger     = logger;
     _eventStore = eventStore;
 }
 public BookingRejectedHandler(IEventStore eventStore)
     : base(eventStore)
 {
 }
Beispiel #58
0
 public InMemoryPolicyRepository(IEventStore eventStore, IMediator bus)
 {
     this.eventStore     = eventStore;
     this.bus            = bus;
     this.eventStore.Bus = bus;
 }
 public HomeController(IEventStore eventStore)
 {
     _eventStore = eventStore;
 }
 public BookingSaga(IBus bus, IEventStore eventStore)
     : base(bus, eventStore)
 {
     _repository = new BookingRepository();
 }