Exemplo n.º 1
0
 public NHibernateSessionFactory(IPersistenceConfiguration persistenceConfiguration, INHibernatePersistenceModel nHibernatePersistenceModel)
 {
     _sessionFactory = Fluently.Configure()
                       .Database(persistenceConfiguration.GetConfiguration())
                       .Mappings(m => m.AutoMappings.Add(nHibernatePersistenceModel.GetPersistenceModel()))
                       .BuildSessionFactory();
 }
Exemplo n.º 2
0
 public NHibernateSessionFactory(IPersistenceConfiguration persistenceConfiguration,
                                 INHibernatePersistenceModel persistenceModel)
 {
     _persistenceConfiguration = persistenceConfiguration;
     _persistenceModel         = persistenceModel;
     Initializers = new INHibernateInitializationAware[] { };
 }
 public NHibernateSessionFactory(IPersistenceConfiguration persistenceConfiguration,
     INHibernatePersistenceModel persistenceModel)
 {
     _persistenceConfiguration = persistenceConfiguration;
     _persistenceModel = persistenceModel;
     Initializers = new INHibernateInitializationAware[] { };
 }
Exemplo n.º 4
0
        public CqlStorage(PersistenceCqlDataContext dataContext, IPersistenceConfiguration configuration, IReporter reporter)
        {
            _dataContext         = dataContext;
            _peerStateRepository = new PeerStateRepository(dataContext);
            _configuration       = configuration;
            _reporter            = reporter;

            _preparedStatement = dataContext.Session.Prepare(dataContext.PersistentMessages.Insert(new PersistentMessage()).SetTTL(0).SetTimestamp(default(DateTimeOffset)).ToString());
        }
Exemplo n.º 5
0
 public InMemoryMessageMatcher(IPersistenceConfiguration persistenceConfiguration, IStorage storage, IBus bus)
 {
     _persistenceConfiguration = persistenceConfiguration;
     _storage      = storage;
     _bus          = bus;
     _workerThread = new Thread(ThreadProc)
     {
         Name = "InMemoryMessageMatcher.ThreadProc"
     };
 }
Exemplo n.º 6
0
 public MessageReplayerRepository(IPersistenceConfiguration persistenceConfiguration, IStorage storage, IBus bus, ITransport transport,
                                  IInMemoryMessageMatcher inMemoryMessageMatcher, IReporter speedReporter)
 {
     _persistenceConfiguration = persistenceConfiguration;
     _storage   = storage;
     _bus       = bus;
     _transport = transport;
     _inMemoryMessageMatcher = inMemoryMessageMatcher;
     _speedReporter          = speedReporter;
 }
Exemplo n.º 7
0
 public EventPersister(IPersistenceConfiguration configuration,
     IDataExtractor dataExtractor,
     IErrorDefinitionWriter errorDefinitionWriter,
     ITimelineWriter timelineWriter)
 {
     _configuration = configuration;
     _dataExtractor = dataExtractor;
     _errorDefinitionWriter = errorDefinitionWriter;
     _timelineWriter = timelineWriter;
 }
