示例#1
0
 public DataFabric(ConnectionMultiplexer connectionMultiplexer, IAdapterProvider <RedisKey> keyAdapterProvider, IAdapterProvider <RedisValue> valueAdapterProvider, TimeSpan?expiryWhenPutting = null)
 {
     _connectionMultiplexer = connectionMultiplexer;
     _keyAdapterProvider    = keyAdapterProvider;
     _valueAdapterProvider  = valueAdapterProvider;
     _expiryWhenPutting     = expiryWhenPutting;
 }
示例#2
0
 public AdapterAuthenticationHandler(IOptionsMonitor <CookieAuthenticationOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, OneTimeTokenService oneTimeTokenService, IAzureSessionService azureSessionService, IUserRepository userRepository, IDeploymentScopeRepository deploymentScopeRepository, IAdapterProvider adapterProvider) : base(options, logger, encoder, clock)
 {
     this.oneTimeTokenService       = oneTimeTokenService ?? throw new System.ArgumentNullException(nameof(oneTimeTokenService));
     this.azureSessionService       = azureSessionService ?? throw new System.ArgumentNullException(nameof(azureSessionService));
     this.userRepository            = userRepository ?? throw new System.ArgumentNullException(nameof(userRepository));
     this.deploymentScopeRepository = deploymentScopeRepository ?? throw new System.ArgumentNullException(nameof(deploymentScopeRepository));
     this.adapterProvider           = adapterProvider ?? throw new System.ArgumentNullException(nameof(adapterProvider));
 }
 public DeploymentScopesController(IDeploymentScopeRepository deploymentScopeRepository,
                                   IComponentRepository componentRepository,
                                   IAdapterProvider adapterProvider,
                                   IValidatorProvider validatorProvider) : base(validatorProvider)
 {
     this.deploymentScopeRepository = deploymentScopeRepository ?? throw new ArgumentNullException(nameof(deploymentScopeRepository));
     this.componentRepository       = componentRepository ?? throw new ArgumentNullException(nameof(componentRepository));
     this.adapterProvider           = adapterProvider ?? throw new ArgumentNullException(nameof(adapterProvider));
 }
示例#4
0
 public AdapterUpdateComponentActivity(
     IComponentRepository componentRepository,
     IDeploymentScopeRepository deploymentScopeRepository,
     IAdapterProvider adapterProvider)
 {
     this.componentRepository = componentRepository ?? throw new ArgumentNullException(nameof(componentRepository));
     this.deploymentScopeRepository = deploymentScopeRepository ?? throw new ArgumentNullException(nameof(deploymentScopeRepository));
     this.adapterProvider = adapterProvider ?? throw new ArgumentNullException(nameof(adapterProvider));
 }
示例#5
0
 public DeploymentScopeCreateCommandHandler(
     IDeploymentScopeRepository deploymentScopeRepository,
     IUserRepository userRepository,
     IAdapterProvider adapterProvider)
 {
     this.deploymentScopeRepository = deploymentScopeRepository ?? throw new ArgumentNullException(nameof(deploymentScopeRepository));
     this.userRepository            = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
     this.adapterProvider           = adapterProvider ?? throw new ArgumentNullException(nameof(adapterProvider));
 }
示例#6
0
        private static IAdapterProvider GetConfiguredProviderInstance(LocalRecordsSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            IAdapterProvider provider = Instancer.GetInstanceOfInterface <IAdapterProvider>(settings.ProviderAssemblyLocation, settings.ProviderClass);

            provider.Init(settings.ProviderParameter);

            return(provider);
        }
示例#7
0
        public void SetUp()
        {
            _redis       = ConnectionMultiplexer.Connect("localhost");
            _keyProvider = MockRepository.Mock <IAdapterProvider <RedisKey> >();
            var keyAdapter = MockRepository.Mock <IAdapter <string, RedisKey> >();

            keyAdapter.Stub(m => m.Adapt(string.Empty)).IgnoreArguments().Repeat.Any().DoInstead((Func <string, RedisKey>)(s => s));
            _keyProvider.Stub(m => m.Provide <string>()).Return(keyAdapter);
            _valueProvider = MockRepository.Mock <IAdapterProvider <RedisValue> >();
            var valueAdapter = MockRepository.Mock <IAdapter <string, RedisValue> >();

            valueAdapter.Stub(m => m.Adapt(Arg <string> .Is.Anything)).IgnoreArguments().Repeat.Any().DoInstead((Func <string, RedisValue>)(s => s));
            valueAdapter.Stub(m => m.Adapt(Arg <RedisValue> .Is.Anything)).IgnoreArguments().Repeat.Any().DoInstead((Func <RedisValue, string>)(s => s));
            _valueProvider.Stub(m => m.Provide <string>()).Return(valueAdapter);
        }
    public DeploymentScopeDefinitionValidator(IValidatorProvider validatorProvider, IAdapterProvider adapterProvider) : base(validatorProvider)
    {
        this.adapterProvider = adapterProvider ?? throw new System.ArgumentNullException(nameof(adapterProvider));

        RuleFor(obj => obj.DisplayName)
        .NotEmpty();

        RuleFor(obj => obj.Type)
        .Must(type => this.adapterProvider.GetAdapter(type) is not null)
        .WithMessage("{PropertyName} is out of range.");

        RuleFor(obj => obj.InputData)
        .NotEmpty();

        RuleFor(obj => obj)
        .MustAsync(ValidInputDataAsync)
        .WithMessage("{PropertyName} must match schema.");
    }
