Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AuthAdvancedStructureRetriever"/> class.
        /// </summary>
        /// <param name="retrievalManager">
        /// The retrieval manager. It can be null in which case the <see cref="AdvancedStructureRetriever"/> will be used.
        /// </param>
        /// <param name="mappingStoreDatabase">
        /// The mapping Store Database.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="mappingStoreDatabase"/> is null.
        /// </exception>
        public AuthAdvancedStructureRetriever(IAdvancedSdmxMutableObjectRetrievalManager retrievalManager, Database mappingStoreDatabase)
        {
            if (mappingStoreDatabase == null)
            {
                throw new ArgumentNullException("mappingStoreDatabase");
            }

            this._retrievalManager         = retrievalManager ?? new AdvancedStructureRetriever(mappingStoreDatabase);
            this._retrievalEngineContainer = new RetrievalEngineContainer(mappingStoreDatabase);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AuthAdvancedStructureRetriever"/> class.
        /// </summary>
        /// <param name="retrievalManager">
        /// The retrieval manager. It can be null in which case the <see cref="AdvancedStructureRetriever"/> will be used.
        /// </param>
        /// <param name="mappingStoreDatabase">
        /// The mapping Store Database.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="mappingStoreDatabase"/> is null.
        /// </exception>
        public AuthAdvancedStructureRetriever(IAdvancedSdmxMutableObjectRetrievalManager retrievalManager, Database mappingStoreDatabase)
        {
            if (mappingStoreDatabase == null)
            {
                throw new ArgumentNullException("mappingStoreDatabase");
            }

            this._retrievalManager = retrievalManager ?? new AdvancedStructureRetriever(mappingStoreDatabase);
            this._retrievalEngineContainer = new RetrievalEngineContainer(mappingStoreDatabase);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns an instance of <see cref="IAdvancedSdmxMutableObjectRetrievalManager"/> created using the specified <paramref name="settings"/>
        /// </summary>
        /// <typeparam name="T">
        /// The type of settings
        /// </typeparam>
        /// <param name="settings">
        /// The settings.
        /// </param>
        /// <returns>
        /// The <see cref="IAdvancedSdmxMutableObjectRetrievalManager"/>.
        /// </returns>
        public IAdvancedSdmxMutableObjectRetrievalManager GetRetrievalManager <T>(T settings)
        {
            IAdvancedSdmxMutableObjectRetrievalManager manager = null;

            if (this._factoryMethod != null)
            {
                manager = this._factoryMethod(settings);
            }

            Func <object, IAdvancedSdmxMutableObjectRetrievalManager> method;

            if (_factoryMethods.TryGetValue(typeof(T), out method))
            {
                manager = method(settings);
            }

            return(manager);
        }