Exemplo n.º 1
0
        public static IStoreConfiguration SetDefaults(IStoreConfiguration configuration)
        {
            configuration.OriginalStorePath = "/var/source";
            configuration.RebuiltStorePath  = "/var/target";

            return(configuration);
        }
Exemplo n.º 2
0
        public static IServiceCollection ConfigureServices(this IServiceCollection serviceCollection, IConfiguration configuration)
        {
            IQueueConfiguration queueConfig = RabbitMqDefaultConfigLoader.SetDefaults(new RabbitMqQueueConfiguration());

            configuration.Bind(queueConfig);
            serviceCollection.AddTransient <IQueueConfiguration>(x => queueConfig);

            IStoreConfiguration storeConfig = AdaptationStoreConfigLoader.SetDefaults(new AdaptationStoreConfiguration());

            configuration.Bind(storeConfig);
            serviceCollection.AddTransient <IStoreConfiguration>(x => storeConfig);

            IProcessingConfiguration processingConfig = IcapProcessingConfigLoader.SetDefaults(new IcapProcessingConfiguration());

            configuration.Bind(processingConfig);
            serviceCollection.AddTransient <IProcessingConfiguration>(x => processingConfig);

            ICloudSdkConfiguration versionConfiguration = CloudSdkConfigLoader.SetDefaults(new CloudSdkConfiguration());

            configuration.Bind(versionConfiguration);
            serviceCollection.AddTransient <ICloudSdkConfiguration>(x => versionConfiguration);

            serviceCollection.AddTransient(typeof(IAdaptationServiceClient <>), typeof(RabbitMqClient <>));
            serviceCollection.AddTransient <IResponseProcessor, AdaptationOutcomeProcessor>();
            serviceCollection.AddTransient <IHttpService, HttpService.HttpService>();
            serviceCollection.AddSingleton <IRabbitMqConnectionFactory, RabbitMqConnectionFactory>();

            return(serviceCollection);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Adds the ability for a remote Redux Dev Tools Monitor to connect to this instance and interact with it.
 /// </summary>
 /// <typeparam name="T">The root state type</typeparam>
 /// <param name="buidler">The current builder allowing for chaining of requests</param>
 /// <returns>The configuration sent in</returns>
 public static IStoreConfiguration <T> UseReduxDevTools <T>(this IStoreConfiguration <T> builder, ConfigurationDelegate <DevToolsOptions> options = null)
 {
     builder.UseSingleton <ReduxConnection, DevToolsOptions>(options);
     builder.UseMiddleware <Middleware <T>, DevToolsOptions>(options);
     builder.UseRootReducer <Reducer <T>, DevToolsOptions>(options);
     return(builder);
 }
Exemplo n.º 4
0
        public VirtuosoSettings(IStoreConfiguration settings)
        {
            Settings = settings;
            var serializer = new XmlSerializer(typeof(Rulesets));

            Rulesets = (Rulesets)serializer.Deserialize(settings.Data.CreateReader());
        }
Exemplo n.º 5
0
        public void CreateQueueConfiguration()
        {
            var mockConfiguration = new Mock <IStoreConfiguration>();

            mockConfiguration.SetupAllProperties();

            defaultedConfiguration = AdaptationStoreConfigLoader.SetDefaults(mockConfiguration.Object);
        }
        public ConsulKeyValueStore(IStoreConfiguration storeConfig, IKeyValueWatcher watcher, IInitialKeyValuesProvider <T> provider, ILogger log)
        {
            this.StoreConfig = storeConfig;
            this.Watcher     = watcher;
            this.Provider    = provider;
            this.Log         = log;

            this.LoadValuesAndWatchAsync().Wait();
        }
Exemplo n.º 7
0
 public CloudProxyController(ILogger <TController> logger, IAdaptationServiceClient <AdaptationOutcomeProcessor> adaptationServiceClient, IFileUtility fileUtility,
                             ICloudSdkConfiguration cloudSdkConfiguration, IProcessingConfiguration processingConfiguration, IStoreConfiguration storeConfiguration, IZipUtility zipUtility,
                             IHttpService httpService)
 {
     _logger                  = logger ?? throw new ArgumentNullException(nameof(logger));
     _fileUtility             = fileUtility ?? throw new ArgumentNullException(nameof(fileUtility));
     _cloudSdkConfiguration   = cloudSdkConfiguration ?? throw new ArgumentNullException(nameof(cloudSdkConfiguration));
     _processingConfiguration = processingConfiguration ?? throw new ArgumentNullException(nameof(processingConfiguration));
     _storeConfiguration      = storeConfiguration ?? throw new ArgumentNullException(nameof(storeConfiguration));
     _adaptationServiceClient = adaptationServiceClient ?? throw new ArgumentNullException(nameof(adaptationServiceClient));
     _zipUtility              = zipUtility ?? throw new ArgumentNullException(nameof(zipUtility));
     _httpService             = httpService ?? throw new ArgumentNullException(nameof(httpService));
 }
        public NativeProxyApplication(IAdaptationServiceClient <AdaptationOutcomeProcessor> adaptationServiceClient,
                                      IAppConfiguration appConfiguration, IStoreConfiguration storeConfiguration, IProcessingConfiguration processingConfiguration, ILogger <NativeProxyApplication> logger)
        {
            _adaptationServiceClient = adaptationServiceClient ?? throw new ArgumentNullException(nameof(adaptationServiceClient));
            _appConfiguration        = appConfiguration ?? throw new ArgumentNullException(nameof(appConfiguration));
            if (storeConfiguration == null)
            {
                throw new ArgumentNullException(nameof(storeConfiguration));
            }
            if (processingConfiguration == null)
            {
                throw new ArgumentNullException(nameof(processingConfiguration));
            }
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _processingTimeoutDuration         = processingConfiguration.ProcessingTimeoutDuration;
            _processingCancellationTokenSource = new CancellationTokenSource(_processingTimeoutDuration);

            OriginalStorePath = storeConfiguration.OriginalStorePath;
            RebuiltStorePath  = storeConfiguration.RebuiltStorePath;
        }
Exemplo n.º 9
0
 public ConsulStringKeyValueStore(IStoreConfiguration storeConfig, IKeyValueWatcher watcher, IInitialKeyValuesProvider <string> provider, ILogger log)
     : base(storeConfig, watcher, provider, log)
 {
 }
 /// <summary>
 /// Changes the current activator to be the default one implemented by Redux Sharp.
 /// </summary>
 public static IStoreConfiguration <TState> UseDefaultActivator <TState>(this IStoreConfiguration <TState> configuration)
 => configuration.UseActivator <DefaultActivator>();
 public StoreElement(IStoreConfiguration config)
     : this(config.Id + " Store", config.Name, config.OutputPath)
 {
 }
Exemplo n.º 12
0
 public RebuildController(IAdaptationServiceClient <AdaptationOutcomeProcessor> adaptationServiceClient, IStoreConfiguration storeConfiguration,
                          IProcessingConfiguration processingConfiguration, ILogger <RebuildController> logger, IFileUtility fileUtility,
                          IZipUtility zipUtility, ICloudSdkConfiguration cloudSdkConfiguration, IHttpService httpService) : base(logger, adaptationServiceClient, fileUtility, cloudSdkConfiguration,
                                                                                                                                 processingConfiguration, storeConfiguration, zipUtility, httpService)
 {
 }
Exemplo n.º 13
0
        public RebuildController(IAdaptationServiceClient <AdaptationOutcomeProcessor> adaptationServiceClient, IStoreConfiguration storeConfiguration,
                                 IProcessingConfiguration processingConfiguration, ILogger <RebuildController> logger, IFileUtility fileUtility, ITracer tracer,
                                 IZipUtility zipUtility) : base(logger)
        {
            _adaptationServiceClient = adaptationServiceClient ?? throw new ArgumentNullException(nameof(adaptationServiceClient));
            _fileUtility             = fileUtility ?? throw new ArgumentNullException(nameof(fileUtility));
            _zipUtility = zipUtility ?? throw new ArgumentNullException(nameof(zipUtility));
            if (storeConfiguration == null)
            {
                throw new ArgumentNullException(nameof(storeConfiguration));
            }

            if (processingConfiguration == null)
            {
                throw new ArgumentNullException(nameof(processingConfiguration));
            }

            _processingTimeoutDuration         = processingConfiguration.ProcessingTimeoutDuration;
            _processingCancellationTokenSource = new CancellationTokenSource(_processingTimeoutDuration);

            _originalStorePath = storeConfiguration.OriginalStorePath;
            _rebuiltStorePath  = storeConfiguration.RebuiltStorePath;

            _tracer = tracer;
        }