Ejemplo n.º 1
0
 private SqlPersistenceFactory(ISerialize serializer, TransactionScopeOption scopeOption, IStreamIdHasher streamIdHasher, int pageSize)
 {
     _serializer     = serializer;
     _scopeOption    = scopeOption;
     _streamIdHasher = streamIdHasher ?? new Sha1StreamIdHasher();
     PageSize        = pageSize;
 }
Ejemplo n.º 2
0
        public SqlPersistenceEngine(
            IConnectionFactory connectionFactory,
            ISqlDialect dialect,
            ISerialize serializer,
            int pageSize,
            IStreamIdHasher streamIdHasher,
            TransactionScopeOption?scopeOption = null)
        {
            if (pageSize < 0)
            {
                throw new ArgumentException(nameof(pageSize));
            }

            if (streamIdHasher == null)
            {
                throw new ArgumentNullException(nameof(streamIdHasher));
            }

            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
            _dialect           = dialect ?? throw new ArgumentNullException(nameof(dialect));
            _serializer        = serializer ?? throw new ArgumentNullException(nameof(serializer));
            _scopeOption       = scopeOption;
            _pageSize          = pageSize;
            _streamIdHasher    = new StreamIdHasherValidator(streamIdHasher);

            Logger.LogDebug(Messages.UsingScope, _scopeOption.ToString());
        }
 private SqlPersistenceFactory(ISerialize serializer, TransactionScopeOption scopeOption,  IStreamIdHasher streamIdHasher, int pageSize)
 {
     _serializer = serializer;
     _scopeOption = scopeOption;
     _streamIdHasher = streamIdHasher ?? new Sha1StreamIdHasher();
     PageSize = pageSize;
 }
 public StreamIdHasherValidator(IStreamIdHasher streamIdHasher)
 {
     if (streamIdHasher == null)
     {
         throw new ArgumentNullException("streamIdHasher");
     }
     _streamIdHasher = streamIdHasher;
 }
 public ReactorRepository(IDbService dbService, IComponentContext container, IReactorBucketFacade reactorBucketFacade, ILogger <ReactorRepository> logger)
 {
     this.dbService           = dbService;
     this.container           = container;
     this.reactorBucketFacade = reactorBucketFacade;
     this.logger       = logger;
     this.streamHasher = new Sha1StreamIdHasher();
 }
 public virtual SqlPersistenceWireup WithStreamIdHasher(IStreamIdHasher instance)
 {
     if (Logger.IsDebugEnabled)
     {
         Logger.Debug(Messages.StreamIdHasherSpecified, instance.GetType());
     }
     Container.Register(instance);
     return(this);
 }
Ejemplo n.º 7
0
 public SqlPersistenceFactory(
     IConnectionFactory factory,
     ISerialize serializer,
     ISqlDialect dialect,
     IStreamIdHasher streamIdHasher     = null,
     TransactionScopeOption?scopeOption = null,
     int pageSize = DefaultPageSize)
     : this(serializer, scopeOption, streamIdHasher, pageSize)
 {
     ConnectionFactory = factory;
     Dialect           = dialect ?? throw new ArgumentNullException(nameof(dialect));
 }
Ejemplo n.º 8
0
        public SqlPersistenceFactory(
            IConnectionFactory factory,
            ISerialize serializer,
            ISqlDialect dialect,
            IStreamIdHasher streamIdHasher     = null,
            TransactionScopeOption scopeOption = TransactionScopeOption.Suppress,
            int pageSize = DefaultPageSize)
            : this(serializer, scopeOption, streamIdHasher, pageSize)
        {
            if (dialect == null)
            {
                throw new ArgumentNullException("dialect");
            }

            _connectionFactory = factory;
            _dialect           = dialect;
        }
        public SqlPersistenceFactory(
            IConnectionFactory factory,
            ISerialize serializer,
            ISqlDialect dialect,
            IStreamIdHasher streamIdHasher = null,
            TransactionScopeOption scopeOption = TransactionScopeOption.Suppress,
            int pageSize = DefaultPageSize)
            : this(serializer, scopeOption, streamIdHasher, pageSize)
        {
            if (dialect == null)
            {
                throw new ArgumentNullException("dialect");
            }

            _connectionFactory = factory;
            _dialect = dialect;
        }
        public SqlPersistenceEngine(
            IConnectionFactory connectionFactory,
            ISqlDialect dialect,
            ISerialize serializer,
            TransactionScopeOption scopeOption,
            int pageSize,
            IStreamIdHasher streamIdHasher)
        {
            if (connectionFactory == null)
            {
                throw new ArgumentNullException("connectionFactory");
            }

            if (dialect == null)
            {
                throw new ArgumentNullException("dialect");
            }

            if (serializer == null)
            {
                throw new ArgumentNullException("serializer");
            }

            if (pageSize < 0)
            {
                throw new ArgumentException("pageSize");
            }

            if (streamIdHasher == null)
            {
                throw new ArgumentNullException("streamIdHasher");
            }

            _connectionFactory = connectionFactory;
            _dialect           = dialect;
            _serializer        = serializer;
            _scopeOption       = scopeOption;
            _pageSize          = pageSize;
            _streamIdHasher    = new StreamIdHasherValidator(streamIdHasher);

            if (Logger.IsDebugEnabled)
            {
                Logger.Debug(Messages.UsingScope, _scopeOption.ToString());
            }
        }
 public virtual SqlPersistenceWireup WithStreamIdHasher(IStreamIdHasher instance)
 {
     Logger.Debug(Messages.StreamIdHasherSpecified, instance.GetType());
     Container.Register(instance);
     return this;
 }
Ejemplo n.º 12
0
 public StreamIdHasherValidator(IStreamIdHasher streamIdHasher)
 {
     _streamIdHasher = streamIdHasher ?? throw new ArgumentNullException(nameof(streamIdHasher));
 }