Ejemplo n.º 1
0
        public void Run(DataComponentFacade facade)
        {
            var dbProv    = DataProviderManager.ReadDatabaseDataProviders();
            var providers = DataProviderManager.LoadExternalDataProviders(dbProv, facade.InterfaceType);

            Run(providers);
        }
Ejemplo n.º 2
0
        public IEnumerable <TInterface> CreateDataProviders(SourceUsageOrder sourceUsageOrder)
        {
            DataProvidersConfigurationSection section = DataProvidersConfigurationSection.GetCurrent();

            DataProvider[] dbProviders = DataProviderManager.ReadDatabaseDataProviders();

            var dataProviders = DataProviderManager.GetDataProviderList(section, dbProviders, typeof(TInterface), sourceUsageOrder)
                                .Select(p => p as TInterface);

            return(dataProviders);
        }
Ejemplo n.º 3
0
        public StandardReturType CreateDataProviders(out IEnumerable <ISingleDataProvider <TInputElement, TOutputElement> > dataProviders, SourceUsageOrder sourceUsageOrder)
        {
            DataProvidersConfigurationSection section = DataProvidersConfigurationSection.GetCurrent();

            DataProvider[] dbProviders = DataProviderManager.ReadDatabaseDataProviders();

            dataProviders = DataProviderManager.GetDataProviderList(section, dbProviders, InterfaceType, sourceUsageOrder)
                            .Select(p => p as ISingleDataProvider <TInputElement, TOutputElement>);
            if (dataProviders.FirstOrDefault() == null)
            {
                Local.Admin.AddNewLog(TraceEventType.Warning, BrokerContext.Current.WebMethodMessageName, TextMessages.NoDataProvidersFound, null, null);
                return(StandardReturType.Create(HttpErrorCode.DATASOURCE_UNAVAILABLE));
            }
            return(StandardReturType.OK());
        }
Ejemplo n.º 4
0
        public virtual SubMethodRunState[] CreateSubMethodRunStates(out bool missingDataProvidersExist)
        {
            DataProvidersConfigurationSection section = DataProvidersConfigurationSection.GetCurrent();

            DataProvider[] dbProviders = DataProviderManager.ReadDatabaseDataProviders();

            var subMethodRunStates = this.SubMethodInfos
                                     .Select(mi => new SubMethodRunState()
            {
                SubMethodInfo = mi,
                DataProviders = mi.GetDataProviderList(section, dbProviders)
            })
                                     .ToArray();

            // Now check that each method call info either has at least one clearData provider implementation or can be safely ignored.
            missingDataProvidersExist = subMethodRunStates.Where(mi => mi.SubMethodInfo.FailIfNoDataProvider && mi.DataProviders.FirstOrDefault() == null).FirstOrDefault() != null;

            return(subMethodRunStates);
        }