示例#1
0
 public DocumentAppService(
     IProjectRepository projectRepository,
     IDocumentStoreFactory documentStoreFactory)
 {
     _projectRepository    = projectRepository;
     _documentStoreFactory = documentStoreFactory;
 }
示例#2
0
 /// <summary>
 /// Create SubscriptionService and configure it from configuration file.
 /// </summary>
 /// <param name="subscriptionStoreFactory"></param>
 public SubscriptionService(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager)
 {
     Initialize(subscriptionStoreFactory, routeManager, MessageBusSettings.Settings.InputQueue);
     foreach (MessageBusSettings.MessageRoute route in MessageBusSettings.Settings.Routes)
     {
         RouteManager.AddRoute(route.Messages, route.Destination);
     }
 }
 /// <summary>
 /// 构造函数
 ///</summary>
 public ProjectAppService(
     IRepository <Project, Guid> entityRepository
     , IProjectManager entityManager, ICacheManager cacheManager, IDocumentStoreFactory documentStoreFactory)
 {
     _projectRepository    = entityRepository;
     _projectManager       = entityManager;
     _cacheManager         = cacheManager;
     _documentStoreFactory = documentStoreFactory;
 }
示例#4
0
        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);
        }
示例#5
0
 public DocumentAppService(
     IProjectRepository projectRepository,
     IDistributedCache <List <string> > distributedCache,
     IDocumentStoreFactory documentStoreFactory)
 {
     _projectRepository    = projectRepository;
     _distributedCache     = distributedCache;
     _documentStoreFactory = documentStoreFactory;
 }
示例#6
0
 protected void Initialize(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager, QueueName inputQueueName)
 {
     Condition.Requires(subscriptionStoreFactory, "subscriptionStoreFactory").IsNotNull();
     Condition.Requires(inputQueueName, "inputQueueName").IsNotNull();
     Condition.Requires(routeManager, "routeManager").IsNotNull();
     RouteManager   = routeManager;
     Subscriptions  = subscriptionStoreFactory.Create <Type, SubscriptionRegistration>();
     InputQueueName = inputQueueName;
 }
示例#7
0
        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);
        }
示例#8
0
 public ProjectAppService(
     IProjectRepository projectRepository,
     IDistributedCache <List <VersionInfo> > versionCache,
     IDocumentStoreFactory documentStoreFactory)
 {
     _projectRepository    = projectRepository;
     _versionCache         = versionCache;
     _documentStoreFactory = documentStoreFactory;
 }
示例#9
0
        public EventStoreHost(IEventStore store, IEventPublisher publisher, IDocumentStoreFactory documentStoreFactory)
        {
            Condition.Requires(store, "store").IsNotNull();
            Condition.Requires(publisher, "publisher").IsNotNull();

            EventStore           = store;
            EventPublisher       = publisher;
            DocumentStoreFactory = documentStoreFactory;
            EventStorePublisher  = new EventStorePublisher(store, publisher, documentStoreFactory);
        }
示例#10
0
        public static IDocumentStoreFactory GetSubscriptionStore(AbstractConfiguration cfg)
        {
            IDocumentStoreFactory store = cfg.Get <IDocumentStoreFactory>(SubscriptionStoreFactory_SettingsKey);

            if (store == null)
            {
                throw new InvalidOperationException(string.Format("No message bus subscription store has been configured."));
            }
            return(store);
        }
示例#11
0
 public DocumentAppService(
     IRepository <Project, Guid> projectRepository,
     IDocumentStoreFactory documentStoreFactory,
     ICacheManager cacheManager
     )
 {
     _projectRepository    = projectRepository;
     _documentStoreFactory = documentStoreFactory;
     _cacheManager         = cacheManager;
 }
