Beispiel #1
0
        public RestoreGrain(IBackupArchiveLocation backupArchiveLocation,
                            IClock clock,
                            ICommandBus commandBus,
                            IEventStore eventStore,
                            IEventDataFormatter eventDataFormatter,
                            IEnumerable <BackupHandler> handlers,
                            ISemanticLog log,
                            IStreamNameResolver streamNameResolver,
                            IStore <string> store)
        {
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(commandBus, nameof(commandBus));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(handlers, nameof(handlers));
            Guard.NotNull(store, nameof(store));
            Guard.NotNull(streamNameResolver, nameof(streamNameResolver));
            Guard.NotNull(log, nameof(log));

            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.commandBus         = commandBus;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.handlers           = handlers;
            this.store              = store;
            this.streamNameResolver = streamNameResolver;
            this.log = log;
        }
Beispiel #2
0
        public BackupGrain(
            IAssetStore assetStore,
            IBackupArchiveLocation backupArchiveLocation,
            IClock clock,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            IJsonSerializer serializer,
            IServiceProvider serviceProvider,
            ISemanticLog log,
            IGrainState <BackupState> state)
        {
            Guard.NotNull(assetStore, nameof(assetStore));
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(serviceProvider, nameof(serviceProvider));
            Guard.NotNull(serializer, nameof(serializer));
            Guard.NotNull(state, nameof(state));
            Guard.NotNull(log, nameof(log));

            this.assetStore            = assetStore;
            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.serializer         = serializer;
            this.serviceProvider    = serviceProvider;
            this.state              = state;
            this.log = log;
        }
Beispiel #3
0
        public RestoreGrain(
            IBackupArchiveLocation backupArchiveLocation,
            IClock clock,
            ICommandBus commandBus,
            IEventDataFormatter eventDataFormatter,
            IEventStore eventStore,
            IGrainState <RestoreState2> state,
            IServiceProvider serviceProvider,
            IStreamNameResolver streamNameResolver,
            IUserResolver userResolver,
            ISemanticLog log)
        {
            Guard.NotNull(backupArchiveLocation);
            Guard.NotNull(clock);
            Guard.NotNull(commandBus);
            Guard.NotNull(eventDataFormatter);
            Guard.NotNull(eventStore);
            Guard.NotNull(serviceProvider);
            Guard.NotNull(state);
            Guard.NotNull(streamNameResolver);
            Guard.NotNull(userResolver);
            Guard.NotNull(log);

            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.commandBus         = commandBus;
            this.eventDataFormatter = eventDataFormatter;
            this.eventStore         = eventStore;
            this.serviceProvider    = serviceProvider;
            this.state              = state;
            this.streamNameResolver = streamNameResolver;
            this.userResolver       = userResolver;
            this.log = log;
        }
Beispiel #4
0
        public BackupGrain(
            IAssetStore assetStore,
            IBackupArchiveLocation backupArchiveLocation,
            IClock clock,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            ISemanticLog log,
            IStore <Guid> store)
        {
            Guard.NotNull(assetStore, nameof(assetStore));
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(store, nameof(store));
            Guard.NotNull(log, nameof(log));

            this.assetStore            = assetStore;
            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.store              = store;
            this.log = log;
        }
Beispiel #5
0
        public RestoreGrain(IBackupArchiveLocation backupArchiveLocation,
                            IClock clock,
                            ICommandBus commandBus,
                            IEventStore eventStore,
                            IEventDataFormatter eventDataFormatter,
                            IJsonSerializer serializer,
                            ISemanticLog log,
                            IServiceProvider serviceProvider,
                            IStreamNameResolver streamNameResolver,
                            IGrainState <RestoreState> state)
        {
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(commandBus, nameof(commandBus));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(serializer, nameof(serializer));
            Guard.NotNull(serviceProvider, nameof(serviceProvider));
            Guard.NotNull(state, nameof(state));
            Guard.NotNull(streamNameResolver, nameof(streamNameResolver));
            Guard.NotNull(log, nameof(log));

            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.commandBus         = commandBus;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.serializer         = serializer;
            this.serviceProvider    = serviceProvider;
            this.streamNameResolver = streamNameResolver;
            this.state              = state;
            this.log = log;
        }
Beispiel #6
0
        public BackupGrain(
            IBackupArchiveLocation backupArchiveLocation,
            IBackupArchiveStore backupArchiveStore,
            IClock clock,
            IEventDataFormatter eventDataFormatter,
            IEventStore eventStore,
            IGrainState <BackupState> state,
            IServiceProvider serviceProvider,
            IUserResolver userResolver,
            ISemanticLog log)
        {
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(backupArchiveStore, nameof(backupArchiveStore));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(serviceProvider, nameof(serviceProvider));
            Guard.NotNull(state, nameof(state));
            Guard.NotNull(userResolver, nameof(userResolver));
            Guard.NotNull(log, nameof(log));

            this.backupArchiveLocation = backupArchiveLocation;
            this.backupArchiveStore    = backupArchiveStore;
            this.clock = clock;
            this.eventDataFormatter = eventDataFormatter;
            this.eventStore         = eventStore;
            this.serviceProvider    = serviceProvider;
            this.state        = state;
            this.userResolver = userResolver;

            this.log = log;
        }
