Ejemplo n.º 1
0
 private async Task SynchronizeInternalAsync(
     IInitialSyncStateCreationStrategy <Identifier, int, string, Identifier, int, string, int> strategy,
     List <IEntityRelationData <Identifier, int, Identifier, int> > matchingEntities = null)
 {
     var synchronizer = CreateSynchronizer(strategy, matchingEntities);
     await synchronizer.Synchronize(NullSynchronizationLogger.Instance, 0);
 }
Ejemplo n.º 2
0
        private Synchronizer <Identifier, int, string, Identifier, int, string, int> CreateSynchronizer(
            IInitialSyncStateCreationStrategy <Identifier, int, string, Identifier, int, string> strategy,
            List <IEntityRelationData <Identifier, int, Identifier, int> > matchingEntities = null)
        {
            var initialEntityMatcherStub = MockRepository.GenerateStub <IInitialEntityMatcher <string, Identifier, int, string, Identifier, int> >();

            initialEntityMatcherStub
            .Stub(_ => _.FindMatchingEntities(
                      Arg <IEntityRelationDataFactory <Identifier, int, Identifier, int> > .Is.NotNull,
                      Arg <IReadOnlyDictionary <Identifier, string> > .Is.NotNull,
                      Arg <IReadOnlyDictionary <Identifier, string> > .Is.NotNull,
                      Arg <IReadOnlyDictionary <Identifier, int> > .Is.NotNull,
                      Arg <IReadOnlyDictionary <Identifier, int> > .Is.NotNull))
            .Return(matchingEntities ?? new List <IEntityRelationData <Identifier, int, Identifier, int> >());

            var atypeWriteRepository = BatchEntityRepositoryAdapter.Create(_localRepository);
            var btypeWriteRepository = BatchEntityRepositoryAdapter.Create(_serverRepository);

            return(new Synchronizer <Identifier, int, string, Identifier, int, string, int> (
                       _localRepository,
                       _serverRepository,
                       atypeWriteRepository,
                       btypeWriteRepository,
                       strategy,
                       _entityRelationDataAccess,
                       _entityRelationDataFactory,
                       initialEntityMatcherStub,
                       IdentifierEqualityComparer.Instance,
                       IdentifierEqualityComparer.Instance,
                       NullTotalProgressFactory.Instance,
                       MockRepository.GenerateMock <IExceptionLogger>(),
                       NullSynchronizationContextFactory.Instance,
                       EqualityComparer <int> .Default,
                       EqualityComparer <int> .Default));
        }
