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()); }
private void SetupConfigurationProvider( SegmentConfiguration segmentConfiguration, IBootstrapper bootstrapper) { IWritableConfigurationProvider writableConfigurationProvider = bootstrapper.Get <IWritableConfigurationProvider>(); writableConfigurationProvider .SetConfigurationProvider(new ConfigurationProvider( this.configuration.Value, segmentConfiguration)); }
private IReadOnlyDictionary <string, string> AssembleParameters( IBootstrapper bootstrapper, IEntityType entityType, IExternalSystem sourceSystem) { IParametersAssembler parametersAssembler = bootstrapper.Get <IParametersAssembler>(); return(parametersAssembler.AssembleParameters( entityType.DestinationSystem.Id, entityType.Id, sourceSystem != null ? (Guid?)sourceSystem.Id : null)); }
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(); } } }
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); }