Beispiel #7
0
        public BackupGrain(
            IAssetStore assetStore,
            IBackupArchiveLocation backupArchiveLocation,
            IClock clock,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            IEnumerable <BackupHandler> handlers,
            IJsonSerializer serializer,
            ISemanticLog log,
            IStore <Guid> store)
        {
            Guard.NotNull(assetStore, nameof(assetStore));
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(handlers, nameof(handlers));
            Guard.NotNull(serializer, nameof(serializer));
            Guard.NotNull(store, nameof(store));
            Guard.NotNull(log, nameof(log));

            this.assetStore            = assetStore;
            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.handlers           = handlers;
            this.serializer         = serializer;
            this.store              = store;
            this.log = log;
        }
        public RuleRunnerGrain(
            IGrainState <State> state,
            IAppProvider appProvider,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            IRuleEventRepository ruleEventRepository,
            RuleService ruleService,
            ISemanticLog log)
        {
            Guard.NotNull(state, nameof(state));
            Guard.NotNull(appProvider, nameof(appProvider));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(ruleEventRepository, nameof(ruleEventRepository));
            Guard.NotNull(ruleService, nameof(ruleService));
            Guard.NotNull(log, nameof(log));

            this.state               = state;
            this.appProvider         = appProvider;
            this.eventStore          = eventStore;
            this.eventDataFormatter  = eventDataFormatter;
            this.ruleEventRepository = ruleEventRepository;
            this.ruleService         = ruleService;
            this.log = log;
        }
        public MongoParallelInsertTests(MongoEventStoreReplicaSetFixture fixture)
        {
            _ = fixture;

            var typeNameRegistry = new TypeNameRegistry().Map(typeof(MyEvent), "My");

            eventDataFormatter = new DefaultEventDataFormatter(typeNameRegistry, JsonHelper.DefaultSerializer);
        }
 public CreateAppSettings(ICommandBus commandBus,
                          IEventDataFormatter eventDataFormatter,
                          IEventStore eventStore)
 {
     this.commandBus         = commandBus;
     this.eventDataFormatter = eventDataFormatter;
     this.eventStore         = eventStore;
 }
Beispiel #11
0
        public CommentsGrain(IEventStore eventStore, IEventDataFormatter eventDataFormatter)
        {
            Guard.NotNull(eventStore);
            Guard.NotNull(eventDataFormatter);

            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
        }
Beispiel #12
0
 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)
 {
 }
Beispiel #13
0
        public BackupReaderWriterTests()
        {
            typeNameRegistry.Map(typeof(MyEvent));

            formatter = new DefaultEventDataFormatter(typeNameRegistry, serializer);

            A.CallTo(() => streamNameResolver.WithNewId(A <string> ._, A <Func <string, string> > ._))
            .ReturnsLazily(new Func <string, Func <string, string>, string>((stream, idGenerator) => stream + "^2"));
        }
Beispiel #14
0
 public RebuildFiles(
     IAssetFileStore assetFileStore,
     IEventStore eventStore,
     IEventDataFormatter eventDataFormatter)
 {
     this.assetFileStore     = assetFileStore;
     this.eventStore         = eventStore;
     this.eventDataFormatter = eventDataFormatter;
 }
 public MyEventConsumerGrain(
     EventConsumerFactory eventConsumerFactory,
     IStore <string> store,
     IEventStore eventStore,
     IEventDataFormatter eventDataFormatter,
     ISemanticLog log)
     : base(eventConsumerFactory, store, eventStore, eventDataFormatter, log)
 {
 }
 public MyEventConsumerGrain(
     EventConsumerFactory eventConsumerFactory,
     IGrainState <EventConsumerState> state,
     IEventStore eventStore,
     IEventDataFormatter eventDataFormatter,
     ILogger <EventConsumerGrain> log)
     : base(eventConsumerFactory, state, eventStore, eventDataFormatter, log)
 {
 }
Beispiel #17
0
 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 DefaultRuleRunnerService(IGrainFactory grainFactory,
                                 IEventStore eventStore,
                                 IEventDataFormatter eventDataFormatter,
                                 IRuleService ruleService)
 {
     this.grainFactory       = grainFactory;
     this.eventDataFormatter = eventDataFormatter;
     this.eventStore         = eventStore;
     this.ruleService        = ruleService;
 }
Beispiel #19
0
 public PopulateGrainIndexes(IAppsIndex indexApps, IRulesIndex indexRules, ISchemasIndex indexSchemas,
                             IEventDataFormatter eventDataFormatter,
                             IEventStore eventStore)
 {
     this.indexApps          = indexApps;
     this.indexRules         = indexRules;
     this.indexSchemas       = indexSchemas;
     this.eventDataFormatter = eventDataFormatter;
     this.eventStore         = eventStore;
 }