Ejemplo n.º 3
0
 public Synchronizer(
     IReadOnlyEntityRepository <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TContext> atypeRepository,
     IReadOnlyEntityRepository <TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> btypeRepository,
     IBatchWriteOnlyEntityRepository <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TContext> atypeWriteRepository,
     IBatchWriteOnlyEntityRepository <TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> btypeWriteRepository,
     IInitialSyncStateCreationStrategy <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> initialSyncStateCreationStrategy,
     IEntityRelationDataAccess <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> entityRelationDataAccess,
     IEntityRelationDataFactory <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> entityRelationDataFactory,
     IInitialEntityMatcher <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> initialEntityMatcher,
     IEqualityComparer <TAtypeEntityId> atypeIdComparer, IEqualityComparer <TBtypeEntityId> btypeIdComparer,
     ITotalProgressFactory totalProgressFactory,
     IEqualityComparer <TAtypeEntityVersion> atypeVersionComparer,
     IEqualityComparer <TBtypeEntityVersion> btypeVersionComparer, IEntitySyncStateFactory <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> syncStateFactory,
     ISynchronizationInterceptorFactory <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> synchronizationInterceptorFactory = null)
 {
     _initialSyncStateCreationStrategy = initialSyncStateCreationStrategy;
     _totalProgressFactory             = totalProgressFactory;
     _atypeIdComparer      = atypeIdComparer;
     _btypeIdComparer      = btypeIdComparer;
     _atypeVersionComparer = atypeVersionComparer;
     _btypeVersionComparer = btypeVersionComparer;
     _syncStateFactory     = syncStateFactory;
     _synchronizationInterceptorFactory = synchronizationInterceptorFactory ?? NullSynchronizationInterceptorFactory <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> .Instance;
     _atypeWriteRepository      = atypeWriteRepository;
     _btypeWriteRepository      = btypeWriteRepository;
     _atypeRepository           = atypeRepository;
     _btypeRepository           = btypeRepository;
     _entityRelationDataAccess  = entityRelationDataAccess;
     _entityRelationDataFactory = entityRelationDataFactory;
     _initialEntityMatcher      = initialEntityMatcher;
 }
 public Synchronizer(
     IReadOnlyEntityRepository <TAtypeEntity, TAtypeEntityId, TAtypeEntityVersion, TContext> atypeRepository,
     IReadOnlyEntityRepository <TBtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TContext> btypeRepository,
     IBatchWriteOnlyEntityRepository <TAtypeEntity, TAtypeEntityId, TAtypeEntityVersion, TContext> atypeWriteRepository,
     IBatchWriteOnlyEntityRepository <TBtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TContext> btypeWriteRepository,
     IInitialSyncStateCreationStrategy <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> initialSyncStateCreationStrategy,
     IEntityRelationDataAccess <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> entityRelationDataAccess,
     IEntityRelationDataFactory <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> entityRelationDataFactory,
     IInitialEntityMatcher <TAtypeEntity, TAtypeEntityId, TAtypeEntityVersion, TBtypeEntity, TBtypeEntityId, TBtypeEntityVersion> initialEntityMatcher,
     IEqualityComparer <TAtypeEntityId> atypeIdComparer, IEqualityComparer <TBtypeEntityId> btypeIdComparer,
     ITotalProgressFactory totalProgressFactory,
     IExceptionLogger exceptionLogger,
     ISynchronizationContextFactory <TContext> contextFactory,
     IEqualityComparer <TAtypeEntityVersion> atypeVersionComparer,
     IEqualityComparer <TBtypeEntityVersion> btypeVersionComparer)
 {
     _initialSyncStateCreationStrategy = initialSyncStateCreationStrategy;
     _totalProgressFactory             = totalProgressFactory;
     _atypeIdComparer           = atypeIdComparer;
     _btypeIdComparer           = btypeIdComparer;
     _exceptionLogger           = exceptionLogger;
     _contextFactory            = contextFactory;
     _atypeVersionComparer      = atypeVersionComparer;
     _btypeVersionComparer      = btypeVersionComparer;
     _atypeWriteRepository      = atypeWriteRepository;
     _btypeWriteRepository      = btypeWriteRepository;
     _atypeRepository           = atypeRepository;
     _btypeRepository           = btypeRepository;
     _entityRelationDataAccess  = entityRelationDataAccess;
     _entityRelationDataFactory = entityRelationDataFactory;
     _initialEntityMatcher      = initialEntityMatcher;
 }
Ejemplo n.º 5
0
        private void SynchronizeInternal(
            IInitialSyncStateCreationStrategy <Identifier, int, string, Identifier, int, string> strategy,
            List <IEntityRelationData <Identifier, int, Identifier, int> > matchingEntities = null)
        {
            var synchronizer = CreateSynchronizer(strategy, matchingEntities);

            synchronizer.SynchronizeNoThrow(NullSynchronizationLogger.Instance).Wait();
        }
Ejemplo n.º 6
0
        private void PartialSynchronizeInternal(
            IInitialSyncStateCreationStrategy <Identifier, int, string, Identifier, int, string> strategy,
            IIdWithHints <Identifier, int>[] aEntitesToSynchronize = null,
            IIdWithHints <Identifier, int>[] bEntitesToSynchronize = null)
        {
            var synchronizer = CreateSynchronizer(strategy);

            synchronizer.SynchronizePartialNoThrow(
                aEntitesToSynchronize ?? new IIdWithHints <Identifier, int>[] { },
                bEntitesToSynchronize ?? new IIdWithHints <Identifier, int>[] { },
                NullSynchronizationLogger.Instance).Wait();
        }
        protected bool SynchronizeInternal(IInitialSyncStateCreationStrategy<string, int, string, string, int, string> strategy)
        {
            _synchronizer = new Synchronizer<string, int, string, string, int, string> (
              _synchronizerSetup,
              strategy,
              NullTotalProgressFactory.Instance,
              EqualityComparer<string>.Default,
              EqualityComparer<string>.Default,
              MockRepository.GenerateMock<IExceptionLogger>()
              );

              return _synchronizer.Synchronize().Result;
        }
        protected bool SynchronizeInternal(IInitialSyncStateCreationStrategy <string, int, string, string, int, string> strategy)
        {
            _synchronizer = new Synchronizer <string, int, string, string, int, string> (
                _synchronizerSetup,
                strategy,
                NullTotalProgressFactory.Instance,
                EqualityComparer <string> .Default,
                EqualityComparer <string> .Default,
                MockRepository.GenerateMock <IExceptionLogger>()
                );

            return(_synchronizer.Synchronize().Result);
        }