示例#12
0
        public EventStoreHost(IEventStore store, IEventPublisher publisher, IDocumentStoreFactory documentStoreFactory)
        {
            Condition.Requires(store, "store").IsNotNull();
              Condition.Requires(publisher, "publisher").IsNotNull();

              EventStore = store;
              EventPublisher = publisher;
              DocumentStoreFactory = documentStoreFactory;
              EventStorePublisher = new EventStorePublisher(store, publisher, documentStoreFactory);
        }
        public static IDocumentStoreFactory GetDocumentStoreFactory(AbstractConfiguration cfg)
        {
            IDocumentStoreFactory docStoreFactory = cfg.Get <IDocumentStoreFactory>(DocumentStoreFactory_SettingsKey);

            if (docStoreFactory == null)
            {
                throw new InvalidOperationException("Missing document store factory for event store.");
            }
            return(docStoreFactory);
        }
示例#14
0
 public DocumentAppService(
     IProjectRepository projectRepository,
     IDocumentStoreFactory documentStoreFactory,
     IDistributedCache <DocumentWithDetailsDto> documentCache,
     IDistributedCache <DocumentResourceDto> resourceCache)
 {
     _projectRepository    = projectRepository;
     _documentStoreFactory = documentStoreFactory;
     DocumentCache         = documentCache;
     ResourceCache         = resourceCache;
 }
示例#15
0
        public PrintPersonDetailsViewModel(IDocumentStoreFactory documentStoreFactory, IMessageDialogService messageDialogService)
        {
            _documentStoreFactory = documentStoreFactory;
            _messageDialogService = messageDialogService;

            AddSelectedToSelectedPersonsCommand      = new RelayCommand(AddSelectedToSelectedPersons, CanAddSelectedToSelectedPersons);
            RemoveSelectedFromSelectedPersonsCommand = new RelayCommand(RemoveSelectedFromSelectedPersons, CanRemoveSelectedFromSelectedPersons);
            PrintPersonDetailCommand = new RelayCommand(PrintPersonDetail);
            SelectedPersons          = new ObservableCollection <PersonViewModel>();

            InitializePersons();
        }
示例#16
0
 public RaventEventStorage(IDocumentStoreFactory storeFactory, IBus eventBus)
 {
     _documentStore = storeFactory.BuildStore;
     using (var session = _documentStore.OpenSession())
     {
         foreach (var @event in GetAllEvents(session)
                  //.OrderByDescending(x => (x as Event).Date)
                  )
         {
             eventBus.Raise(@event);
         }
     }
 }
示例#17
0
        private static EventStoreHost BuildEventStoreHost(BaseConfiguration cfg, IMessageBus messageBus)
        {
            IEventPublisher eventPublisher = EventStoreConfigurationExtensions.GetEventPublisher(cfg, false);

            if (eventPublisher == null)
            {
                eventPublisher = new MessageBusEventPublisher(messageBus);
            }
            IDocumentStoreFactory docStoreFactory = EventStoreConfigurationExtensions.GetDocumentStoreFactory(cfg);
            EventStoreDB          eStore          = EventStoreConfigurationExtensions.GetEventStoreDB(cfg);

            EventStoreHost host = new EventStoreHost(eStore, eventPublisher, docStoreFactory);

            return(host);
        }
示例#18
0
        public KindManager(IResourceDocumentStore <Kind> documentStore,
                           IDocumentStoreFactory documentStoreFactory,
                           ResourceManagerContainer resourceManagerAccessor,
                           ResourceManagerContainer resourceManagers) :
            base(documentStore, resourceManagers)
        {
            _documentStoreFactory    = documentStoreFactory;
            _resourceManagerAccessor = resourceManagerAccessor;
            _resourceManagers        = resourceManagers;

            AddResource(CoreKinds.Kind);
            AddResource(CoreKinds.Host);
            AddResource(CoreKinds.Controller);
            AddResource(CoreKinds.Device);
        }
示例#19
0
 public DocumentAppService(
     IProjectRepository projectRepository,
     IDocumentStoreFactory documentStoreFactory,
     IDistributedCache <DocumentWithDetailsDto> documentCache,
     IDistributedCache <LanguageConfig> languageCache,
     IDistributedCache <DocumentResourceDto> resourceCache,
     IHostEnvironment hostEnvironment)
 {
     _projectRepository    = projectRepository;
     _documentStoreFactory = documentStoreFactory;
     DocumentCache         = documentCache;
     LanguageCache         = languageCache;
     ResourceCache         = resourceCache;
     HostEnvironment       = hostEnvironment;
 }
