Exemplo n.º 1
0
 public CacheManager(
     IGiasApiClient giasApiClient,
     IStateRepository stateRepository,
     IEstablishmentRepository establishmentRepository,
     IGroupRepository groupRepository,
     ILocalAuthorityRepository localAuthorityRepository,
     IMapper mapper,
     IEventPublisher eventPublisher,
     IEstablishmentProcessingQueue establishmentProcessingQueue,
     IGroupProcessingQueue groupProcessingQueue,
     ILocalAuthorityProcessingQueue localAuthorityProcessingQueue,
     CacheConfiguration configuration,
     ILoggerWrapper logger)
 {
     _giasApiClient            = giasApiClient;
     _stateRepository          = stateRepository;
     _establishmentRepository  = establishmentRepository;
     _groupRepository          = groupRepository;
     _localAuthorityRepository = localAuthorityRepository;
     _mapper         = mapper;
     _eventPublisher = eventPublisher;
     _establishmentProcessingQueue  = establishmentProcessingQueue;
     _groupProcessingQueue          = groupProcessingQueue;
     _localAuthorityProcessingQueue = localAuthorityProcessingQueue;
     _configuration = configuration;
     _logger        = logger;
 }
Exemplo n.º 2
0
        static void Init(CommandLineOptions options)
        {
            _giasApiClient = new GiasSoapApiClient(new GiasApiConfiguration
            {
                Url       = options.GiasSoapEndpoint,
                Username  = options.GiasSoapUsername,
                Password  = options.GiasSoapPassword,
                ExtractId = options.ExtractId,
                ExtractEstablishmentsFileName = options.EstablishmentsFileName,
                ExtractGroupsFileName         = options.GroupsFileName,
                ExtractGroupLinksFileName     = options.GroupLinksFileName,
            });

            var cacheConfiguration = new CacheConfiguration
            {
                TableStorageConnectionString = options.StorageConnectionString,
                EstablishmentTableName       = options.EstablishmentsTableName,
                GroupTableName          = options.GroupsTableName,
                LocalAuthorityTableName = options.LocalAuthoritiesTableName,
            };

            _establishmentRepository  = new TableEstablishmentRepository(cacheConfiguration, _logger);
            _groupRepository          = new TableGroupRepository(cacheConfiguration, _logger);
            _localAuthorityRepository = new TableLocalAuthorityRepository(cacheConfiguration, _logger);
        }
Exemplo n.º 3
0
 public LearningProviderManager(
     IGiasApiClient giasApiClient,
     IEstablishmentRepository establishmentRepository,
     IMapper mapper,
     ILoggerWrapper logger)
 {
     _giasApiClient           = giasApiClient;
     _establishmentRepository = establishmentRepository;
     _mapper = mapper;
     _logger = logger;
 }
Exemplo n.º 4
0
        static void Init(CommandLineOptions options)
        {
            _giasApiClient = new GiasSoapApiClient(new GiasApiConfiguration
            {
                Url       = options.GiasUrl,
                Username  = options.GiasUsername,
                Password  = options.GiasPassword,
                ExtractId = options.GiasExtractId,
                ExtractEstablishmentsFileName = "Eapim_Daily_Download.csv",
                ExtractGroupsFileName         = "groups.csv",
                ExtractGroupLinksFileName     = "groupLinks.csv",
            });

            _httpSpiExecutionContextManager = new HttpSpiExecutionContextManager();
            _httpSpiExecutionContextManager.SetInternalRequestId(Guid.NewGuid());

            var translator = new TranslatorApiClient(
                new AuthenticationConfiguration()
            {
                ClientId      = options.ClientId,
                ClientSecret  = options.ClientSecret,
                Resource      = options.Resource,
                TokenEndpoint = options.TokenEndpoint,
            },
                new RestClient(),
                new CacheProvider(),
                _httpSpiExecutionContextManager,
                new TranslatorConfiguration
            {
                BaseUrl         = options.TranslatorBaseUrl,
                SubscriptionKey = options.TranslatorSubscriptionKey,
            },
                _logger);

            _groupRepository = new InProcGroupRepository();

            _localAuthorityRepository = new InProcLocalAuthorityRepository();

            _mapper = new PocoMapper(translator, _groupRepository, _localAuthorityRepository);
        }