Beispiel #1
0
        private string TryGetJson(string nextPageUrl = "")
        {
            RestDataSource restDataSource = (RestDataSource)DataSource;
            RestConnection connection     = restDataSource.Connection;

            if (string.IsNullOrEmpty(Url))
            {
                throw new InvalidOperationException($"URL was null / empty in TryGetJsonDoc for data source {DataSource.Name}");
            }

            string?rawJson;

            try
            {
                if (!string.IsNullOrEmpty(nextPageUrl))
                {
                    rawJson = Client.DownloadString(nextPageUrl);
                }
                else
                {
                    if (restDataSource.Connection.Authorization == HttpAuthorization.OAuth2)
                    {
                        Dictionary <string, string> tokenPostDict = new();

                        foreach (KeyValue keyVal in connection.TokenBody !)
                        {
                            tokenPostDict[keyVal.Key !] = keyVal.Value !;
Beispiel #2
0
        public LeitorPassagemPendenteHandler(DbConnectionDataSource readOnlyDataSource,
                                             DbConnectionDataSource dataSource,
                                             ServiceBusDataSourceBase serviceBusDataSource,
                                             RestDataSource restDataSource
                                             )
        {
            _readOnlyDataSource   = readOnlyDataSource;
            _dataSource           = dataSource;
            _serviceBusDataSource = serviceBusDataSource;
            _restDataSource       = restDataSource;

            var nomeTopicPadrao = ServiceBusUtil.ObterNome();

            _obterConcessionariasQuery     = new ObterConcessionariasQuery(true, readOnlyDataSource, _dataSource);
            _obterPassagensQuery           = new ObterPassagensTopicQuery(_serviceBusDataSource, false, ServiceBusUtil.BatchSize, nomeTopicPadrao);
            _enviarPassagemParaAkkaCommand = new EnviarPassagemParaAkkaCommand(_restDataSource);
        }
Beispiel #3
0
 public ProcessadorPassagemReprovadaEdiCommand(RestDataSource dataSource) : base(dataSource)
 {
 }
 public TransacaoHandler()
 {
     ServiceBusDataSource = new ServiceBusDataSourceBase("TransacoesServiceBus", ServiceBusUtil.FactoriesCount);
     RestDataSource       = new RestDataSource("ProcessadorPassagensProcessadasApi");
 }
 public ProcessadorPassagemInvalidaArtespCommand(RestDataSource dataSource) : base(dataSource)
 {
 }
 public RestDataSourceViewModel(DataSource dataSource) : base(dataSource)
 {
     _restDataSource = (RestDataSource)dataSource;
 }
 public EnviarPassagemParkParaAkkaCommand(RestDataSource dataSource) : base(dataSource)
 {
 }
 public ProcessadorPassagemAprovadaParkCommand(RestDataSource dataSource) : base(dataSource)
 {
 }