private void RunSegment( int segmentIndex, int segmentCount, SegmentConfiguration segmentConfiguration, IBootstrapper bootstrapper, ISafeRepository safeRepository) { this.SetupConfigurationProvider(segmentConfiguration, bootstrapper); IContext context = this.SetupContext( segmentConfiguration, segmentIndex, segmentCount, bootstrapper, safeRepository); IBridge bridge = this.bridgeFactory.CreateBridge( segmentConfiguration.Type, context.EntityType.Type, bootstrapper); IInvocableInitializer invocableInitializer = bootstrapper.Get <IInvocableInitializer>(); bridge.ContextValidator.Validate(context); ISegmentRunner segmentRunner = bridge.CreateSegmentRunner(); bridge.EventDispatcher.SegmentExecuting(new SegmentExecutingArgs()); invocableInitializer.Initialize(bridge.EventDispatcher); segmentRunner.Run(); bridge.EventDispatcher.SegmentExecuted(new SegmentExecutedArgs()); }
public ServiceProvider( IContext context, ISafeRepository dataRepository, [ImportMany] IEnumerable <IFeed <TEntity> > feeds, [ImportMany] IEnumerable <ISink <TEntity> > sinks, [ImportMany] IEnumerable <ICacheFeed <TEntity> > cacheFeeds, [ImportMany] IEnumerable <IMetadataProvider <TEntity> > metadataProviders, [ImportMany] IEnumerable <ISerializer <TEntity> > serializers, [ImportMany] IEnumerable < IPreprocessorOperation <TEntity> > preprocessorOperations, [ImportMany] IEnumerable <IHomogenizer> homogenizers, [ImportMany] IEnumerable <IMerger <TEntity> > mergers) { this.context = context; this.safeRepository = dataRepository; this.feeds = feeds; this.sinks = sinks; this.cacheFeeds = cacheFeeds; this.metadataProviders = metadataProviders; this.serializers = serializers; this.preprocessorOperations = preprocessorOperations; this.homogenizers = homogenizers; this.mergers = mergers; this.feedTypeFullName = new Lazy <string>(this.GetFeedTypeFullName); this.feed = new Lazy <IFeed <TEntity> >(this.GetFeed); this.entityType = new Lazy <Persistence.IEntityType>(this.GetEntityType); this.sink = new Lazy <ISink <TEntity> >(this.GetSink); this.cacheFeed = new Lazy <ICacheFeed <TEntity> >(this.GetCacheFeed); }
private void ProcessParameters( ParameterScope scope, IDictionary <string, string> parameters, IDictionary <string, IParameter> existingParameters, ISafeRepository safeRepository) { foreach (string name in parameters.Keys) { if (existingParameters.ContainsKey(name)) { if (existingParameters[name].Value != parameters[name]) { safeRepository.SetParameterValue( existingParameters[name].Id, parameters[name]); } existingParameters.Remove(name); } else { safeRepository.CreateParameter( new Parameter( Guid.NewGuid(), scope.DestinationSystemId, scope.EntityTypeId, scope.SourceSystemId, name, parameters[name])); } } }
private void DeleteOrphanParameters( IEnumerable <IParameter> parameters, ISafeRepository safeRepository) { foreach (IParameter parameter in parameters) { safeRepository.DeleteParameter(parameter.Id); } }
public SafeServices(ISafeRepository safeRepository) { if (safeRepository == null) { throw new ArgumentNullException("SafeRepository"); } _SafeRepository = safeRepository; }
private void CreateOrUpdateFeeds( IEnumerable <Feed> feeds, ISafeRepository safeRepository) { foreach (Feed feed in feeds) { safeRepository.CreateOrUpdateFeed(feed); } }
private void CreateOrUpdateExternalSystems( IEnumerable <ExternalSystem> externalSystems, ISafeRepository safeRepository) { foreach (ExternalSystem externalSystem in externalSystems) { safeRepository.CreateOrUpdateExternalSystem(externalSystem); } }
public MappingDataRepository( IContext context, IOperationExecutive operationExecutive, ISafeRepository safeRepository) { this.context = context; this.operationExecutive = operationExecutive; this.safeRepository = safeRepository; }
private void CreateOrUpdateEntityTypes( IEnumerable <EntityType> entityTypes, ISafeRepository safeRepository) { foreach (EntityType entityType in entityTypes) { safeRepository.CreateOrUpdateEntityType(entityType); } }
public EmployeeRepository(string connectionString, ILogger <IRepository <EmployeeDTO> > logger, ISafeRepository <PositionDTO> positionRepository, IReaderConverter <EmployeeDTO> employeeConverter) : base(logger) { this.logger = logger; this.positionRepository = positionRepository; ConnectionString = connectionString; convert = employeeConverter.converterToDTO; }
public GenericRestEntityRemoteService( ISafeRepository <TEntity> repository, ILogger <GenericRestEntityRemoteService <TEntity> > logger, IEntityManager entityManager) { this.Repository = repository; this.Logger = logger; this.EntityManager = entityManager; this.Entity = entityManager.GetEntityByClrType(typeof(TEntity)); }
private ContextFactory GetContextFactory(ISafeRepository safeRepository) { if (this.contextFactory == null) { this.contextFactory = new ContextFactory( this, safeRepository.GetExternalSystems(), safeRepository.GetEntityTypes(), safeRepository.GetSharedIdentifierSourceSystems()); } return(this.contextFactory); }
private void CreateSharedSourceSystemIdentifierGroup( SharedSourceSystemIdentifierGroup group, int groupNumber, ISafeRepository safeRepository) { foreach (Guid sourceSystemId in group.SourceSystemIds) { safeRepository.CreateSharedSourceSystemIdentifier( new SharedSourceSystemIdentifier( group.EntityTypeId, sourceSystemId, groupNumber)); } }
public ProjectRepository(string connectionString, ILogger <IRepository <ProjectDTO> > logger, IRepository <EmployeeDTO> employeeRepository, ISafeRepository <StatusDTO> statusRepository, IReaderConverter <ProjectDTO> projectConverter, IReaderConverter <TaskDTO> taskConverter) : base(logger) { this.logger = logger; ConnectionString = connectionString; this.employeeRepository = employeeRepository; this.statusRepository = statusRepository; convert = projectConverter.converterToDTO; convertTask = taskConverter.converterToDTO; }
GetExistingParametersByScope(ISafeRepository safeRepository) { return (safeRepository .GetParameters() .GroupBy(parameter => new ParameterScope( parameter.DestinationSystemId, parameter.EntityTypeId, parameter.SourceSystemId)) .ToDictionary( parameters => parameters.Key, parameters => parameters.ToDictionary( parameter => parameter.Name))); }
private void CreateSharedSourceSystemIdentifierGroups( IEnumerable <SharedSourceSystemIdentifierGroup> groups, ISafeRepository safeRepository) { foreach (IGrouping <Guid, SharedSourceSystemIdentifierGroup> entityTypeGroups in groups.GroupBy(group => group.EntityTypeId)) { safeRepository.ClearSharedSourceSystemIdentifiers(entityTypeGroups.Key); int groupNumber = 1; foreach (SharedSourceSystemIdentifierGroup group in entityTypeGroups) { this.CreateSharedSourceSystemIdentifierGroup( group, groupNumber++, safeRepository); } } }
public MappingRepository( IContext context, IOperationExecutive operationExecutive, IMappingDataRepository mappingDataRepository, ISafeRepository safeRepository, IHashingSerializer <TEntity> hashingSerializer, IEventDispatcher <TEntity> eventDispatcher, IInitializer initializer) { this.context = context; this.operationExecutive = operationExecutive; this.mappingDataRepository = mappingDataRepository; this.safeRepository = safeRepository; this.hashingSerializer = hashingSerializer; initializer.Register( this.mappingDataRepository.CreateInitializer(eventDispatcher), suppressEvents: true); }
public DatabaseLogger( IContext context, IOperationExecutive operationExecutive, IServiceProvider <TEntity> serviceProvider, IMappingDataRepository mappingDataRepository, IHashingSerializer <TEntity> hashingSerializer, IHashFunction hashFunction, ILoggingConfigurationProvider loggingConfigurationProvider, ISafeRepository safeRepository) { this.context = context; this.operationExecutive = operationExecutive; this.serviceProvider = serviceProvider; this.mappingDataRepository = mappingDataRepository; this.hashingSerializer = hashingSerializer; this.hashFunction = hashFunction; this.loggingConfigurationProvider = loggingConfigurationProvider; this.safeRepository = safeRepository; }
private void CreateOrUpdateAssets( IBootstrapper bootstrapper, DeploymentContext context) { using (ISafeRepository safeRepository = bootstrapper.Get <ISafeRepository>()) { using (var scope = new TransactionScope()) { this.CreateOrUpdateExternalSystems( context.ExternalSystems, safeRepository); this.CreateOrUpdateEntityTypes( context.EntityTypes, safeRepository); this.CreateSharedSourceSystemIdentifierGroups( context.SharedSourceSystemIdentifierGroups, safeRepository); this.CreateOrUpdateFeeds( context.Feeds, safeRepository); this.CreateOrUpdateParameters(context, safeRepository); scope.Complete(); } } }
public GarbageCollectionSegmentRunner( IContext context, IParameterProvider parameterProvider, IOperationExecutive operationExecutive, IGateway <TEntity> gateway, ISafeRepository safeRepository, IEventDispatcher <TEntity> eventDispatcher, IInitializer initializer) { this.context = context; this.parameterProvider = parameterProvider; this.operationExecutive = operationExecutive; this.gateway = gateway; this.safeRepository = safeRepository; this.eventDispatcher = eventDispatcher; this.idsOfEntitiesToDelete = null; initializer.Register( new Initializer(this), suppressEvents: true); }
private void RunSegment( int segmentIndex, int segmentCount, SegmentConfiguration segmentConfiguration) { using (IBootstrapper bootstrapper = this.bootstrapperFactory.CreateBootstrapper()) { using (ISafeRepository safeRepository = bootstrapper.Get <ISafeRepository>()) { this.RunSegment( segmentIndex, segmentCount, segmentConfiguration, bootstrapper, safeRepository); } } }
private IContext SetupContext( SegmentConfiguration segmentConfiguration, int segmentIndex, int segmentCount, IBootstrapper bootstrapper, ISafeRepository safeRepository) { IContext context = this .GetContextFactory(safeRepository) .CreateContext( bootstrapper, segmentConfiguration, segmentIndex, segmentCount, this.runData); IWritableContext writableContext = bootstrapper.Get <IWritableContext>(); writableContext.SetContext(context); return(context); }
private void CreateOrUpdateParameters( DeploymentContext context, ISafeRepository safeRepository) { IEnumerable <ParameterScope> parameterScopes = this.GetParameterScopes(context); IDictionary <ParameterScope, Dictionary <string, IParameter> > existingParametersByScope = this.GetExistingParametersByScope(safeRepository); foreach (ParameterScope scope in parameterScopes) { IDictionary <string, IParameter> existingParameters = this.GetExistingParameters(existingParametersByScope, scope); IDictionary <string, string> parameters = this.GetParameters(context, scope); this.ProcessParameters( scope, parameters, existingParameters, safeRepository); this.DeleteOrphanParameters(existingParameters.Values, safeRepository); } }
public MenuService(ISafeRepository <MenuItemEntity> menuItemRepo) { _menuItemRepo = menuItemRepo; }
protected DataManager(ISafeRepository <TEntity> safeRepository, IUnsafeRepository <TEntity> unsafeRepository, IMapper mapper) { this.SafeRepository = safeRepository; this.UnsafeRepository = unsafeRepository; this.Mapper = mapper; }
public TestService(ISafeRepository <FeatureEntity> repo) { }
public PositionService(ILogger <PositionService> logger, ISafeRepository <PositionDTO> positionRepository, IConverter <PositionDTO, PositionBLO> positionConverter) { this.logger = logger; this.positionRepository = positionRepository; this.positionConverter = positionConverter; }
public GenericRecordImporter(ISafeRepository <TEntity> repository) { _repository = repository; }
public OperationExecutive(IContext context, ISafeRepository safeRepository) { this.context = context; this.safeRepository = safeRepository; this.currentOperation = null; }
public ParametersAssembler(ISafeRepository safeRepository) { this.safeRepository = safeRepository; }