Ejemplo n.º 9
0
 public Synchronizer(
     ISynchronizerContext <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> synchronizerContext,
     IInitialSyncStateCreationStrategy <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> initialSyncStateCreationStrategy,
     ITotalProgressFactory totalProgressFactory,
     IEqualityComparer <TAtypeEntityId> atypeIdComparer,
     IEqualityComparer <TBtypeEntityId> btypeIdComparer, IExceptionLogger exceptionLogger)
 {
     _synchronizerContext = synchronizerContext;
     _initialSyncStateCreationStrategy = initialSyncStateCreationStrategy;
     _totalProgressFactory             = totalProgressFactory;
     _atypeIdComparer = atypeIdComparer;
     _btypeIdComparer = btypeIdComparer;
     _exceptionLogger = exceptionLogger;
 }
        protected bool SynchronizeInternal(IInitialSyncStateCreationStrategy <Identifier, int, string, Identifier, int, string> strategy)
        {
            var synchronizer = new Synchronizer <Identifier, int, string, Identifier, int, string> (
                _localRepository,
                _serverRepository,
                strategy,
                _entityRelationDataAccess,
                _entityRelationDataFactory,
                MockRepository.GenerateStub <IInitialEntityMatcher <string, Identifier, int, string, Identifier, int> >(),
                IdentifierEqualityComparer.Instance,
                IdentifierEqualityComparer.Instance,
                NullTotalProgressFactory.Instance,
                MockRepository.GenerateMock <IExceptionLogger>());

            return(synchronizer.Synchronize().Result);
        }
    protected bool SynchronizeInternal (IInitialSyncStateCreationStrategy<Identifier, int, string, Identifier, int, string> strategy)
    {
      var synchronizer = new Synchronizer<Identifier, int, string, Identifier, int, string> (
          _localRepository,
          _serverRepository,
          strategy,
          _entityRelationDataAccess,
          _entityRelationDataFactory,
          MockRepository.GenerateStub<IInitialEntityMatcher<string, Identifier, int, string, Identifier, int>>(),
          IdentifierEqualityComparer.Instance,
          IdentifierEqualityComparer.Instance,
          NullTotalProgressFactory.Instance,
          MockRepository.GenerateMock<IExceptionLogger>());

      return synchronizer.Synchronize().Result;
    }
        private Synchronizer <Identifier, int, string, Identifier, int, string, int, string, string, int, int> CreateSynchronizer(
            IInitialSyncStateCreationStrategy <Identifier, int, string, Identifier, int, string, int> strategy,
            List <IEntityRelationData <Identifier, int, Identifier, int> > matchingEntities = null)
        {
            var initialEntityMatcherStub = MockRepository.GenerateStub <IInitialEntityMatcher <Identifier, int, string, Identifier, int, string> >();

            initialEntityMatcherStub
            .Stub(_ => _.FindMatchingEntities(
                      Arg <IEntityRelationDataFactory <Identifier, int, Identifier, int> > .Is.NotNull,
                      Arg <IReadOnlyDictionary <Identifier, string> > .Is.NotNull,
                      Arg <IReadOnlyDictionary <Identifier, string> > .Is.NotNull,
                      Arg <IReadOnlyDictionary <Identifier, int> > .Is.NotNull,
                      Arg <IReadOnlyDictionary <Identifier, int> > .Is.NotNull))
            .Return(matchingEntities ?? new List <IEntityRelationData <Identifier, int, Identifier, int> >());

            var atypeWriteRepository = BatchEntityRepositoryAdapter.Create(_localRepository, TestExceptionHandlingStrategy.Instance);
            var btypeWriteRepository = BatchEntityRepositoryAdapter.Create(_serverRepository, TestExceptionHandlingStrategy.Instance);

            return(new Synchronizer <Identifier, int, string, Identifier, int, string, int, string, string, int, int>(
                       _localRepository,
                       _serverRepository,
                       atypeWriteRepository,
                       btypeWriteRepository,
                       strategy,
                       _entityRelationDataAccess,
                       _entityRelationDataFactory,
                       initialEntityMatcherStub,
                       IdentifierEqualityComparer.Instance,
                       IdentifierEqualityComparer.Instance,
                       NullTotalProgressFactory.Instance,
                       EqualityComparer <int> .Default,
                       EqualityComparer <int> .Default,
                       MockRepository.GenerateMock <IEntitySyncStateFactory <Identifier, int, string, Identifier, int, string, int> >(),
                       TestExceptionHandlingStrategy.Instance,
                       IdentityMatchDataFactory <string> .Instance,
                       IdentityMatchDataFactory <string> .Instance,
                       null,
                       NullChunkedExecutor.Instance,
                       NullFullEntitySynchronizationLoggerFactory <Identifier, string, Identifier, string> .Instance,
                       new VersionAwareToStateAwareEntityRepositoryAdapter <Identifier, int, int, int>(_localRepository, IdentifierEqualityComparer.Instance, EqualityComparer <int> .Default),
                       new VersionAwareToStateAwareEntityRepositoryAdapter <Identifier, int, int, int>(_serverRepository, IdentifierEqualityComparer.Instance, EqualityComparer <int> .Default),
                       NullStateTokensDataAccess <int, int> .Instance));
        }