Beispiel #20
0
 public Store(
     ISnapshotStore <T> snapshotStore,
     IEventStore eventStore,
     IEventDataFormatter eventDataFormatter,
     IStreamNameResolver streamNameResolver)
 {
     this.snapshotStore      = snapshotStore;
     this.eventStore         = eventStore;
     this.eventDataFormatter = eventDataFormatter;
     this.streamNameResolver = streamNameResolver;
 }
 public Migration01_FromCqrs(
     FieldRegistry fieldRegistry,
     IEventDataFormatter eventDataFormatter,
     IEventStore eventStore,
     IStateFactory stateFactory)
 {
     this.fieldRegistry      = fieldRegistry;
     this.eventDataFormatter = eventDataFormatter;
     this.eventStore         = eventStore;
     this.stateFactory       = stateFactory;
 }
Beispiel #22
0
 public Store(
     IEventStore eventStore,
     IEventDataFormatter eventDataFormatter,
     IServiceProvider services,
     IStreamNameResolver streamNameResolver)
 {
     this.eventStore         = eventStore;
     this.eventDataFormatter = eventDataFormatter;
     this.services           = services;
     this.streamNameResolver = streamNameResolver;
 }
Beispiel #23
0
 public Rebuilder(
     FieldRegistry fieldRegistry,
     IEventDataFormatter eventDataFormatter,
     IEventStore eventStore,
     ISnapshotStore <ContentState, Guid> snapshotContentStore,
     IStateFactory stateFactory)
 {
     this.fieldRegistry        = fieldRegistry;
     this.eventDataFormatter   = eventDataFormatter;
     this.eventStore           = eventStore;
     this.snapshotContentStore = snapshotContentStore;
     this.stateFactory         = stateFactory;
 }
Beispiel #24
0
        public RebuildFiles(
            IAssetFileStore assetFileStore,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter)
        {
            Guard.NotNull(assetFileStore, nameof(assetFileStore));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));

            this.assetFileStore     = assetFileStore;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
        }
        public EventConsumerGrain(
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            ISemanticLog log)
        {
            Guard.NotNull(log, nameof(log));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));

            this.log = log;

            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
        }
Beispiel #26
0
 public Store(
     IEventStore eventStore,
     IEventDataFormatter eventDataFormatter,
     IServiceProvider services,
     IStreamNameResolver streamNameResolver,
     Action invalidate = null,
     Action failed     = null)
 {
     this.eventStore         = eventStore;
     this.eventDataFormatter = eventDataFormatter;
     this.failed             = failed;
     this.invalidate         = invalidate;
     this.services           = services;
     this.streamNameResolver = streamNameResolver;
 }
Beispiel #27
0
        public DefaultRuleRunnerService(IGrainFactory grainFactory,
                                        IEventStore eventStore,
                                        IEventDataFormatter eventDataFormatter,
                                        IRuleService ruleService)
        {
            Guard.NotNull(grainFactory, nameof(grainFactory));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(ruleService, nameof(ruleService));

            this.grainFactory       = grainFactory;
            this.eventDataFormatter = eventDataFormatter;
            this.eventStore         = eventStore;
            this.ruleService        = ruleService;
        }
Beispiel #28
0
        public Store(
            ISnapshotStore <T> snapshotStore,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            IStreamNameResolver streamNameResolver)
        {
            Guard.NotNull(snapshotStore, nameof(snapshotStore));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(streamNameResolver, nameof(streamNameResolver));

            this.snapshotStore      = snapshotStore;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.streamNameResolver = streamNameResolver;
        }
Beispiel #29
0
        public Store(
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            IServiceProvider services,
            IStreamNameResolver streamNameResolver)
        {
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(services, nameof(services));
            Guard.NotNull(streamNameResolver, nameof(streamNameResolver));

            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.services           = services;
            this.streamNameResolver = streamNameResolver;
        }
Beispiel #30
0
 public Persistence(TKey ownerKey,
                    IEventStore eventStore,
                    IEventDataFormatter eventDataFormatter,
                    ISnapshotStore <TSnapshot, TKey> snapshotStore,
                    IStreamNameResolver streamNameResolver,
                    PersistenceMode persistenceMode,
                    Func <TSnapshot, Task> applyState,
                    Func <Envelope <IEvent>, Task> applyEvent)
 {
     this.ownerKey           = ownerKey;
     this.applyState         = applyState;
     this.applyEvent         = applyEvent;
     this.eventStore         = eventStore;
     this.eventDataFormatter = eventDataFormatter;
     this.persistenceMode    = persistenceMode;
     this.snapshotStore      = snapshotStore;
     this.streamNameResolver = streamNameResolver;
 }