示例#20
0
        public PersonViewModel(IMessageDialogService messageDialogService, IDocumentStoreFactory documentStoreFactory, Person person, IChangeListener parent)
        {
            if (person == null)
            {
                person = new Person();
            }

            _documentStoreFactory = documentStoreFactory;
            _messageDialogService = messageDialogService;
            _person = person;
            _parent = parent;

            CopyFromEntity(person);

            AddDocumentCommand     = new RelayCommand(AddDocument, CanAddDocument);
            RemoveDocumentsCommand = new RelayCommand(RemoveDocuments, CanRemoveDocuments);
        }
示例#21
0
        /// <summary>
        /// No more configuration needed for message bus - now configure something else or start the bus.
        /// </summary>
        /// <param name="cfg"></param>
        /// <returns></returns>
        public static BaseConfiguration Done(this MessageBusConfiguration cfg)
        {
            IObjectContainer      container = ObjectContainerConfigurationExtensions.GetObjectContainer(cfg);
            IDocumentStoreFactory subscriptionStoreFactory = GetSubscriptionStore(cfg);

            if (!container.HasComponent(typeof(IRouteManager)))
            {
                container.AddComponent <IRouteManager, RouteManager>();
            }
            IRouteManager routeManager = container.Resolve <IRouteManager>();

            ISubscriptionService subscriptionService = new SubscriptionService(subscriptionStoreFactory, routeManager);

            cfg.Set(SubscriptionService_SettingsKey, subscriptionService);
            container.RegisterInstance <ISubscriptionService>(subscriptionService);

            return(new BaseConfiguration(cfg));
        }
示例#22
0
        public MainViewModel(IDocumentStoreFactory documentStoreFactory, IDispatcher dispatcher, IMessageDialogService messageDialogService, IExcelImportService excelImportService, IExcelExportService excelExportService)
        {
            _documentStoreFactory = documentStoreFactory;
            _dispatcher           = dispatcher;
            _messageDialogService = messageDialogService;
            _excelImportService   = excelImportService;
            _excelExportService   = excelExportService;

            NewCommand               = new RelayCommand(CreateNewPerson);
            SaveCommand              = new RelayCommand(SaveSelectedPerson, CanSaveSelectedPerson);
            DeleteCommand            = new RelayCommand(DeleteSelectedPerson, CanDeleteSelectedPerson);
            RevertCommand            = new RelayCommand(RevertChanges, CanRevertChanges);
            ImportCommand            = new RelayCommand(ImportPersons);
            ExportCommand            = new RelayCommand(ExportPersons);
            PrintPersonDetailCommand = new RelayCommand(PrintPersonDetail);
            ToggleFilter             = new RelayCommand(TogglePersonsFilter, CanTogglePersonsFilter);

            InitializePersons();
        }
        public CqrsDocumentStoreFactory(
            IAddDocumenStoreFromParameters storeAdder,
            IDocumentStoreFactory documentStoreFactory,
            ICqrsDocumentStoreFactoryInitializer initializer = null)
        {
            this.documentStoreFactory = documentStoreFactory;
            storeAdder.AddStore(
                new DocumentStoreParameters
            {
                DatabaseName    = "EventStore",
                FindTypeTagName = type => typeof(AbstractEvent).Name,
                TransformTypeTagNameToDocumentKeyPrefix = s => null
            });

            IndexCreation.CreateIndexes(typeof(AbstractEvent_EventSourcedIdAndVersion).Assembly, this.EventStore);

            storeAdder.AddStore(new DocumentStoreParameters
            {
                DatabaseName = "ReadModel",
                FindIdentityPropertyNameFromEntityName = n => n + "Id",
            });

            storeAdder.AddStore(new DocumentStoreParameters
            {
                DatabaseName = "SagaStore",
                FindIdentityPropertyNameFromEntityName = n => "CorrelationId"
            });

            if (initializer == null)
            {
                return;
            }

            initializer.SetDocumentStoreFactory(this);
            initializer.Initialize();
        }