Ejemplo n.º 13
0
        private Exception SynchronizeInternal(
            IInitialSyncStateCreationStrategy <Identifier, int, string, Identifier, int, string, int> strategy,
            bool noThrow,
            List <IEntityRelationData <Identifier, int, Identifier, int> > matchingEntities = null)
        {
            var synchronizer = CreateSynchronizer(strategy, matchingEntities);

            try
            {
                synchronizer.Synchronize(NullSynchronizationLogger.Instance, 0).Wait();
                return(null);
            }
            catch (AggregateException x)
            {
                if (noThrow)
                {
                    return(x.InnerException);
                }
                else
                {
                    throw;
                }
            }
        }
 private Synchronizer<Identifier, int, string, Identifier, int, string> CreateSynchronizer (IInitialSyncStateCreationStrategy<Identifier, int, string, Identifier, int, string> strategy)
 {
   return new Synchronizer<Identifier, int, string, Identifier, int, string> (
       _localRepository,
       _serverRepository,
       strategy,
       _entityRelationDataAccess,
       _entityRelationDataFactory,
       MockRepository.GenerateStub<IInitialEntityMatcher<string, Identifier, int, string, Identifier, int>>(),
       IdentifierEqualityComparer.Instance,
       IdentifierEqualityComparer.Instance,
       NullTotalProgressFactory.Instance,
       MockRepository.GenerateMock<IExceptionLogger>());
 }
    private void PartialSynchronizeInternal (
        IInitialSyncStateCreationStrategy<Identifier, int, string, Identifier, int, string> strategy,
        Identifier[] aEntitesToSynchronize = null,
        Identifier[] bEntitesToSynchronize = null)
    {
      var synchronizer = CreateSynchronizer (strategy);

      synchronizer.SynchronizePartial (
          aEntitesToSynchronize ?? new Identifier[] { },
          bEntitesToSynchronize ?? new Identifier[] { }).Wait();
    }
    private void SynchronizeInternal (IInitialSyncStateCreationStrategy<Identifier, int, string, Identifier, int, string> strategy)
    {
      var synchronizer = CreateSynchronizer (strategy);

      synchronizer.Synchronize().Wait();
    }
    private void SynchronizeInternal (
      IInitialSyncStateCreationStrategy<Identifier, int, string, Identifier, int, string> strategy,
      List<IEntityRelationData<Identifier, int, Identifier, int>> matchingEntities = null)
    {
      var synchronizer = CreateSynchronizer (strategy,matchingEntities);

      synchronizer.SynchronizeNoThrow (NullSynchronizationLogger.Instance).Wait();
    }
    private Synchronizer<Identifier, int, string, Identifier, int, string> CreateSynchronizer (
      IInitialSyncStateCreationStrategy<Identifier, int, string, Identifier, int, string> strategy,
      List<IEntityRelationData<Identifier, int, Identifier, int>> matchingEntities = null)
    {
      var initialEntityMatcherStub = MockRepository.GenerateStub<IInitialEntityMatcher<string, Identifier, int, string, Identifier, int>>();
      initialEntityMatcherStub
          .Stub (_ => _.FindMatchingEntities (
              Arg<IEntityRelationDataFactory<Identifier, int, Identifier, int>>.Is.NotNull,
              Arg<IReadOnlyDictionary<Identifier, string>>.Is.NotNull,
              Arg<IReadOnlyDictionary<Identifier, string>>.Is.NotNull,
              Arg<IReadOnlyDictionary<Identifier, int>>.Is.NotNull,
              Arg<IReadOnlyDictionary<Identifier, int>>.Is.NotNull))
          .Return (matchingEntities ?? new List<IEntityRelationData<Identifier, int, Identifier, int>>());

      return new Synchronizer<Identifier, int, string, Identifier, int, string> (
          _localRepository,
          _serverRepository,
          strategy,
          _entityRelationDataAccess,
          _entityRelationDataFactory,
          initialEntityMatcherStub,
          IdentifierEqualityComparer.Instance,
          IdentifierEqualityComparer.Instance,
          NullTotalProgressFactory.Instance,
          MockRepository.GenerateMock<IExceptionLogger>());
    }
    private void PartialSynchronizeInternal (
        IInitialSyncStateCreationStrategy<Identifier, int, string, Identifier, int, string> strategy,
        IIdWithHints<Identifier,int>[] aEntitesToSynchronize = null,
        IIdWithHints<Identifier, int>[] bEntitesToSynchronize = null)
    {
      var synchronizer = CreateSynchronizer (strategy);

      synchronizer.SynchronizePartialNoThrow (
          aEntitesToSynchronize ?? new IIdWithHints<Identifier, int>[] { },
          bEntitesToSynchronize ?? new IIdWithHints<Identifier, int>[] { },
          NullSynchronizationLogger.Instance).Wait();
    }
        public Synchronizer(
            IReadOnlyEntityRepository <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TContext> atypeRepository,
            IReadOnlyEntityRepository <TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> btypeRepository,
            IBatchWriteOnlyEntityRepository <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TContext> atypeWriteRepository,
            IBatchWriteOnlyEntityRepository <TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> btypeWriteRepository,
            IInitialSyncStateCreationStrategy <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> initialSyncStateCreationStrategy,
            IEntityRelationDataAccess <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> entityRelationDataAccess,
            IEntityRelationDataFactory <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> entityRelationDataFactory,
            IInitialEntityMatcher <TAtypeEntityId, TAtypeEntityVersion, TAMatchData, TBtypeEntityId, TBtypeEntityVersion, TBMatchData> initialEntityMatcher,
            IEqualityComparer <TAtypeEntityId> atypeIdComparer, IEqualityComparer <TBtypeEntityId> btypeIdComparer,
            ITotalProgressFactory totalProgressFactory,
            IEqualityComparer <TAtypeEntityVersion> atypeVersionComparer,
            IEqualityComparer <TBtypeEntityVersion> btypeVersionComparer, IEntitySyncStateFactory <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> syncStateFactory,
            IExceptionHandlingStrategy exceptionHandlingStrategy,
            IMatchDataFactory <TAtypeEntity, TAMatchData> aMatchDataFactory,
            IMatchDataFactory <TBtypeEntity, TBMatchData> bMatchDataFactory,
            int?chunkSize,
            IChunkedExecutor chunkedExecutor,
            IFullEntitySynchronizationLoggerFactory <TAtypeEntity, TBtypeEntity> fullEntitySynchronizationLoggerFactory,
            IStateAwareEntityRepository <TAtypeEntityId, TAtypeEntityVersion, TContext, TAtypeStateToken> atypeStateAwareEntityRepository,
            IStateAwareEntityRepository <TBtypeEntityId, TBtypeEntityVersion, TContext, TBtypeStateToken> btypeStateAwareEntityRepository,
            IStateTokenDataAccess <TAtypeStateToken, TBtypeStateToken> stateTokenDataAccess,
            ISynchronizationInterceptorFactory <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> synchronizationInterceptorFactoryOrNull = null)
        {
            if (atypeRepository == null)
            {
                throw new ArgumentNullException(nameof(atypeRepository));
            }
            if (btypeRepository == null)
            {
                throw new ArgumentNullException(nameof(btypeRepository));
            }
            if (atypeWriteRepository == null)
            {
                throw new ArgumentNullException(nameof(atypeWriteRepository));
            }
            if (btypeWriteRepository == null)
            {
                throw new ArgumentNullException(nameof(btypeWriteRepository));
            }
            if (initialSyncStateCreationStrategy == null)
            {
                throw new ArgumentNullException(nameof(initialSyncStateCreationStrategy));
            }
            if (entityRelationDataAccess == null)
            {
                throw new ArgumentNullException(nameof(entityRelationDataAccess));
            }
            if (entityRelationDataFactory == null)
            {
                throw new ArgumentNullException(nameof(entityRelationDataFactory));
            }
            if (initialEntityMatcher == null)
            {
                throw new ArgumentNullException(nameof(initialEntityMatcher));
            }
            if (atypeIdComparer == null)
            {
                throw new ArgumentNullException(nameof(atypeIdComparer));
            }
            if (btypeIdComparer == null)
            {
                throw new ArgumentNullException(nameof(btypeIdComparer));
            }
            if (totalProgressFactory == null)
            {
                throw new ArgumentNullException(nameof(totalProgressFactory));
            }
            if (atypeVersionComparer == null)
            {
                throw new ArgumentNullException(nameof(atypeVersionComparer));
            }
            if (btypeVersionComparer == null)
            {
                throw new ArgumentNullException(nameof(btypeVersionComparer));
            }
            if (syncStateFactory == null)
            {
                throw new ArgumentNullException(nameof(syncStateFactory));
            }
            if (exceptionHandlingStrategy == null)
            {
                throw new ArgumentNullException(nameof(exceptionHandlingStrategy));
            }
            if (aMatchDataFactory == null)
            {
                throw new ArgumentNullException(nameof(aMatchDataFactory));
            }
            if (bMatchDataFactory == null)
            {
                throw new ArgumentNullException(nameof(bMatchDataFactory));
            }
            if (fullEntitySynchronizationLoggerFactory == null)
            {
                throw new ArgumentNullException(nameof(fullEntitySynchronizationLoggerFactory));
            }
            if (atypeStateAwareEntityRepository == null)
            {
                throw new ArgumentNullException(nameof(atypeStateAwareEntityRepository));
            }
            if (btypeStateAwareEntityRepository == null)
            {
                throw new ArgumentNullException(nameof(btypeStateAwareEntityRepository));
            }
            if (stateTokenDataAccess == null)
            {
                throw new ArgumentNullException(nameof(stateTokenDataAccess));
            }

            _chunkSize       = chunkSize;
            _chunkedExecutor = chunkedExecutor;
            _fullEntitySynchronizationLoggerFactory = fullEntitySynchronizationLoggerFactory;
            _atypeStateAwareEntityRepository        = atypeStateAwareEntityRepository;
            _btypeStateAwareEntityRepository        = btypeStateAwareEntityRepository;
            _stateTokenDataAccess = stateTokenDataAccess;

            _initialSyncStateCreationStrategy = initialSyncStateCreationStrategy;
            _totalProgressFactory             = totalProgressFactory;
            _atypeIdComparer                   = atypeIdComparer;
            _btypeIdComparer                   = btypeIdComparer;
            _atypeVersionComparer              = atypeVersionComparer;
            _btypeVersionComparer              = btypeVersionComparer;
            _syncStateFactory                  = syncStateFactory;
            _exceptionHandlingStrategy         = exceptionHandlingStrategy;
            _aMatchDataFactory                 = aMatchDataFactory;
            _bMatchDataFactory                 = bMatchDataFactory;
            _synchronizationInterceptorFactory = synchronizationInterceptorFactoryOrNull ?? NullSynchronizationInterceptorFactory <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> .Instance;
            _atypeWriteRepository              = atypeWriteRepository;
            _btypeWriteRepository              = btypeWriteRepository;
            _atypeRepository                   = atypeRepository;
            _btypeRepository                   = btypeRepository;
            _entityRelationDataAccess          = entityRelationDataAccess;
            _entityRelationDataFactory         = entityRelationDataFactory;
            _initialEntityMatcher              = initialEntityMatcher;
            _entitySyncStateChunkCreator       = new EntitySyncStateChunkCreator <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext>(chunkSize);
        }