Пример #1
0
        public CosmosDbScalingService(
            ILogger logger,
            ICosmosDbScalingRepositoryProvider cosmosDbScalingRepositoryProvider,
            IJobsApiClient jobsApiClient,
            ICacheProvider cacheProvider,
            ICosmosDbScalingConfigRepository cosmosDbScalingConfigRepository,
            ICosmosDbScallingResilliencePolicies cosmosDbScallingResilliencePolicies,
            ICosmosDbScalingRequestModelBuilder cosmosDbScalingRequestModelBuilder,
            ICosmosDbThrottledEventsFilter cosmosDbThrottledEventsFilter)
        {
            Guard.ArgumentNotNull(logger, nameof(logger));
            Guard.ArgumentNotNull(cosmosDbScalingRepositoryProvider, nameof(cosmosDbScalingRepositoryProvider));
            Guard.ArgumentNotNull(jobsApiClient, nameof(jobsApiClient));
            Guard.ArgumentNotNull(cacheProvider, nameof(cacheProvider));
            Guard.ArgumentNotNull(cosmosDbScalingRepositoryProvider, nameof(cosmosDbScalingRepositoryProvider));
            Guard.ArgumentNotNull(cosmosDbScallingResilliencePolicies, nameof(cosmosDbScallingResilliencePolicies));
            Guard.ArgumentNotNull(cosmosDbScalingRequestModelBuilder, nameof(cosmosDbScalingRequestModelBuilder));
            Guard.ArgumentNotNull(cosmosDbThrottledEventsFilter, nameof(cosmosDbThrottledEventsFilter));

            _logger = logger;
            _cosmosDbScalingRepositoryProvider = cosmosDbScalingRepositoryProvider;
            _cacheProvider = cacheProvider;
            _cosmosDbScalingConfigRepository    = cosmosDbScalingConfigRepository;
            _cosmosDbScalingRequestModelBuilder = cosmosDbScalingRequestModelBuilder;
            _jobsApiClient                 = jobsApiClient;
            _scalingRepositoryPolicy       = cosmosDbScallingResilliencePolicies.ScalingRepository;
            _cacheProviderPolicy           = cosmosDbScallingResilliencePolicies.CacheProvider;
            _scalingConfigRepositoryPolicy = cosmosDbScallingResilliencePolicies.ScalingConfigRepository;
            _jobsApiClientPolicy           = cosmosDbScallingResilliencePolicies.JobsApiClient;
            _cosmosDbThrottledEventsFilter = cosmosDbThrottledEventsFilter;
        }
Пример #2
0
        public CosmosDbScalingService(
            ILogger logger,
            ICosmosDbScalingRepositoryProvider cosmosDbScalingRepositoryProvider,
            IJobManagement jobManagement,
            ICacheProvider cacheProvider,
            ICosmosDbScalingConfigRepository cosmosDbScalingConfigRepository,
            ICosmosDbScalingResiliencePolicies cosmosDbScalingResiliencePolicies,
            ICosmosDbScalingRequestModelBuilder cosmosDbScalingRequestModelBuilder,
            ICosmosDbThrottledEventsFilter cosmosDbThrottledEventsFilter,
            IValidator <ScalingConfigurationUpdateModel> scalingConfigurationUpdateModelValidator)
        {
            Guard.ArgumentNotNull(logger, nameof(logger));
            Guard.ArgumentNotNull(cosmosDbScalingRepositoryProvider, nameof(cosmosDbScalingRepositoryProvider));
            Guard.ArgumentNotNull(jobManagement, nameof(jobManagement));
            Guard.ArgumentNotNull(cacheProvider, nameof(cacheProvider));
            Guard.ArgumentNotNull(cosmosDbScalingRepositoryProvider, nameof(cosmosDbScalingRepositoryProvider));
            Guard.ArgumentNotNull(cosmosDbScalingResiliencePolicies, nameof(cosmosDbScalingResiliencePolicies));
            Guard.ArgumentNotNull(cosmosDbScalingRequestModelBuilder, nameof(cosmosDbScalingRequestModelBuilder));
            Guard.ArgumentNotNull(cosmosDbThrottledEventsFilter, nameof(cosmosDbThrottledEventsFilter));
            Guard.ArgumentNotNull(scalingConfigurationUpdateModelValidator, nameof(scalingConfigurationUpdateModelValidator));
            Guard.ArgumentNotNull(cosmosDbScalingResiliencePolicies?.ScalingRepository, nameof(cosmosDbScalingResiliencePolicies.ScalingRepository));
            Guard.ArgumentNotNull(cosmosDbScalingResiliencePolicies?.CacheProvider, nameof(cosmosDbScalingResiliencePolicies.CacheProvider));
            Guard.ArgumentNotNull(cosmosDbScalingResiliencePolicies?.ScalingConfigRepository, nameof(cosmosDbScalingResiliencePolicies.ScalingConfigRepository));

            _logger = logger;
            _cosmosDbScalingRepositoryProvider = cosmosDbScalingRepositoryProvider;
            _cacheProvider = cacheProvider;
            _cosmosDbScalingConfigRepository    = cosmosDbScalingConfigRepository;
            _cosmosDbScalingRequestModelBuilder = cosmosDbScalingRequestModelBuilder;
            _jobManagement                            = jobManagement;
            _scalingRepositoryPolicy                  = cosmosDbScalingResiliencePolicies.ScalingRepository;
            _cacheProviderPolicy                      = cosmosDbScalingResiliencePolicies.CacheProvider;
            _scalingConfigRepositoryPolicy            = cosmosDbScalingResiliencePolicies.ScalingConfigRepository;
            _cosmosDbThrottledEventsFilter            = cosmosDbThrottledEventsFilter;
            _scalingConfigurationUpdateModelValidator = scalingConfigurationUpdateModelValidator;
        }