public SimpleEventStore(IStoreSettings<IDbConnection> settings, IServiceBus serviceBus, ISerialize serializer, ISnapshotStore snapshotStore) { _settings = settings; _serviceBus = serviceBus; _serializer = serializer; _snapshotStore = snapshotStore; }
public Pager(IFhirStore store, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer) { this.store = store; this.snapshotstore = snapshotstore; this.localhost = localhost; this.transfer = transfer; }
public Pager(IFhirStore fhirStore, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer, List<ModelInfo.SearchParamDefinition> searchParameters) { this.fhirStore = fhirStore; this.snapshotstore = snapshotstore; this.localhost = localhost; this.transfer = transfer; this.searchParameters = searchParameters; }
public SnapshotRepository(ISnapshotStore snapshotStore, ISnapshotStrategy <TAuthenticationToken> snapshotStrategy, IRepository <TAuthenticationToken> repository, IEventStore <TAuthenticationToken> eventStore, IAggregateFactory aggregateFactory) { SnapshotStore = snapshotStore; SnapshotStrategy = snapshotStrategy; Repository = repository; EventStore = eventStore; AggregateFactory = aggregateFactory; }
public SingleStreamCatchupCache(IConnectionStatusMonitor <IEventStoreConnection> connectionMonitor, SingleStreamCatchupCacheConfiguration <TAggregate> cacheConfiguration, IEventTypeProvider <TAggregate> eventTypeProvider, ILoggerFactory loggerFactory, ISnapshotStore <TAggregate>?snapshotStore = null, ISnapshotStrategy?snapshotStrategy = null) : base(connectionMonitor, cacheConfiguration, eventTypeProvider, loggerFactory, snapshotStore, snapshotStrategy) { }
public Pager(IFhirStore fhirStore, ISnapshotStore snapshotstore, ILocalhost localhost, Transfer transfer, List <ModelInfo.SearchParamDefinition> searchParameters) { this.fhirStore = fhirStore; this.snapshotstore = snapshotstore; this.localhost = localhost; this.transfer = transfer; this.searchParameters = searchParameters; }
public EventSourcedRepository(IEventStore eventStore, ISnapshotStore snapshotStore, IMediator mediator, EventSourcingOptions eventSourcingOptions, ILogger <EventSourcedRepository <TAggregateRoot> > logger) { _eventStore = eventStore; _snapshotStore = snapshotStore; _mediator = mediator; _eventSourcingOptions = eventSourcingOptions; _logger = logger; }
public NUnitSnapper(ISnapshotStore snapshotStore, ISnapshotUpdateDecider snapshotUpdateDecider, ISnapshotComparer snapshotComparer, SnapshotIdResolver snapshotIdResolver, JsonSnapshotSanitiser snapshotSanitiser) : base(snapshotStore, snapshotUpdateDecider, snapshotComparer) { _snapshotIdResolver = snapshotIdResolver; _snapshotSanitiser = snapshotSanitiser; }
public NewSnapshottingAggregateRootRepositoryDecorator(IAggregateRootRepository aggregateRootRepository, IEventStore eventStore, IDomainEventSerializer domainEventSerializer, ISnapshotStore snapshotStore, TimeSpan preparationThreshold) { _aggregateRootRepository = aggregateRootRepository; _eventStore = eventStore; _domainEventSerializer = domainEventSerializer; _snapshotStore = snapshotStore; _preparationThreshold = preparationThreshold; }
/// <summary> /// First time initialization and reconfig in case of restore /// </summary> /// <param name="model"></param> private void Configure(Model model) { _commandStore = _config.CreateCommandStore(); _snapshotStore = _config.CreateSnapshotStore(); _journalAppender = JournalAppender.Create(model.Revision + 1, _commandStore); _kernel = _config.CreateKernel(model); _kernel.SetSynchronizer(_synchronizer); }
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)); }
public EventStoreStatefulActorBuilder <TActor, TAggregate, TRegistry> WithReadOneStreamFromStartCache( string streamId, IEventTypeProvider <TAggregate> eventTypeProvider, Action <MultipleStreamsCatchupCacheConfiguration <TAggregate> > getMultipleStreamsCatchupCacheConfiguration = null, ISnapshotStore <TAggregate> snapshotStore = null, ISnapshotStrategy snapshotStrategy = null) { return(WithReadManyStreamsFromStartCache(new[] { streamId }, eventTypeProvider, getMultipleStreamsCatchupCacheConfiguration, snapshotStore, snapshotStrategy)); }
public ProjectionPlayer(IEventStore eventStore, IProjectionStore projectionStore, IProjectionRepository projectionRepository, ISnapshotStore snapshotStore, EventTypeIndexForProjections index, IEventStorePlayer eventStorePlayer) { this.eventStore = eventStore; this.projectionStore = projectionStore; this.projectionRepository = projectionRepository; this.snapshotStore = snapshotStore; this.index = index; this.eventStorePlayer = eventStorePlayer; }
public static Task DeleteAsync( this ISnapshotStore snapshots, string snapshotPartitionId, long fromVersionInclusive, long toVersionInclusive ) { return(snapshots.DeleteAsync(snapshotPartitionId, fromVersionInclusive, toVersionInclusive, CancellationToken.None)); }
public Persistence(TKey ownerKey, Type ownerType, IEventStore eventStore, IEventDataFormatter eventDataFormatter, ISnapshotStore <None, TKey> snapshotStore, IStreamNameResolver streamNameResolver, HandleEvent applyEvent) : base(ownerKey, ownerType, eventStore, eventDataFormatter, snapshotStore, streamNameResolver, PersistenceMode.EventSourcing, null, applyEvent) { }
public ProjectionPlayer(IEventStoreFactory eventStoreFactory, IProjectionStore projectionStore, IProjectionRepository projectionRepository, ISnapshotStore snapshotStore, EventTypeIndexForProjections index, ITenantResolver tenantResolver) { this.eventStoreFactory = eventStoreFactory; this.projectionStore = projectionStore; this.projectionRepository = projectionRepository; this.snapshotStore = snapshotStore; this.index = index; this.tenantResolver = tenantResolver; }
public static Task Remove( this ISnapshotStore snapshots, string aggregateId, long fromVersionInclusive, long toVersionInclusive ) { return(snapshots.Remove(aggregateId, fromVersionInclusive, toVersionInclusive, CancellationToken.None)); }
public static Task <T> FindAsync <T>( this ISnapshotStore store, Guid id, int maxVersion = int.MaxValue, CancellationToken cancellationToken = default) where T : class, IAggregate { return(store.FindAsync <T, Guid>(id, maxVersion, cancellationToken)); }
public virtual async Task LoadAsync( IEventStore eventStore, ISnapshotStore snapshotStore, CancellationToken cancellationToken) { var domainEvents = await eventStore.LoadEventsAsync <TAggregate, TIdentity>(Id, cancellationToken).ConfigureAwait(false); ApplyEvents(domainEvents); }
public Persistence(TKey ownerKey, Type ownerType, IEventStore eventStore, IEventDataFormatter eventDataFormatter, ISnapshotStore <object, TKey> snapshotStore, IStreamNameResolver streamNameResolver, Func <Envelope <IEvent>, Task> applyEvent) : base(ownerKey, ownerType, eventStore, eventDataFormatter, snapshotStore, streamNameResolver, PersistenceMode.EventSourcing, null, applyEvent) { }
public void SetUp() { container = new WindsorContainer(); memoryPersistence = new InMemoryPersistence(); sut = new Repository(new AggregateFactoryEx(container.Kernel), new StreamsFactory(memoryPersistence)); var snapshotMemoryPersistence = new InMemoryPersistence(); snapshotStore = new DefaultSnapshotStore(snapshotMemoryPersistence); }
public DomainRepository(IEventStore store, IEventBus eventBus, ISnapshotStore snapshotStore = null, IAggregateRootCreationStrategy aggregateRootCreationStrategy = null) { Contract.Requires <ArgumentNullException>(store != null); Contract.Requires <ArgumentNullException>(eventBus != null); _store = store; _eventBus = eventBus; _snapshotStore = snapshotStore; _aggregateRootCreator = aggregateRootCreationStrategy ?? new SimpleAggregateRootCreationStrategy(); }
protected CachedAggregateRepository( IEventStore <TAggregate, TKey> eventStore, ISnapshotStore <TAggregate, TKey> snapshotStore, IDistributedCache cache, DistributedCacheEntryOptions cacheOptions) : base(eventStore, snapshotStore) { _cache = cache; _cacheOptions = cacheOptions; }
public CachedGiftCardRepository( IEventStore <GiftCard, Guid> eventStore, ISnapshotStore <GiftCard, Guid> snapshotStore, IDistributedCache cache) : base(eventStore, snapshotStore, cache, new DistributedCacheEntryOptions { SlidingExpiration = TimeSpan.FromSeconds(10) }) { }
internal SubEntitySnapshotDenormalizer(BudgetModel budgetModel) { _budgetModel = budgetModel ?? throw new ArgumentNullException(nameof(budgetModel)); _snapshotStore = budgetModel?.BudgetStore?.SnapshotStore ?? throw new ArgumentException("Could not find snapshot store of budgetModel", nameof(budgetModel)); _createEntityFromEvent = CreateFromEventConstructor(); _createEntityFromSnapshot = CreateFromSnapshotConstructor(); RegisterForMessages(); }
/// <summary> /// Initializes a new instance of the <see cref="EventStoreRepository" /> class. /// </summary> /// <param name="identityMap">The identity map.</param> /// <param name="eventStore">The event store.</param> /// <param name="snapshotStore">The snapshot store.</param> public EventStoreRepository(IIdentityMap identityMap, IEventStore eventStore, ISnapshotStore snapshotStore) { Guard.Against.Null(() => identityMap); Guard.Against.Null(() => eventStore); Guard.Against.Null(() => snapshotStore); this.identityMap = identityMap; this.eventStore = eventStore; this.snapshotStore = snapshotStore; }
public LmdbEventLog(string id, string prefix, ISnapshotStore snapshotStore = null) : base(id) { this.id = id; this.prefix = prefix; this.serialization = Context.System.Serialization; this.Settings = new LmdbEventLogSettings(Context.System.Settings.Config); this.env = LMDBEnvironment.Create(this.Settings.RootDir); this.db = this.env.OpenDatabase(this.Settings.DbName, new DatabaseConfig(DbFlags.Create)); this.SnapshotStore = snapshotStore ?? new LmdbSnapshotStore(this.serialization, this.env, this.db); }
public PopulateGrainIndexes( IGrainFactory grainFactory, ISnapshotStore <AppState, Guid> statesForApps, ISnapshotStore <RuleState, Guid> statesForRules, ISnapshotStore <SchemaState, Guid> statesForSchemas) { this.grainFactory = grainFactory; this.statesForApps = statesForApps; this.statesForRules = statesForRules; this.statesForSchemas = statesForSchemas; }
internal NoCreateEntitySnapshotDenormalizer(BudgetModel budgetModel, NoCreateEntityRepository <TEntity, TSnapshot> repository) { _budgetModel = budgetModel ?? throw new ArgumentNullException(nameof(budgetModel)); _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _snapshotStore = budgetModel?.BudgetStore?.SnapshotStore ?? throw new ArgumentException("Could not find snapshot store of budgetModel", nameof(budgetModel)); _createEntityFromSnapshot = CreateFromSnapshotConstructor(); RegisterForMessages(); }
public ShapshotAggregateRepository(IEventStoreAdapter eventStore, ISnapshotStore snapshotStore, int interval) : base(eventStore) { Argument.IsNotNull(eventStore, nameof(eventStore)); Argument.IsNotNull(snapshotStore, nameof(snapshotStore)); Argument.NotNegative(interval, nameof(interval)); _eventStore = eventStore; _snapshotStore = snapshotStore; _interval = interval; }
public JoesUnitOfWork(Guid commandId, IDomainRepository domainRepository, IStoreEvents eventStore, ISnapshotStore snapshotStore, IEventBus eventBus, ISnapshottingPolicy snapshottingPolicy) : base(commandId) { _eventStream = new UncommittedEventStream(commandId); _commitId = commandId; _eventStore = eventStore; _domainRepository = domainRepository; _snapshotStore = snapshotStore; _eventBus = eventBus; _snapshottingPolicy = snapshottingPolicy; }
public Repository( IEventStore eventStore, ISnapshotStore snapshopStore, IBus bus, ILogger logger) { this.eventStore = eventStore ?? throw new ArgumentNullException("eventStore"); this.snapshopStore = snapshopStore ?? throw new ArgumentNullException("snapshopStore"); this.bus = bus ?? throw new ArgumentNullException("bus"); this.logger = logger ?? throw new ArgumentNullException("logger"); }
private Persistence(IEventStore eventStore, ISnapshotStore snapshotStore, string actorId, Action <Event> applyEvent = null, Action <Snapshot> applySnapshot = null, ISnapshotStrategy snapshotStrategy = null, Func <object> getState = null) { _eventStore = eventStore; _snapshotStore = snapshotStore; _actorId = actorId; _applyEvent = applyEvent; _applySnapshot = applySnapshot; _getState = getState; _snapshotStrategy = snapshotStrategy ?? new NoSnapshots(); }
public FhirService(Infrastructure infrastructure) { this.localhost = infrastructure.Localhost; this.store = infrastructure.Store; this.snapshotstore = infrastructure.SnapshotStore; this.generator = infrastructure.Generator; this.index = infrastructure.Index; this.listener = infrastructure.ServiceListener; transfer = new Transfer(generator, localhost); pager = new Pager(store, snapshotstore, localhost, transfer); }
public EventSourcingAggregateStorage( IAggregateRootFactory aggregateRootFactory, IEventStore eventStore, ISnapshotStore snapshotStore, ISnapshotter snapshotter, ITypeCodeProvider aggregateRootTypeCodeProvider) { _aggregateRootFactory = aggregateRootFactory; _eventStore = eventStore; _snapshotStore = snapshotStore; _snapshotter = snapshotter; _aggregateRootTypeCodeProvider = aggregateRootTypeCodeProvider; }
/// <summary>Parameterized constructor. /// </summary> /// <param name="aggregateRootFactory"></param> /// <param name="eventStreamConvertService"></param> /// <param name="eventSourcingService"></param> /// <param name="eventStore"></param> /// <param name="snapshotStore"></param> /// <param name="aggregateRootTypeCodeProvider"></param> public EventSourcingAggregateStorage( IAggregateRootFactory aggregateRootFactory, IEventStreamConvertService eventStreamConvertService, IEventSourcingService eventSourcingService, IEventStore eventStore, ISnapshotStore snapshotStore, IAggregateRootTypeCodeProvider aggregateRootTypeCodeProvider) { _aggregateRootFactory = aggregateRootFactory; _eventStreamConvertService = eventStreamConvertService; _eventSourcingService = eventSourcingService; _eventStore = eventStore; _snapshotStore = snapshotStore; _aggregateRootTypeCodeProvider = aggregateRootTypeCodeProvider; }
public FhirService(ILocalhost localhost, IFhirStore fhirStore, ISnapshotStore snapshotStore, IGenerator keyGenerator, IFhirIndex fhirIndex, IServiceListener serviceListener, IFhirResponseFactory responseFactory, IndexService indexService) { this.localhost = localhost; this.fhirStore = fhirStore; this.snapshotstore = snapshotStore; this.keyGenerator = keyGenerator; this.fhirIndex = fhirIndex; this.serviceListener = serviceListener; this.responseFactory = responseFactory; _indexService = indexService; transfer = new Transfer(this.keyGenerator, localhost); pager = new Pager(this.fhirStore, snapshotstore, localhost, transfer, ModelInfo.SearchParameters); //TODO: Use FhirModel instead of ModelInfo for the searchparameters. }
public UnitOfWork(Guid commandId, IDomainRepository domainRepository, IEventStore eventStore, ISnapshotStore snapshotStore, IEventBus eventBus, ISnapshottingPolicy snapshottingPolicy) : base(commandId) { Contract.Requires<ArgumentNullException>(domainRepository != null); Contract.Requires<ArgumentNullException>(snapshotStore != null); Contract.Requires<ArgumentNullException>(eventStore != null); Contract.Requires<ArgumentNullException>(eventBus != null); Contract.Requires<ArgumentNullException>(snapshottingPolicy != null); _repository = domainRepository; _snapshottingPolicy = snapshottingPolicy; _eventBus = eventBus; _snapshotStore = snapshotStore; _eventStore = eventStore; _eventStream = new UncommittedEventStream(commandId); _dirtyInstances = new Queue<AggregateRoot>(); }
/// <summary> /// Parameterized constructor. /// </summary> public EventSourcedRepository(IEventStore eventStore, ISnapshotStore snapshotStore, ISnapshotPolicy snapshotPolicy, IMemoryCache cache, IEventBus eventBus, IAggregateRootFactory aggregateFactory, IBinarySerializer binarySerializer) { this._eventStore = eventStore; this._snapshotStore = snapshotStore; this._snapshotPolicy = snapshotPolicy; this._cache = cache; this._eventBus = eventBus; this._aggregateFactory = aggregateFactory; this._binarySerializer = binarySerializer; //this._textSerializer = textSerializer; this._logger = LogManager.GetLogger("ThinkNet"); }
public ModelLoader(EngineConfiguration config, ICommandStore commandStore = null, ISnapshotStore snapshotStore = null) { _commandStore = commandStore ?? config.CreateCommandStore(); _snapshotStore = snapshotStore ?? config.CreateSnapshotStore(); }
public MetaModelRepository(IEventStore store, IEventBus eventBus, ISnapshotStore snapshotStore = null, IAggregateRootCreationStrategy aggregateRootCreationStrategy = null) : base(new BranchableEventStoreAdapter(store), eventBus, snapshotStore, aggregateRootCreationStrategy) { }