示例#9
0
        public static IAdapterProvider GetAdapterProvider(LocalRecordsSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            if (_instance == null)
            {
                lock (_padlock)
                {
                    if (_instance == null)
                    {
                        _instance = GetConfiguredProviderInstance(settings);
                    }
                }
            }

            return(_instance);
        }
 public ComponentTaskRunnerActivity(IOrganizationRepository organizationRepository,
                                    IDeploymentScopeRepository deploymentScopeRepository,
                                    IProjectRepository projectRepository,
                                    IComponentRepository componentRepository,
                                    IComponentTemplateRepository componentTemplateRepository,
                                    IComponentTaskRepository componentTaskRepository,
                                    IAzureSessionService azureSessionService,
                                    IAzureResourceService azureResourceService,
                                    IAdapterProvider adapterProvider,
                                    IRunnerOptions runnerOptions)
 {
     this.organizationRepository      = organizationRepository ?? throw new ArgumentNullException(nameof(organizationRepository));
     this.deploymentScopeRepository   = deploymentScopeRepository ?? throw new ArgumentNullException(nameof(deploymentScopeRepository));
     this.projectRepository           = projectRepository ?? throw new ArgumentNullException(nameof(projectRepository));
     this.componentRepository         = componentRepository ?? throw new ArgumentNullException(nameof(componentRepository));
     this.componentTemplateRepository = componentTemplateRepository ?? throw new ArgumentNullException(nameof(componentTemplateRepository));
     this.componentTaskRepository     = componentTaskRepository ?? throw new ArgumentNullException(nameof(componentTaskRepository));
     this.azureSessionService         = azureSessionService ?? throw new ArgumentNullException(nameof(azureSessionService));
     this.azureResourceService        = azureResourceService ?? throw new ArgumentNullException(nameof(azureResourceService));
     this.adapterProvider             = adapterProvider ?? throw new ArgumentNullException(nameof(adapterProvider));
     this.runnerOptions = runnerOptions ?? throw new ArgumentNullException(nameof(runnerOptions));
 }
示例#11
0
 public void Setup()
 {
     _mockTaskRepository  = MockRepository.GenerateStub <ITaskRepository>();
     _mockAdapterProvider = MockRepository.GenerateStub <IAdapterProvider>();
 }
示例#12
0
 public AdapterController(IAdapterProvider adapterProvider) : base()
 {
     this.adapterProvider = adapterProvider ?? throw new System.ArgumentNullException(nameof(adapterProvider));
 }
 public DeploymentScopeExpander(IAdapterProvider adapterProvider, IAuthorizationEndpointsResolver authorizationEndpointsResolver, TelemetryClient telemetryClient) : base(false, telemetryClient)
 {
     this.adapterProvider = adapterProvider ?? throw new ArgumentNullException(nameof(adapterProvider));
     this.authorizationEndpointsResolver = authorizationEndpointsResolver ?? throw new ArgumentNullException(nameof(authorizationEndpointsResolver));
 }
示例#14
0
 public DownloadProvider(ITaskRepository taskRepository, IAdapterProvider adapterProvider)
 {
     _taskRepository  = taskRepository;
     _adapterProvider = adapterProvider;
 }
示例#15
0
 public DeploymentScopesAuthorizationController(OneTimeTokenService oneTimeTokenService, IAdapterProvider adapterProvider, IAuthorizationEndpointsResolver authorizationEndpointsResolver) : base()
 {
     this.oneTimeTokenService            = oneTimeTokenService ?? throw new ArgumentNullException(nameof(oneTimeTokenService));
     this.adapterProvider                = adapterProvider ?? throw new ArgumentNullException(nameof(adapterProvider));
     this.authorizationEndpointsResolver = authorizationEndpointsResolver ?? throw new ArgumentNullException(nameof(authorizationEndpointsResolver));
 }