示例#1
0
        public ProjectionRepository(CronusContext context, IProjectionStore projectionStore, ISnapshotStore snapshotStore, ISnapshotStrategy snapshotStrategy, InMemoryProjectionVersionStore inMemoryVersionStore, IHandlerFactory handlerFactory, ProjectionHasher projectionHasher)
        {
            if (context is null)
            {
                throw new ArgumentException(nameof(context));
            }
            if (projectionStore is null)
            {
                throw new ArgumentException(nameof(projectionStore));
            }
            if (snapshotStore is null)
            {
                throw new ArgumentException(nameof(snapshotStore));
            }
            if (snapshotStrategy is null)
            {
                throw new ArgumentException(nameof(snapshotStrategy));
            }
            if (inMemoryVersionStore is null)
            {
                throw new ArgumentException(nameof(inMemoryVersionStore));
            }

            this.context              = context;
            this.projectionStore      = projectionStore;
            this.snapshotStore        = snapshotStore;
            this.snapshotStrategy     = snapshotStrategy;
            this.inMemoryVersionStore = inMemoryVersionStore;
            this.handlerFactory       = handlerFactory;
            this.projectionHasher     = projectionHasher;
        }
示例#2
0
 public EventStoreIndexController(CronusContext context, TypeContainer <IEventStoreIndex> endicesTypes, IPublisher <ICommand> publisher, ProjectionExplorer projection)
 {
     this.context      = context;
     this.endicesTypes = endicesTypes;
     this.publisher    = publisher;
     this.projection   = projection;
 }
示例#3
0
 public ProjectionVersionHelper(CronusContext context, IProjectionReader projectionReader, IInitializableProjectionStore projectionVersionInitializer, ProjectionHasher projectionHasher, ILogger <ProjectionVersionHelper> logger)
 {
     this.context                      = context;
     this.projectionReader             = projectionReader;
     this.projectionVersionInitializer = projectionVersionInitializer;
     this.projectionHasher             = projectionHasher;
     this.logger = logger;
 }
示例#4
0
 public ProgressTracker(IMessageCounter messageCounter, CronusContext context, IPublisher <ISignal> signalPublisher, ProjectionVersionHelper projectionVersionHelper, ILogger <ProgressTracker> logger)
 {
     tenant = context.Tenant;
     this.messageCounter          = messageCounter;
     this.signalPublisher         = signalPublisher;
     this.projectionVersionHelper = projectionVersionHelper;
     this.logger = logger;
 }
示例#5
0
 public SingletonPerTenant(SingletonPerTenantContainer <T> container, CronusContext context)
 {
     if (context is null)
     {
         throw new ArgumentNullException(nameof(context));
     }
     this.container = container;
     this.context   = context;
 }
示例#6
0
 public ProjectionPlayer(CronusContext context, IEventStore eventStore, IProjectionWriter projectionRepository, IProjectionReader projectionReader, IInitializableProjectionStore projectionStoreInitializer, EventToAggregateRootId index)
 {
     this.context                    = context;
     this.eventStore                 = eventStore;
     this.projectionWriter           = projectionRepository;
     this.projectionReader           = projectionReader;
     this.projectionStoreInitializer = projectionStoreInitializer;
     this.index = index;
 }
示例#7
0
 public RebuildIndex_MessageCounter_Job(CronusContext context, TypeContainer <IEvent> eventTypes, EventStoreFactory eventStoreFactory, IMessageCounter eventCounter, EventToAggregateRootId eventToAggregateIndex, IProjectionReader projectionReader, ILogger <RebuildIndex_MessageCounter_Job> logger) : base(logger)
 {
     this.context               = context;
     this.eventTypes            = eventTypes;
     this.eventStore            = eventStoreFactory.GetEventStore();
     this.messageCounter        = eventCounter;
     this.eventToAggregateIndex = eventToAggregateIndex;
     this.projectionReader      = projectionReader;
 }
示例#8
0
        public IndexRebuildActionsController(IPublisher <ICommand> publisher, CronusContext context)
        {
            if (publisher is null)
            {
                throw new ArgumentNullException(nameof(publisher));
            }

            _publisher   = publisher;
            this.context = context;
        }
示例#9
0
        public static IApplicationBuilder UseCronusAspNetCore(this IApplicationBuilder app)
        {
            return(app.Use((context, next) =>
            {
                var cronusContextFactory = context.RequestServices.GetRequiredService <CronusContextFactory>();
                CronusContext cronusContext = cronusContextFactory.GetContext(context, context.RequestServices);

                return next.Invoke();
            }));
        }