示例#24
0
 public TwitterDocumentStore(IDocumentStoreFactory documentStoreFactory)
 {
     _documentStore = documentStoreFactory.CreateDocumentStore();
 }
 public DocumentStoreAdapter(IDocumentStoreFactory factory)
 {
     _factory = factory;
 }
 public AccessTokenDocumentStore(IDocumentStoreFactory documentStoreFactory)
 {
     _documentStore = documentStoreFactory.GetDocumentStore();
 }
示例#27
0
 public ExcelImportService(IDocumentStoreFactory documentStoreFactory)
 {
     _documentStoreFactory = documentStoreFactory;
 }
示例#28
0
 /// <summary>
 /// Create SubscriptionService with empty message routing and supplied input queue name.
 /// </summary>
 /// <param name="subscriptionStoreFactory"></param>
 /// <param name="inputQueueName"></param>
 public SubscriptionService(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager, QueueName inputQueueName)
 {
     Initialize(subscriptionStoreFactory, routeManager, inputQueueName);
 }
示例#29
0
 public DocumentRepository(IDocumentStoreFactory factory)
 {
     Condition.Requires(factory, "factory").IsNotNull();
     Factory = factory;
 }
示例#30
0
 /// <summary>
 /// Create SubscriptionService with empty message routing and supplied input queue name.
 /// </summary>
 /// <param name="subscriptionStoreFactory"></param>
 /// <param name="inputQueueName"></param>
 public SubscriptionService(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager, QueueName inputQueueName)
 {
     Initialize(subscriptionStoreFactory, routeManager, inputQueueName);
 }
示例#31
0
 /// <summary>
 /// Create SubscriptionService and configure it from configuration file.
 /// </summary>
 /// <param name="subscriptionStoreFactory"></param>
 public SubscriptionService(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager)
 {
     Initialize(subscriptionStoreFactory, routeManager, MessageBusSettings.Settings.InputQueue);
       foreach (MessageBusSettings.MessageRoute route in MessageBusSettings.Settings.Routes)
     RouteManager.AddRoute(route.Messages, route.Destination);
 }
示例#32
0
 public TwitterDocumentStore(IDocumentStoreFactory documentStoreFactory)
 {
     _documentStore = documentStoreFactory.GetDocumentStore();
 }
 public DocumentStoreFactory_Tests()
 {
     _documentStoreFactory = GetRequiredService <IDocumentStoreFactory>();
 }
示例#34
0
 protected void Initialize(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager, QueueName inputQueueName)
 {
     Condition.Requires(subscriptionStoreFactory, "subscriptionStoreFactory").IsNotNull();
       Condition.Requires(inputQueueName, "inputQueueName").IsNotNull();
       Condition.Requires(routeManager, "routeManager").IsNotNull();
       RouteManager = routeManager;
       Subscriptions = subscriptionStoreFactory.Create<Type, SubscriptionRegistration>();
       InputQueueName = inputQueueName;
 }
示例#35
0
 public ReadOnlyRavenEventStorage(IDocumentStoreFactory storeFactory, IBus eventBus) : base(storeFactory, eventBus)
 {
 }
示例#36
0
 public GithubDocumentStore_Tests()
 {
     _documentStoreFactory = GetRequiredService <IDocumentStoreFactory>();
     _projectRepository    = GetRequiredService <IProjectRepository>();
     _testData             = GetRequiredService <DocsTestData>();
 }
示例#37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TaskRepository"/> class.
 /// </summary>
 /// <param name="documentStore">The documentStore.</param>
 public TaskRepository(IDocumentStoreFactory documentStore)
 {
     this._documentStore = documentStore;
 }
 public CategoriesController(IDocumentStoreFactory storeFactory)
 {
     this.storeFactory = storeFactory;
 }
 public SuppliersController(IDocumentStoreFactory storeFactory)
 {
     this.storeFactory = storeFactory;
 }