public CallMmCodeDataProvider(IAmDataProvider dataProvider, IReadOnlyRepository repository, ILogCommandTypes logCommand)
 {
     _log = LogManager.GetLogger(GetType());
     _dataProvider = dataProvider;
     _repository = repository;
     _logCommand = logCommand;
 }
        public void CallSource(ICollection<IPointToLaceProvider> response)
        {
            var spec = new CanHandlePackageSpecification(DataProviderName.LSAutoVINMaster_I_DB, _request);

            if (!spec.IsSatisfied)
            {
                NotHandledResponse(response);
            }
            else
            {
                _dataProvider = _request.First().Package.DataProviders.Single(w => w.Name == DataProviderName.LSAutoVINMaster_I_DB);
                _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.LSAutoVINMaster_I_DB, _dataProvider,
                    _dataProvider.BillablleState.NoRecordState);

                _logCommand.LogBegin(new {_dataProvider});

                var consumer = new ConsumeSource(new HandleRgtVinDataProviderCall(),
                    new CallRgtVinDataProvider(_dataProvider, new DataProviderRepository(), _logCommand));
                consumer.ConsumeDataProvider(response);

                _logCommand.LogEnd(new {response});

                if (!response.HasRecords<IProvideDataFromRgtVin>()) CallFallbackSource(response, _command);
            }

            CallNextSource(response, _command);
        }
        public void CallSource(ICollection<IPointToLaceProvider> response)
        {
            var spec = new CanHandlePackageSpecification(DataProviderName.LSAutoVIN12_I_DB, _request);

            if (!spec.IsSatisfied || response.Exists<IProvideDataFromVin12>()) //don't execute again if we already have a vin 12 response cause vin12 can be a fallback for multiple DP
            {
                NotHandledResponse(response);
            }
            else
            {
                _dataProvider = _request.First().Package.DataProviders.Single(w => w.Name == DataProviderName.LSAutoVIN12_I_DB);
                _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.LSAutoVIN12_I_DB, _dataProvider,
                    _dataProvider.BillablleState.NoRecordState);

                _logCommand.LogBegin(new {_dataProvider});

                var consumer = new ConsumeSource(new HandleVin12SourceCall(),
                    new CallVin12DataProvider(_dataProvider, new DataProviderRepository(), _logCommand));

                consumer.ConsumeDataProvider(response);

                _logCommand.LogEnd(new {response});

                if (!response.HasRecords<IProvideDataFromVin12>()) CallFallbackSource(response, _command);
            }
            CallNextSource(response, _command);
        }
        public void CallSource(ICollection<IPointToLaceProvider> response)
        {
            var spec = new CanHandlePackageSpecification(DataProviderName.LSPropertySearch_E_WS, _request);
            if (!spec.IsSatisfied)
            {
                NotHandledResponse(response);
            }
            else
            {
                _dataProvider = _request.First().Package.DataProviders.Single(w => w.Name == DataProviderName.LSPropertySearch_E_WS);
                _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.LSPropertySearch_E_WS, _dataProvider,
                    _dataProvider.BillablleState.NoRecordState);

                _logCommand.LogBegin(new {_dataProvider});

                var consumer = new ConsumeSource(new HandleLightstonePropertyCall(),
                    new CallLightstonePropertyDataProvider(_dataProvider, _logCommand));
                consumer.ConsumeDataProvider(response);

                _logCommand.LogEnd(new {response});

                if (!response.HasRecords<IProvideDataFromLightstoneProperty>()) CallFallbackSource(response, _command);
            }

            CallNextSource(response, _command);
        }
        public void CallSource(ICollection<IPointToLaceProvider> response)
        {
            var spec = new CanHandlePackageSpecification(DataProviderName.Anpr, _request);

            if (!spec.IsSatisfied)
            {
                NotHandledResponse(response);
            }
            else
            {
                _dataProvider = _request.First().Package.DataProviders.Single(w => w.Name == DataProviderName.Anpr);
                _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.Anpr, _dataProvider);

                _logCommand.LogBegin(new {_dataProvider});

                //TODO: System.Data issue on the build server causes an error
                //var consumer = new ConsumeSource(new HandleAnprSourceCall(),
                //    new CallAnprExternalSource(_request,
                //        new RepositoryFactory(ConnectionFactory.ForLsCorporateAutoDatabase(),
                //            CacheConnectionFactory.LocalClient(), ConfigurationManager.ConnectionStrings["lace/source/database/anpr/certificates/configuration"].ConnectionString)));

                //consumer.ConsumeExternalSource(response, laceEvent);

                _logCommand.LogEnd(new {response});

                if (!response.OfType<IProvideDataFromAnpr>().Any() || response.OfType<IProvideDataFromAnpr>().First() == null)
                    CallFallbackSource(response, _command);
            }
        }
 public CallJisDataProvider(IAmDataProvider dataProvider, ISetupCertificateRepository repository, ILogCommandTypes logCommand)
 {
     _log = LogManager.GetLogger(GetType());
     _repository = repository;
     _dataProvider = dataProvider;
     _logCommand = logCommand;
 }
 public when_configuring_ivid_title_holder_request_message()
 {
     _request = new LicensePlateRequestBuilder().ForIvidTitleHolder();
     _response = new LaceResponseBuilder().WithIvidResponseHandled();
     _dataProvider =
         _request.GetFromRequest<IPointToLaceRequest>().Package.DataProviders.Single(w => w.Name == DataProviderName.IVIDTitle_E_WS);
 }
        public void CallSource(ICollection<IPointToLaceProvider> response)
        {
            var spec = new CanHandlePackageSpecification(DataProviderName.Audatex, _request);

            if (!spec.IsSatisfied)
            {
                NotHandledResponse(response);
            }
            else
            {
                _dataProvider = _request.First().Package.DataProviders.Single(w => w.Name == DataProviderName.Audatex);
                _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.Ivid, _dataProvider);

                _logCommand.LogBegin(new { _request, IvidResponse = response.OfType<IProvideDataFromIvid>().First() });

                var consumer = new ConsumeSource(new HandleAudatexSourceCall(), new CallAudatexDataProvider(_dataProvider,_logCommand));
                consumer.ConsumeDataProvider(response);

                _logCommand.LogEnd(new { response });

                if (!response.OfType<IProvideDataFromAudatex>().Any() || response.OfType<IProvideDataFromAudatex>().First() == null)
                    CallFallbackSource(response, _command);
            }

            CallNextSource(response, _command);
        }
        public void CallSource(ICollection<IPointToLaceProvider> response)
        {
            var spec = new CanHandlePackageSpecification(DataProviderName.Jis, _request);

            if (!spec.IsSatisfied)
            {
                NotHandledResponse(response);
            }
            else
            {
                _dataProvider = _request.First().Package.DataProviders.Single(w => w.Name == DataProviderName.Jis);
                _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.Jis, _dataProvider);

                //var consumer = new ConsumeSource(new HandleJisSourceCall(),
                //    new CallJisDataProvider(_dataProvider,
                //        new RepositoryFactory(ConnectionFactoryManager.ForLsCorporateAutoDatabase(),
                //            ConfigurationManager.ConnectionStrings["lace/source/database/jis/certificates/configuration"
                //                ].ConnectionString),_logCommand));
                //consumer.ConsumeDataProvider(response);

                if (!response.OfType<IProvideDataFromJis>().Any() || response.OfType<IProvideDataFromJis>().First() == null)
                    CallFallbackSource(response, _command);
            }

            CallNextSource(response, _command);
        }
 private LogCommandTypes(ISendCommandToBus commands, DataProviderCommandSource dataProviderName,
     IAmDataProvider dataProvider,DataProviderNoRecordState billNoRecords)
 {
     _commands = commands;
     _dataProviderName = dataProviderName;
     _log = LogManager.GetLogger(GetType());
     _dataProvider = dataProvider;
     _executeWatch = new StopWatchFactory().StopWatchForDataProvider(_dataProviderName);
     _requestWatch = new StopWatchFactory().StopWatchForDataProvider(_dataProviderName);
     _billNoRecords = billNoRecords;
 }
        public when_requesting_data_from_lightstone_source()
        {
            _command = MonitoringBusBuilder.ForLightstoneCommands(Guid.NewGuid());
            _requestDataFromSource = new RequestDataFromLightstoneAuto();
            _request = new LicensePlateRequestBuilder().ForLightstoneVinNumber();
            _response = new Collection<IPointToLaceProvider>();

            _dataProvider = _request.GetFromRequest<IPointToLaceRequest>()
                .Package.DataProviders.Single(w => w.Name == DataProviderName.LSAutoCarStats_I_DB);
            _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.LSAutoCarStats_I_DB, _dataProvider, DataProviderNoRecordState.NonBillable);

            _callTheSource = new CallLightstoneAutoDataProvider(_dataProvider, new FakeDataProviderRepository(), _logCommand);
        }
        public IvidDataRetriever ThenWithApi(HpiStandardQueryRequest request, IAmDataProvider dataProvider,
            out HpiStandardQueryResponse response)
        {
            if (NoNeedToCallApi)
            {
                response = null;
                return this;
            }

            var webService = new ConfigureIvid();

            _logCommand.LogSecurity(
                new
                {
                    Credentials =
                        new
                        {
                            webService.Client.ClientCredentials.UserName.UserName,
                            webService.Client.ClientCredentials.UserName.Password
                        }
                },
                new {ContextMessage = "Ivid Data Provider Credentials"});

            using (var scope = new OperationContextScope(webService.Client.InnerChannel))
            {
                OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] =
                    webService.RequestMessageProperty;

                _logCommand.LogConfiguration(request, null);
                _logCommand.LogRequest(new ConnectionTypeIdentifier(webService.Client.Endpoint.Address.ToString())
                    .ForWebApiType(), request, dataProvider.BillablleState.NoRecordState);

                response = webService
                    .Client
                    .HpiStandardQuery(request);

                webService.CloseWebService();

                _logCommand.LogResponse(CheckState(response),
                    new ConnectionTypeIdentifier(webService.Client.Endpoint.Address.ToString())
                        .ForWebApiType(), response ?? new HpiStandardQueryResponse(), dataProvider.BillablleState.NoRecordState);

                if (response == null)
                    _logCommand.LogFault(dataProvider,
                        new {NoRequestReceived = "No response received from Ivid Data Provider"});
            }

            return this;
        }
        public void CallSource(ICollection<IPointToLaceProvider> response)
        {
            var spec = new CanHandlePackageSpecification(DataProviderName.LSAutoCarStats_I_DB, _request);

            if (!spec.IsSatisfied)
            {
                NotHandledResponse(response);
            }
            else
            {
                _dataProvider = _request.First().Package.DataProviders.Single(w => w.Name == DataProviderName.LSAutoCarStats_I_DB);
                _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.LSAutoCarStats_I_DB, _dataProvider,_dataProvider.BillablleState.NoRecordState);

                var consumer = new ConsumeSource(new FakeHandleLighstoneSourceCall(),
                    new CallLightstoneAutoDataProvider(_dataProvider, new FakeDataProviderRepository(), _logCommand));
                consumer.ConsumeDataProvider(response);

                if (!response.OfType<IProvideDataFromLightstoneAuto>().Any() || response.OfType<IProvideDataFromLightstoneAuto>().First() == null)
                    CallFallbackSource(response, _command);
            }

            CallNextSource(response, _command);
        }
 public CallBmwFinanceDataProvider(IAmDataProvider dataProvider, IReadOnlyRepository repository, ILogCommandTypes logCommand)
 {
     _dataProvider = dataProvider;
     _repository = repository;
     _logCommand = logCommand;
 }
 public CallPCubedEzScoreDataProvider(IAmDataProvider dataProvider, ILogCommandTypes logCommand)
 {
     _log = LogManager.GetLogger(GetType());
     _dataProvider = dataProvider;
     _logCommand = logCommand;
 }
        public RequestPackage(IAmDataProvider[] dataProviders, Guid id, string name, long version, double packageCostPrice,
            double packageRecommendedPrice)
        {

            DataProviders = dataProviders;
            Id = id;
            Name = name;
            Version = version;
            PackageCostPrice = packageCostPrice;
            PackageRecommendedPrice = packageRecommendedPrice;
        }
 public CallLightstoneBusinessCompanyDataProvider(IAmDataProvider dataProvider, ILogCommandTypes logCommand)
 {
     _log = LogManager.GetLogger(GetType());
     _dataProvider = dataProvider;
     _logCommand = logCommand;
 }
 public when_requesting_ivid_data_from_the_cache()
 {
     _request = new[] { new LicensePlateNumberIvidOnlyRequest() };
     _dataProvider = _request.First().Package.DataProviders.Single(w => w.Name == DataProviderName.IVIDVerify_E_WS);
     _logCommand = LogCommandTypes.ForDataProvider(_command, DataProviderCommandSource.IVIDVerify_E_WS, _dataProvider, DataProviderNoRecordState.Billable);
 }
 public DataProviderIdentifier SetPrice(IAmDataProvider dataProvider)
 {
     CostPrice = dataProvider == null ? 0 : dataProvider.CostPrice;
     RecommendedPrice = dataProvider == null ? 0 : dataProvider.RecommendedPrice;
     return this;
 }
 public CallLightstoneAutoDataProvider(IAmDataProvider dataProvider, IReadOnlyRepository repository, ILogCommandTypes logCommand)
 {
     _dataProvider = dataProvider;
     _repository = repository;
     _logCommand = logCommand;
 }
 public DriversLicensePackage(IAmDataProvider[] dataProviders, Guid packageId)
 {
     _dataProviders = dataProviders;
     _packageId = packageId;
 }
 public CallConsumerSpecificationsDataProvider(IAmDataProvider dataProvider, ILogCommandTypes logCommand)
 {
     _log = LogManager.GetLogger(GetType());
     _dataProvider = dataProvider;
     _logCommand = logCommand;
 }
 public static HpiStandardQueryRequest IvidHpiStandardQueryRequest(IAmDataProvider dataProviders)
 {
     return
         HandleRequest.GetHpiStandardQueryRequest(dataProviders.GetRequest<IAmIvidStandardRequest>());
 }
 public CallIvidTitleHolderDataProvider(IAmDataProvider dataProvider, ILogCommandTypes logCommand)
 {
     _log = LogManager.GetLogger(GetType());
     _dataProvider = dataProvider;
     _logCommand = logCommand;
 }
 public static LogCommandTypes ForDataProvider(ISendCommandToBus commands, DataProviderCommandSource dataProviderName,
     IAmDataProvider dataProvider,DataProviderNoRecordState billNoRecords)
 {
     return new LogCommandTypes(commands,dataProviderName,dataProvider,billNoRecords);
 }
 public LicensePlateNumberPackage(IAmDataProvider[] dataProviders, Guid packageId)
 {
     _dataProviders = dataProviders;
     _packageId = packageId;
 }
Example #27
0
 public DataVM1(IAmDataProvider dataProvider)
 {
     _theData = dataProvider.GetData();
 }