public SelectedProblemProvider(IUserInputProvider inputProvider, ISolverProvider solverProvider, IConfigurationValueProvider provider, SolvedConfigurationProvider solvedConfigurationProvider) { _inputProvider = inputProvider; _configurationProvider = provider; _solvedConfigurationProvider = solvedConfigurationProvider; _solverProvider = solverProvider; }
public WorkerRole() { _pulsers = Pulsers.FromAssembly(Assembly.GetAssembly(typeof(ImportFileProcessed))) .ToList(); var container = new WindsorContainer(); _configurationValueProvider = new AzureConfigurationValueProvider(); SetupDi(container, _configurationValueProvider, _pulsers.ToArray()); _pulserPublisher = container.Resolve <PulserPublisher>(); _orchestrator = container.Resolve <Orchestrator>(); // insert the list here var keyValueStore = container.Resolve <IDynamoStore>(); var blob = new SimpleBlob() { Body = Assembly.GetExecutingAssembly() .GetManifestResourceStream("BeeHive.Sample.FileImport.Worker.Data.SampleData.txt"), Id = "FileDrop/ImportFiles/SampleData.txt", LastModified = DateTimeOffset.Now }; keyValueStore.UpsertAsync(blob); // add one topic that will not be created automagically by orchestrator // because no actor registered against it var q = container.Resolve <IEventQueueOperator>(); q.CreateQueueAsync(QueueName.FromSimpleQueueName("NewIndexUpserted")).Wait(); }
public NestBatchPusher(string esUrl, IIndexNamer indexNamer, IConfigurationValueProvider configurationValueProvider) { _indexNamer = indexNamer; if (!int.TryParse(configurationValueProvider.GetValue(ConfigurationKeys.BulkBatchSize), out _batchSize)) { _batchSize = 500; } var endodedCreds = configurationValueProvider.GetValue(ConfigurationKeys.TabSeparatedCustomEsHttpHeaders) .Replace("Authorization: Basic", "").Trim(); var credentials = Encoding.UTF8.GetString(Convert.FromBase64String(endodedCreds)).Split(':'); if (!bool.TryParse(configurationValueProvider.GetValue(ConfigurationKeys.EsPipelineEnabled), out _setPipeline)) { _setPipeline = false; } var connectionConfiguration = new ConnectionSettings( new SingleNodeConnectionPool(new Uri(esUrl))) .ServerCertificateValidationCallback(delegate { return(true); }) .BasicAuthentication(credentials[0], credentials[1]) .RequestTimeout(TimeSpan.FromMinutes(2)) //.EnableDebugMode(_ => { if(!_.Success) Console.WriteLine(); }) .DefaultIndex("DafaultIndex"); _client = new ElasticClient(connectionConfiguration); }
public IndexNamer(IConfigurationValueProvider configurationValueProvider) { _indexPrefix = configurationValueProvider.GetValue(ConfigurationKeys.EsIndexPrefix); var value = configurationValueProvider.GetValue(ConfigurationKeys.EsOneIndexPerType); _oneIndexPerType = Convert.ToBoolean(value); }
public EncryptionTokenProvider(IStringCryptoTransformer crypto, IConfigurationValueProvider configProvider) { this.crypto = crypto; this.configProvider = configProvider; this.volatileDataProvider = new TokenDateTimeProvider(); }
public UserConfigurationProvider(IUserInputProvider inputProvider, IConfigurationValueProvider provider) { _inputProvider = inputProvider; var fileName = provider.Get(ConfigurationConstants.UserConfigFileKey) ?? ConfigurationConstants.DefaultUserConfigFileName; _userConfigurationProvider = new UserConfigurationValueProvider(fileName); }
private void MakeSureTableIsThere(IConfigurationValueProvider configurationValueProvider) { if (_table == null) { lock (_lock) { if (_table == null) { //var account = CloudStorageAccount.Parse(configurationValueProvider.GetValue(ConfigurationKeys.StorageConnectionString)); CloudStorageAccount account; if (!String.IsNullOrWhiteSpace( configurationValueProvider.GetValue(ConfigurationKeys.StorageAccountSasKey))) { // Create new storage credentials using the SAS token. var accountSas = new StorageCredentials( configurationValueProvider.GetValue(ConfigurationKeys.StorageAccountSasKey)); // Use these credentials and the account name to create a Blob service client. account = new CloudStorageAccount(accountSas, ConfigurationKeys.StorageAccountName, "", useHttps: true); } else { account = CloudStorageAccount.Parse( configurationValueProvider.GetValue(ConfigurationKeys.StorageConnectionString)); } var client = account.CreateCloudTableClient(); _table = client.GetTableReference(configurationValueProvider.GetValue(ConfigurationKeys.TableName)); _table.CreateIfNotExists(); } } } }
public WorkerRole() { _pulsers = Pulsers.FromAssembly(Assembly.GetAssembly(typeof(ImportFileProcessed))) .ToList(); var container = new WindsorContainer(); _configurationValueProvider = new AzureConfigurationValueProvider(); SetupDi(container, _configurationValueProvider, _pulsers.ToArray()); _pulserPublisher = container.Resolve<PulserPublisher>(); _orchestrator = container.Resolve<Orchestrator>(); // insert the list here var keyValueStore = container.Resolve<IDynamoStore>(); var blob = new SimpleBlob() { Body = Assembly.GetExecutingAssembly() .GetManifestResourceStream("BeeHive.Sample.FileImport.Worker.Data.SampleData.txt"), Id = "FileDrop/ImportFiles/SampleData.txt", LastModofied = DateTimeOffset.Now }; keyValueStore.UpsertAsync(blob); // add one topic that will not be created automagically by orchestrator // because no actor registered against it var q = container.Resolve<IEventQueueOperator>(); q.CreateQueueAsync("NewIndexUpserted").Wait(); }
public EncryptionTokenProvider(IStringCryptoTransformer crypto, IConfigurationValueProvider configProvider, ITokenVolatileDataProvider volatileDataProvider) : this(crypto, configProvider) { ErrorTrap.AddRaisableAssertion<ArgumentNullException>(volatileDataProvider != null, "volatileDataProvider != null"); this.volatileDataProvider = volatileDataProvider; }
static void Main(string[] args) { ServicePointManager.DefaultConnectionLimit = 1000; ThreadPool.SetMinThreads(100, 100); var container = new WindsorContainer(); var serviceLocator = new WindsorServiceLocator(container); _configurationValueProvider = new AppSettingsConfigurationValueProvider(); var storageConnectionString = _configurationValueProvider.GetValue(ConfigurationKeys.TableStorageConnectionString); var servicebusConnectionString = _configurationValueProvider.GetValue(ConfigurationKeys.ServiceBusConnectionString); container.Register( Component.For <Orchestrator>() .ImplementedBy <Orchestrator>() .LifestyleSingleton(), Component.For <MasterScheduler>() .ImplementedBy <MasterScheduler>() .LifestyleSingleton(), Component.For <IConfigurationValueProvider>() .Instance(_configurationValueProvider), Component.For <IServiceLocator>() .Instance(serviceLocator), Component.For <IActorConfiguration>() .Instance( ActorDescriptors.FromAssemblyContaining <PeckSourceScheduled>() .ToConfiguration()), Component.For <IFactoryActor>() .ImplementedBy <FactoryActor>() .LifestyleTransient(), Component.For <PeckSourceProcessor>() .ImplementedBy <PeckSourceProcessor>() .LifestyleTransient(), Component.For <ILockStore>() .Instance(new AzureLockStore(new BlobSource() { ConnectionString = storageConnectionString, ContainerName = "locks", Path = "woodpecker/locks/master_Keys/" })), Component.For <IEventQueueOperator>() .Instance(new ServiceBusOperator(servicebusConnectionString)) ); _orchestrator = container.Resolve <Orchestrator>(); _scheduler = container.Resolve <MasterScheduler>(); Task.Run(() => _orchestrator.SetupAsync()).Wait(); _orchestrator.Start(); Console.WriteLine("Working ..."); Work(); _orchestrator.Stop(); }
public PrefixConfigurationValueProvider(IConfigurationValueProvider underlyinConfigurationValueProvider, string prefix) { _underlyinConfigurationValueProvider = underlyinConfigurationValueProvider ?? throw new ArgumentNullException(nameof(underlyinConfigurationValueProvider)); if (string.IsNullOrWhiteSpace(prefix)) { throw new ArgumentNullException(nameof(prefix)); } _prefix = prefix; }
public MasterScheduler(IEventQueueOperator eventQueueOperator, IConfigurationValueProvider configurationValueProvider, ISourceConfiguration sourceConfiguration, IElasticsearchClient elasticsearchClient, IServiceLocator locator) { _sourceConfiguration = sourceConfiguration; _locator = locator; _elasticsearchClient = elasticsearchClient; _configurationValueProvider = configurationValueProvider; _eventQueueOperator = eventQueueOperator; }
public ElasticsearchBatchPusher(IHttpClient httpClient, IConfigurationValueProvider configurationValueProvider, string esUrl, int batchSize = 100) { _httpClient = httpClient; _batchSize = batchSize; _esUrl = esUrl; var esBackOffMinSecondsString = configurationValueProvider.GetValue(ConfigurationKeys.EsBackOffMinSeconds); var esBackOffMaxSecondsString = configurationValueProvider.GetValue(ConfigurationKeys.EsBackOffMaxSeconds); var esBackOffMinSeconds = string.IsNullOrWhiteSpace(esBackOffMinSecondsString) ? 5 : int.Parse(esBackOffMinSecondsString); var esBackOffMaxSeconds = string.IsNullOrWhiteSpace(esBackOffMaxSecondsString) ? 100 : int.Parse(esBackOffMaxSecondsString); _interval = new DoublyIncreasingInterval(TimeSpan.FromSeconds(esBackOffMinSeconds), TimeSpan.FromSeconds(esBackOffMaxSeconds), 5); }
public MasterScheduler(IEventQueueOperator eventQueueOperator, IConfigurationValueProvider configurationValueProvider, ILockStore lockStore) { _lockStore = lockStore; _eventQueueOperator = eventQueueOperator; var tscn = configurationValueProvider.GetValue(ConfigurationKeys.TableStorageConnectionString); var account = CloudStorageAccount.Parse(tscn); var client = account.CreateCloudTableClient(); _table = client.GetTableReference(configurationValueProvider.GetValue(ConfigurationKeys.SourceTableName)); _table.CreateIfNotExistsAsync(); _clustername = configurationValueProvider.GetValue(ConfigurationKeys.ClusterName); }
public ShardKeyActor(IElasticsearchBatchPusher pusher, ITelemetryProvider telemetryProvider, IConfigurationValueProvider configurationValueProvider) { _pusher = pusher; _telemetryProvider = telemetryProvider; _durationInstrumentor = telemetryProvider.GetInstrumentor <ShardKeyActor>(); if (!int.TryParse( configurationValueProvider.GetValue(ConfigurationKeys.ShadKeyArrivalDelayWarningInSeconds), out _shardKeyDelayWarning)) { _shardKeyDelayWarning = 120; } }
public ServiceActivator( Container parentContainer, ILogger logger, IServiceContainer serviceContainer, IConfigurationValueProvider configurationValueProvider) { _parentContainer = parentContainer; _logger = logger; _serviceContainer = serviceContainer; _configurationValueProvider = configurationValueProvider; ActivationGroups = new HashSet <string>(); ServiceProviders = new Dictionary <Type, IServiceProvider>(); OverrideTypes = new HashSet <Type>(); }
private void MakeSureTableIsThere(IConfigurationValueProvider configurationValueProvider) { if (_table == null) { lock (_lock) { if (_table == null) { var account = CloudStorageAccount.Parse(configurationValueProvider.GetValue(ConfigurationKeys.StorageConnectionString)); var client = account.CreateCloudTableClient(); _table = client.GetTableReference(configurationValueProvider.GetValue(ConfigurationKeys.TableName)); _table.CreateIfNotExists(); } } } }
public MasterScheduler(IEventQueueOperator eventQueueOperator, IConfigurationValueProvider configurationValueProvider, ISourceConfiguration sourceConfiguration, IElasticsearchClient elasticsearchClient, IServiceLocator locator, ILockStore lockStore, ITelemetryProvider telemetryProvider, IIndexNamer indexNamer, IKeyValueStore keyValueStore) { _keyValueStore = keyValueStore; _indexNamer = indexNamer; _lockStore = lockStore; _telemetryProvider = telemetryProvider; _sourceConfiguration = sourceConfiguration; _locator = locator; _elasticsearchClient = elasticsearchClient; _configurationValueProvider = configurationValueProvider; _eventQueueOperator = eventQueueOperator; _scheduleDurationInstrumentor = telemetryProvider.GetInstrumentor <MasterScheduler>(); }
public WorkerRole() { _pulsers = Pulsers.FromAssembly(Assembly.GetAssembly(typeof(NewsFeedPulsed))) .ToList(); var container = new WindsorContainer(); _configurationValueProvider = new AzureConfigurationValueProvider(); SetupDi(container, _configurationValueProvider, _pulsers.ToArray()); _pulserPublisher = container.Resolve<PulserPublisher>(); _orchestrator = container.Resolve<Orchestrator>(); // insert the list here var keyValueStore = container.Resolve<IKeyValueStore>(); var blob = new SimpleBlob() { Body = new MemoryStream(Encoding.UTF8.GetBytes("http://feeds.bbci.co.uk/news/rss.xml")), Id = "newsFeeds.txt", LastModofied = DateTimeOffset.Now }; keyValueStore.UpsertAsync(blob); }
public WorkerRole() { _pulsers = Pulsers.FromAssembly(Assembly.GetAssembly(typeof(NewsFeedPulsed))) .ToList(); var container = new WindsorContainer(); _configurationValueProvider = new AzureConfigurationValueProvider(); SetupDi(container, _configurationValueProvider, _pulsers.ToArray()); _pulserPublisher = container.Resolve <PulserPublisher>(); _orchestrator = container.Resolve <Orchestrator>(); // insert the list here var keyValueStore = container.Resolve <IKeyValueStore>(); var blob = new SimpleBlob() { Body = new MemoryStream(Encoding.UTF8.GetBytes("http://feeds.bbci.co.uk/news/rss.xml")), Id = "newsFeeds.txt", LastModofied = DateTimeOffset.Now }; keyValueStore.UpsertAsync(blob); }
public WorkerRole() { var container = new WindsorContainer(); var serviceLocator = new WindsorServiceLocator(container); _configurationValueProvider = new AzureConfigurationValueProvider(); var storageConnectionString = _configurationValueProvider.GetValue(ConfigurationKeys.StorageConnectionString); var clusterLockContainer = _configurationValueProvider.GetValue(ConfigurationKeys.ClusterLockContainer); var clusterLockRootPath = _configurationValueProvider.GetValue(ConfigurationKeys.ClusterLockRootPath); var headersText = _configurationValueProvider.GetValue(ConfigurationKeys.TabSeparatedCustomEsHttpHeaders); var headers = new List <KeyValuePair <string, string> >(); if (headersText != null) { foreach (var header in headersText.Split('\t')) { var strings = header.Split(new [] { ": " }, StringSplitOptions.RemoveEmptyEntries); if (strings.Length == 2) { headers.Add(new KeyValuePair <string, string>(strings[0], strings[1])); } } } int bulkBatchSize = 100; var bulkBatchSizeString = _configurationValueProvider.GetValue(ConfigurationKeys.BulkBatchSize); int.TryParse(bulkBatchSizeString, out bulkBatchSize); var servicebusConnectionString = _configurationValueProvider.GetValue(ConfigurationKeys.ServiceBusConnectionString); container.Register( Component.For <IElasticsearchClient>() .ImplementedBy <ElasticsearchClient>() .LifestyleSingleton(), Component.For <Orchestrator>() .ImplementedBy <Orchestrator>() .LifestyleSingleton(), Component.For <MasterScheduler>() .ImplementedBy <MasterScheduler>() .LifestyleSingleton(), Component.For <IConfigurationValueProvider>() .Instance(_configurationValueProvider), Component.For <IServiceLocator>() .Instance(serviceLocator), Component.For <IActorConfiguration>() .Instance( ActorDescriptors.FromAssemblyContaining <ShardRangeActor>() .ToConfiguration().UpdateParallelism(_configurationValueProvider)), Component.For <ISourceConfiguration>() .ImplementedBy <TableStorageConfigurationSource>(), Component.For <IFactoryActor>() .ImplementedBy <FactoryActor>() .LifestyleTransient(), Component.For <ShardKeyActor>() .ImplementedBy <ShardKeyActor>() .LifestyleTransient(), Component.For <ShardRangeActor>() .ImplementedBy <ShardRangeActor>() .LifestyleTransient(), Component.For <BlobFileActor>() .ImplementedBy <BlobFileActor>() .LifestyleTransient(), Component.For <BlobFileConventionActor>() .ImplementedBy <BlobFileConventionActor>() .LifestyleTransient(), Component.For <IisBlobScheduler>() .ImplementedBy <IisBlobScheduler>() .LifestyleTransient(), Component.For <IisBlobConventionScheduler>() .ImplementedBy <IisBlobConventionScheduler>() .LifestyleTransient(), Component.For <RangeShardKeyScheduler>() .ImplementedBy <RangeShardKeyScheduler>() .LifestyleTransient(), Component.For <SimpleBlobScheduler>() .ImplementedBy <SimpleBlobScheduler>() .LifestyleTransient(), Component.For <MinuteTableShardScheduler>() .ImplementedBy <MinuteTableShardScheduler>() .LifestyleTransient(), Component.For <D18MinuteTableShardScheduler>() .ImplementedBy <D18MinuteTableShardScheduler>() .LifestyleTransient(), Component.For <Modulo10MinuteTableShardScheduler>() .ImplementedBy <Modulo10MinuteTableShardScheduler>() .LifestyleTransient(), Component.For <ReverseTimestampMinuteTableShardScheduler>() .ImplementedBy <ReverseTimestampMinuteTableShardScheduler>() .LifestyleTransient(), Component.For <IisLogParser>() .ImplementedBy <IisLogParser>() .LifestyleTransient(), Component.For <AkamaiLogParser>() .ImplementedBy <AkamaiLogParser>() .LifestyleTransient(), Component.For <IIndexNamer>() .ImplementedBy <IndexNamer>() .LifestyleSingleton(), Component.For <IHttpClient>() .ImplementedBy <DefaultHttpClient>() .LifestyleSingleton() .DependsOn(Dependency.OnValue("defaultHeaders", headers)), Component.For <ITempDownloadLocationProvider>() .ImplementedBy <AzureTempDownloadLocationProvider>() .LifestyleSingleton(), Component.For <IElasticsearchBatchPusher>() .ImplementedBy <ElasticsearchBatchPusher>() .LifestyleTransient() .DependsOn(Dependency.OnValue("esUrl", _configurationValueProvider.GetValue(ConfigurationKeys.ElasticSearchUrl))) .DependsOn(Dependency.OnValue("batchSize", bulkBatchSize)), Component.For <ILockStore>() .Instance(new AzureLockStore(new BlobSource() { ConnectionString = storageConnectionString, ContainerName = clusterLockContainer, Path = clusterLockRootPath })), Component.For <IKeyValueStore>() .Instance(new AzureKeyValueStore(storageConnectionString, clusterLockContainer)), Component.For <IEventQueueOperator>() .Instance(new ServiceBusOperator(servicebusConnectionString)), Component.For <ITelemetryProvider>() .ImplementedBy <TelemetryProvider>() .LifestyleSingleton() ); _orchestrator = container.Resolve <Orchestrator>(); _scheduler = container.Resolve <MasterScheduler>(); _keyValueStore = container.Resolve <IKeyValueStore>(); ServicePointHelper.ApplyStandardSettings(_configurationValueProvider.GetValue(ConfigurationKeys.ElasticSearchUrl)); }
public IisBlobScheduler(ILockStore lockStore, IConfigurationValueProvider configurationValueProvider) : base(configurationValueProvider) { }
public ContentDeliveryNetworkResolver(IConfigurationValueProvider configurationValueProvider) { _configurationValueProvider = configurationValueProvider; }
public ServerConfigurationProvider(IUserInputProvider inputProvider, IConfigurationValueProvider configurationValueProvider) { _inputProvider = inputProvider; _valueProvider = configurationValueProvider; }
public D18MinuteTableShardScheduler(ILockStore lockStore, IConfigurationValueProvider configurationValueProvider) : base(lockStore, configurationValueProvider) { }
public ReverseTimestampMinuteTableShardScheduler(ILockStore lockStore, IConfigurationValueProvider configurationValueProvider) : base(lockStore, configurationValueProvider) { }
protected static void Setup() { var container = new WindsorContainer(); var serviceLocator = new WindsorServiceLocator(container); _configurationValueProvider = new AppSettingsConfigProvider(); var storageConnectionString = _configurationValueProvider.GetValue(ConfigurationKeys.StorageConnectionString); var servicebusConnectionString = _configurationValueProvider.GetValue(ConfigurationKeys.ServiceBusConnectionString); container.Register( Component.For<IElasticsearchClient>() .ImplementedBy<ElasticsearchClient>() .LifestyleSingleton(), Component.For<Orchestrator>() .ImplementedBy<Orchestrator>() .LifestyleSingleton(), Component.For<MasterScheduler>() .ImplementedBy<MasterScheduler>() .LifestyleSingleton(), Component.For<IConfigurationValueProvider>() .Instance(_configurationValueProvider), Component.For<ISourceConfiguration>() .ImplementedBy<TableStorageConfigurationSource>(), Component.For<IServiceLocator>() .Instance(serviceLocator), Component.For<IActorConfiguration>() .Instance( ActorDescriptors.FromAssemblyContaining<ShardRangeActor>() .ToConfiguration()), Component.For<IFactoryActor>() .ImplementedBy<FactoryActor>() .LifestyleTransient(), Component.For<IHttpClient>() .ImplementedBy<DefaultHttpClient>() .LifestyleSingleton(), Component.For<ShardKeyActor>() .ImplementedBy<ShardKeyActor>() .LifestyleTransient(), Component.For<ShardRangeActor>() .ImplementedBy<ShardRangeActor>() .LifestyleTransient(), Component.For<BlobFileActor>() .ImplementedBy<BlobFileActor>() .LifestyleTransient(), Component.For<IisBlobScheduler>() .ImplementedBy<IisBlobScheduler>() .LifestyleTransient(), Component.For<RangeShardKeyScheduler>() .ImplementedBy<RangeShardKeyScheduler>() .LifestyleTransient(), Component.For<MinuteTableShardScheduler>() .ImplementedBy<MinuteTableShardScheduler>() .LifestyleTransient(), Component.For<ReverseTimestampMinuteTableShardScheduler>() .ImplementedBy<ReverseTimestampMinuteTableShardScheduler>() .LifestyleTransient(), Component.For<IisLogParser>() .ImplementedBy<IisLogParser>() .LifestyleTransient(), Component.For<IElasticsearchBatchPusher>() .ImplementedBy<ElasticsearchBatchPusher>() .LifestyleTransient() .DependsOn(Dependency.OnValue("esUrl", _configurationValueProvider.GetValue(ConfigurationKeys.ElasticSearchUrl))), Component.For<ILockStore>() .Instance(new AzureLockStore(new BlobSource() { ConnectionString = storageConnectionString, ContainerName = "locks", Path = "conveyor_belt/locks/master_Keys/" })), Component.For<IEventQueueOperator>() .Instance(new ServiceBusOperator(servicebusConnectionString)) ); _orchestrator = container.Resolve<Orchestrator>(); _scheduler = container.Resolve<MasterScheduler>(); }
public static void SetupDi(IWindsorContainer container, IConfigurationValueProvider configurationValueProvider, IPulser[] pulsers) { var serviceLocator = new WindsorServiceLocator(container); container.Register( Component.For <Orchestrator>() .ImplementedBy <Orchestrator>() .LifestyleTransient(), Component.For <IActorConfiguration>() .Instance( ActorDescriptors.FromAssemblyContaining <NewsItemCaptured>() .ToConfiguration()), Component.For <IServiceLocator>() .Instance(serviceLocator), Component.For <IPulser[]>() .Instance(pulsers), Component.For <PulserPublisher>() .ImplementedBy <PulserPublisher>() .LifestyleSingleton(), Component.For <IFactoryActor>() .ImplementedBy <FactoryActor>() .LifestyleTransient(), Component.For <IEventQueueOperator>() .ImplementedBy <ServiceBusOperator>() .DynamicParameters((k, dic) => { dic["connectionString"] = configurationValueProvider.GetValue( "BusConnectionString"); }) .LifestyleSingleton(), Component.For(typeof(ICollectionStore <>)) .ImplementedBy(typeof(AzureCollectionStore <>)) .DynamicParameters((k, dic) => { dic["connectionString"] = configurationValueProvider.GetValue("StorageConnectionString"); }) .LifestyleSingleton(), Component.For(typeof(IKeyValueStore)) .ImplementedBy(typeof(AzureKeyValueStore)) .DynamicParameters((k, dic) => { dic["connectionString"] = configurationValueProvider.GetValue("StorageConnectionString"); dic["bucketName"] = "feeds"; }) .LifestyleSingleton(), Classes.FromAssemblyContaining <NewsFeedPulsed>() .Pick() ); }
public ReverseTimestampMinuteTableShardScheduler(IConfigurationValueProvider configurationValueProvider) : base(configurationValueProvider) { }
public IisBlobScheduler(ILockStore lockStore, IConfigurationValueProvider configurationValueProvider) : base(lockStore, configurationValueProvider) { }
public RangeShardKeyScheduler(ILockStore lockStore, IConfigurationValueProvider configurationValueProvider) : base(lockStore, configurationValueProvider) { }
public BaseScheduler(ILockStore lockStore, IConfigurationValueProvider configurationValueProvider) { _configurationValueProvider = configurationValueProvider; _lockStore = lockStore; }
public TokenDateTimeVerifier(IConfigurationValueProvider configProvider) { this.configProvider = configProvider; }
public AzureStorageManager(IConfigurationValueProvider configurationValueProvider) { _configurationValueProvider = configurationValueProvider; }
public StringCryptoTransformer(IConfigurationValueProvider configProvider) { this.configProvider = configProvider; }
public SweeperActor(IDynamoStore dynamoStore, IConfigurationValueProvider configurationValueProvider) { _configurationValueProvider = configurationValueProvider; _dynamoStore = dynamoStore; }
public MinuteTableShardScheduler(IConfigurationValueProvider configurationValueProvider) : base(configurationValueProvider) { }
public SimpleBlobScheduler(IConfigurationValueProvider configurationValueProvider) : base(configurationValueProvider) { }
public EmailMessenger(IConfigurationValueProvider configurationValueProvider) { _configurationValueProvider = configurationValueProvider; }
public TokenDateTimeVerifier() { this.configProvider = new NameValueSectionConfigurationProvider( ConfigSectionsResource.DefaultTokenDateTimeVerifierSectionName); }
public TableStorageConfigurationSource(IConfigurationValueProvider configurationValueProvider) { MakeSureTableIsThere(configurationValueProvider); }
public static void SetupDi(IWindsorContainer container, IConfigurationValueProvider configurationValueProvider, IPulser[] pulsers) { var serviceLocator = new WindsorServiceLocator(container); container.Register( Component.For<Orchestrator>() .ImplementedBy<Orchestrator>() .LifestyleTransient(), Component.For<IActorConfiguration>() .Instance( ActorDescriptors.FromAssemblyContaining<NewsItemCaptured>() .ToConfiguration()), Component.For<IServiceLocator>() .Instance(serviceLocator), Component.For<IPulser[]>() .Instance(pulsers), Component.For<PulserPublisher>() .ImplementedBy<PulserPublisher>() .LifestyleSingleton(), Component.For<IFactoryActor>() .ImplementedBy<FactoryActor>() .LifestyleTransient(), Component.For<IEventQueueOperator>() .ImplementedBy<ServiceBusOperator>() .DynamicParameters((k, dic) => { dic["connectionString"] = configurationValueProvider.GetValue( "BusConnectionString"); }) .LifestyleSingleton(), Component.For(typeof(ICollectionStore<>)) .ImplementedBy(typeof(AzureCollectionStore<>)) .DynamicParameters((k, dic) => { dic["connectionString"] = configurationValueProvider.GetValue("StorageConnectionString"); }) .LifestyleSingleton(), Component.For(typeof(IKeyValueStore)) .ImplementedBy(typeof(AzureKeyValueStore)) .DynamicParameters((k, dic) => { dic["connectionString"] = configurationValueProvider.GetValue("StorageConnectionString"); dic["bucketName"] = "feeds"; }) .LifestyleSingleton(), Classes.FromAssemblyContaining<NewsFeedPulsed>() .Pick() ); }
public RecordImporterActor(IConfigurationValueProvider configurationValueProvider) { _configurationValueProvider = configurationValueProvider; }
protected static void Setup() { var container = new WindsorContainer(); var serviceLocator = new WindsorServiceLocator(container); _configurationValueProvider = new AppSettingsConfigProvider(); var storageConnectionString = _configurationValueProvider.GetValue(ConfigurationKeys.StorageConnectionString); var servicebusConnectionString = _configurationValueProvider.GetValue(ConfigurationKeys.ServiceBusConnectionString); var headersText = _configurationValueProvider.GetValue(ConfigurationKeys.TabSeparatedCustomEsHttpHeaders); var headers = new List <KeyValuePair <string, string> >(); if (headersText != null) { foreach (var header in headersText.Split('\t')) { var strings = header.Split(new[] { ": " }, StringSplitOptions.RemoveEmptyEntries); if (strings.Length == 2) { headers.Add(new KeyValuePair <string, string>(strings[0], strings[1])); } } } container.Register( Component.For <IElasticsearchClient>() .ImplementedBy <ElasticsearchClient>() .LifestyleSingleton(), Component.For <Orchestrator>() .ImplementedBy <Orchestrator>() .LifestyleSingleton(), Component.For <MasterScheduler>() .ImplementedBy <MasterScheduler>() .LifestyleSingleton(), Component.For <IConfigurationValueProvider>() .Instance(_configurationValueProvider), Component.For <ISourceConfiguration>() .ImplementedBy <TableStorageConfigurationSource>(), Component.For <IServiceLocator>() .Instance(serviceLocator), Component.For <IActorConfiguration>() .Instance( ActorDescriptors.FromAssemblyContaining <ShardRangeActor>() .ToConfiguration()), Component.For <IFactoryActor>() .ImplementedBy <FactoryActor>() .LifestyleTransient(), Component.For <IHttpClient>() .ImplementedBy <DefaultHttpClient>() .LifestyleSingleton() .DependsOn(Dependency.OnValue("defaultHeaders", headers)), Component.For <ShardKeyActor>() .ImplementedBy <ShardKeyActor>() .LifestyleTransient(), Component.For <ShardRangeActor>() .ImplementedBy <ShardRangeActor>() .LifestyleTransient(), Component.For <BlobFileActor>() .ImplementedBy <BlobFileActor>() .LifestyleTransient(), Component.For <BlobFileConventionActor>() .ImplementedBy <BlobFileConventionActor>() .LifestyleTransient(), Component.For <ITempDownloadLocationProvider>() .ImplementedBy <TempDownloadLocationProvider>() .LifestyleSingleton(), Component.For <IisBlobScheduler>() .ImplementedBy <IisBlobScheduler>() .LifestyleTransient(), Component.For <IisBlobConventionScheduler>() .ImplementedBy <IisBlobConventionScheduler>() .LifestyleTransient(), Component.For <RangeShardKeyScheduler>() .ImplementedBy <RangeShardKeyScheduler>() .LifestyleTransient(), Component.For <MinuteTableShardScheduler>() .ImplementedBy <MinuteTableShardScheduler>() .LifestyleTransient(), Component.For <ReverseTimestampMinuteTableShardScheduler>() .ImplementedBy <ReverseTimestampMinuteTableShardScheduler>() .LifestyleTransient(), Component.For <IisLogParser>() .ImplementedBy <IisLogParser>() .LifestyleTransient(), Component.For <IElasticsearchBatchPusher>() .ImplementedBy <ElasticsearchBatchPusher>() .LifestyleTransient() .DependsOn(Dependency.OnValue("esUrl", _configurationValueProvider.GetValue(ConfigurationKeys.ElasticSearchUrl))), Component.For <ILockStore>() .Instance(new AzureLockStore(new BlobSource() { ConnectionString = storageConnectionString, ContainerName = "locks", Path = "conveyor_belt/locks/master_Keys/" })), Component.For <IEventQueueOperator>() .Instance(new ServiceBusOperator(servicebusConnectionString)) ); _orchestrator = container.Resolve <Orchestrator>(); _scheduler = container.Resolve <MasterScheduler>(); }
public AuthenticationTokenProvider(IConfigurationValueProvider configurationValueProvider) { _configurationValueProvider = configurationValueProvider; }