Exemplo n.º 8
0
        public CqlStorage(PersistenceCqlDataContext dataContext, IPeerStateRepository peerStateRepository, IPersistenceConfiguration configuration, IReporter reporter)
        {
            _dataContext         = dataContext;
            _peerStateRepository = peerStateRepository;
            _configuration       = configuration;
            _reporter            = reporter;

            _preparedStatement = dataContext.Session.Prepare(dataContext.PersistentMessages.Insert(new PersistentMessage()).SetTTL(0).SetTimestamp(default(DateTimeOffset)).ToString());
            _parallelPersistor = new ParallelPersistor(dataContext.Session, 64, ex => _log.Warn("Exception caught while trying to persist message", ex));
        }
        public void CtorShouldFail()
        {
            // Arrange
            IPersistenceConfiguration persistenceConfiguration = null;

            // Act
            Action ctor = () => { new PersistenceContext(persistenceConfiguration); };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
Exemplo n.º 10
0
        public MessageReplayer(IPersistenceConfiguration persistenceConfiguration, IStorage storage, IBus bus, ITransport transport,
                               IInMemoryMessageMatcher inMemoryMessageMatcher, Peer peer, Guid replayId, IReporter reporter)
        {
            _persistenceConfiguration = persistenceConfiguration;
            _storage   = storage;
            _bus       = bus;
            _transport = transport;
            _inMemoryMessageMatcher = inMemoryMessageMatcher;
            _self            = new Peer(transport.PeerId, transport.InboundEndPoint);
            _peer            = peer;
            _replayId        = replayId;
            _reporter        = reporter;
            _replayBatchSize = _persistenceConfiguration.ReplayBatchSize;

            UnackedMessageCountThatReleasesNextBatch = _persistenceConfiguration.ReplayUnackedMessageCountThatReleasesNextBatch;
        }
Exemplo n.º 11
0
        public DataExtractor(IPersistenceConfiguration configuration,
            IFingerprintReader fingerprintReader,
            IServerReader serverReader,
            IServerWriter serverWriter)
        {
            _configuration = configuration;
            _fingerprintReader = fingerprintReader;
            _serverReader = serverReader;
            _serverWriter = serverWriter;
            
            _lastLoadedFingerprints = new DateTime(2000, 1, 1);
            _fingerprintTimes = new Dictionary<string, DateTime>();
            _fingerprints = new HashSet<string>();

            LoadServers();
            LoadLatestFingerprints();
        }
Exemplo n.º 12
0
        public DataContext(IPersistenceConfiguration persistenceConfiguration)
        {
            if (persistenceConfiguration == null)
            {
                throw new ArgumentNullException(nameof(persistenceConfiguration));
            }

            MongoClientSettings settings = MongoClientSettings.FromUrl(
                new MongoUrl(persistenceConfiguration.ConnectionString)
                );

            settings.SslSettings = new SslSettings()
            {
                EnabledSslProtocols = SslProtocols.Tls12
            };
            MongoClient client = new MongoClient(settings);

            var databaseName = "Brix-EccSetup";

            Database = client.GetDatabase(databaseName);
        }
Exemplo n.º 13
0
 public RefreshDatabase(IAppSettings appSettings, IPersistenceConfiguration persistenceConfiguration)
 {
     this.appSettings = appSettings;
     this.persistenceConfiguration = persistenceConfiguration;
 }
Exemplo n.º 14
0
 public ErrorDefinitionWriter(IPersistenceConfiguration configuration)
     : base(configuration)
 { }
Exemplo n.º 15
0
 public PersistenceContext(IPersistenceConfiguration persistenceConfiguration) : base(persistenceConfiguration)
 {
 }
Exemplo n.º 16
0
 public BabyRepository(IPersistenceConfiguration configuration)
 {
     _connectionString = configuration.ConnectionString;
 }
Exemplo n.º 17
0
 public ServerWriter(IPersistenceConfiguration configuration)
 {
     _configuration = configuration;
 }
        public IPersisterDaemon BuildDefaultPersisterDaemon(IStreamIngestorConfiguration streamIngestorConfiguration = null, 
            IPersistenceConfiguration persistenceConfiguration = null)
        {
            if(streamIngestorConfiguration == null)
                streamIngestorConfiguration = new StreamIngestorConfiguration();

            if(persistenceConfiguration == null)
                persistenceConfiguration = new PersistenceConfiguration();

            var eventPersister = new EventPersister(persistenceConfiguration,
                new DataExtractor(persistenceConfiguration,
                    new FingerprintReader(persistenceConfiguration),
                    new ServerReader(persistenceConfiguration),
                    new ServerWriter(persistenceConfiguration)),
                new ErrorDefinitionWriter(persistenceConfiguration),
                new TimelineWriter(persistenceConfiguration));

            if (_eventDiscarder == null)
                _eventDiscarder = new NullEventDiscarder();

            return new PersisterDaemon(streamIngestorConfiguration, eventPersister, _eventDiscarder);
        }
Exemplo n.º 19
0
 public PersistenceContext(IPersistenceConfiguration persistenceConfiguration)
 {
     _persistenceConfiguration = persistenceConfiguration ?? throw new ArgumentNullException(nameof(persistenceConfiguration));
 }
Exemplo n.º 20
0
 public BulkLoadService(IPersistenceConfiguration configuration)
 {
     _configuration = configuration;
 }
Exemplo n.º 21
0
 public TimelineWriter(IPersistenceConfiguration configuration)
     : base(configuration)
 { }
 public MessageReplayerInitializer(IPersistenceConfiguration configuration, IMessageReplayerRepository messageReplayerRepository)
 {
     _messageReplayerRepository = messageReplayerRepository;
     _waitTimeout = configuration.SafetyPhaseDuration + 30.Seconds();
 }
Exemplo n.º 23
0
        public PersistenceContext(IPersistenceConfiguration persistenceConfiguration)
        {
            Guard.On(persistenceConfiguration, Error.ArgumentNull(nameof(persistenceConfiguration))).AgainstNull();

            _persistenceConfiguration = persistenceConfiguration ?? throw new ArgumentNullException(nameof(persistenceConfiguration));
        }
Exemplo n.º 24
0
 public FingerprintReader(IPersistenceConfiguration configuration)
 {
     _configuration = configuration;
 }
Exemplo n.º 25
0
 public PersistenceContext(IPersistenceConfiguration persistenceConfiguration)
 {
     _persistenceConfiguration = persistenceConfiguration ?? throw Error.ArgumentNull(nameof(persistenceConfiguration));
 }
Exemplo n.º 26
0
 public HibernateSessionFactory(IPersistenceConfiguration persistenceConfiguration, IHibernatePersistenceModel persistenceModel)
 {
     _persistenceConfiguration = persistenceConfiguration;
     _persistenceModel         = persistenceModel;
 }
Exemplo n.º 27
0
 public QueueingTransport(ITransport transport, IPeerDirectory peerDirectory, IPersistenceConfiguration configuration)
 {
     _transport     = transport;
     _peerDirectory = peerDirectory;
     _configuration = configuration;
 }
Exemplo n.º 28
0
 public NHibernateSessionFactory(IPersistenceConfiguration persistenceConfiguration, INHibernatePersistenceModel persistenceModel)
 {
     _persistenceConfiguration = persistenceConfiguration;
     _persistenceModel = persistenceModel;
 }
Exemplo n.º 29
0
 public PersistMessageCommandHandler(IMessageReplayerRepository messageReplayerRepository, IInMemoryMessageMatcher inMemoryMessageMatcher, IPersistenceConfiguration configuration)
 {
     _messageReplayerRepository = messageReplayerRepository;
     _inMemoryMessageMatcher    = inMemoryMessageMatcher;
     _configuration             = configuration;
 }