示例#10
0
        public ProjectionMetaController(ProjectionExplorer projectionExplorer, CronusContext context, ProjectionHasher projectionHasher)
        {
            if (projectionExplorer is null)
            {
                throw new ArgumentNullException(nameof(projectionExplorer));
            }

            _projectionExplorer   = projectionExplorer;
            this.context          = context;
            this.projectionHasher = projectionHasher;
        }
示例#11
0
 public void Bootstrap()
 {
     foreach (var tenant in tenants.GetTenants())
     {
         using (var scope = serviceProvider.CreateScope())
         {
             CronusContext context = scope.ServiceProvider.GetRequiredService <CronusContext>();
             context.Initialize(tenant, scope.ServiceProvider);
             scope.ServiceProvider.GetRequiredService <ICassandraEventStoreSchema>().CreateStorage();
         }
     }
 }
        public ProjectionCancelController(IPublisher <ICommand> publisher, CronusContext context)
        {
            if (publisher is null)
            {
                throw new ArgumentNullException(nameof(publisher));
            }
            if (context is null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _publisher   = publisher;
            this.context = context;
        }
示例#13
0
        public IndexListController(ProjectionExplorer projectionExplorer, CronusContext context, ProjectionHasher projectionHasher, TypeContainer <IEventStoreIndex> indicesMeta)
        {
            if (projectionExplorer is null)
            {
                throw new ArgumentNullException(nameof(projectionExplorer));
            }
            if (context is null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _projectionExplorer   = projectionExplorer;
            this.context          = context;
            this.projectionHasher = projectionHasher;
            this.indicesMeta      = indicesMeta;
        }
示例#14
0
        public static IApplicationBuilder UseCronusAspNetCore(this IApplicationBuilder app, Func <HttpContext, bool> shouldResolveTenant)
        {
            return(app.Use((context, next) =>
            {
                bool shouldResolve = true;
                if (shouldResolveTenant is null == false)
                {
                    shouldResolve = shouldResolveTenant(context);
                }

                if (shouldResolve)
                {
                    var cronusContextFactory = context.RequestServices.GetRequiredService <CronusContextFactory>();
                    CronusContext cronusContext = cronusContextFactory.GetContext(context, context.RequestServices);
                }

                return next.Invoke();
            }));
        }
示例#15
0
        public ProjectionExplorer(IProjectionReader projections, IProjectionStore projectionStore, CronusContext context)
        {
            if (ReferenceEquals(null, projections) == true)
            {
                throw new ArgumentNullException(nameof(projections));
            }
            if (ReferenceEquals(null, projectionStore) == true)
            {
                throw new ArgumentNullException(nameof(projectionStore));
            }
            if (ReferenceEquals(null, context) == true)
            {
                throw new ArgumentNullException(nameof(context));
            }

            this.projections     = projections;
            this.projectionStore = projectionStore;
            this.context         = context;
        }
示例#16
0
 public Projection_JobFactory(RebuildProjection_Job job, IOptions <BoundedContext> boundedContext, CronusContext context)
 {
     this.job            = job;
     this.context        = context;
     this.boundedContext = boundedContext.Value;
 }
示例#17
0
 public ReplayPublicEvents_JobFactory(ReplayPublicEvents_Job job, IOptions <BoundedContext> boundedContext, CronusContext context)
 {
     this.job            = job;
     this.context        = context;
     this.boundedContext = boundedContext.Value;
 }
示例#18
0
文件: GGPort.cs 项目: Elders/Cronus
 public GGPort(IProjectionStore projectionStore, CronusContext cronusContext, ILogger <GGPort> logger)
 {
     this.projectionStore = projectionStore;
     this.cronusContext   = cronusContext;
     this.logger          = logger;
 }
 public DefaultJobNameBuilder(IOptions <BoundedContext> boundedContext, CronusContext context)
 {
     this.boundedContext = boundedContext.Value;
     this.context        = context;
 }
示例#20
0
 public RebuildIndex_MessageCounter_JobFactory(RebuildIndex_MessageCounter_Job job, IOptions <BoundedContext> boundedContext, CronusContext context)
 {
     this.job            = job;
     this.context        = context;
     this.boundedContext = boundedContext.Value;
 }
 public KeyspacePerTenantKeyspace(CronusContext context)
 {
     this.context = context;
 }