Ejemplo n.º 1
0
        /// <summary>
        /// Gets the simple data controller for SDMX v2.0 SOAP or REST.
        /// </summary>
        /// <param name="dataFormat">
        /// The compact data format.
        /// </param>
        /// <param name="sdmxSchema">
        /// The SDMX schema V20.
        /// </param>
        /// <param name="principal">
        /// The principal.
        /// </param>
        /// <returns>
        /// The <see cref="IController{XmlNode,XmlWriter}"/>.
        /// </returns>
        private SimpleDataController <XmlWriter> GetSimpleDataController(BaseDataFormat dataFormat, SdmxSchema sdmxSchema, DataflowPrincipal principal)
        {
            DataRequestValidator dataRequestValidator;
            IResponseGenerator <XmlWriter, IDataQuery> simpleDataResponseGenerator;

            if (dataFormat.EnumType == BaseDataFormatEnumType.CrossSectional)
            {
                if (sdmxSchema.EnumType != SdmxSchemaEnumType.VersionTwo)
                {
                    throw new SdmxSemmanticException("Impossible request. Requested CrossSectional for SDMX v2.1.");
                }

                var dataWriterBuilder = new CrossDataWriterBuilder();
                simpleDataResponseGenerator = new SimpleCrossDataResponseGenerator <XmlWriter>(this._retrievalWithCrossWriter, dataWriterBuilder);
                dataRequestValidator        = new DataRequestValidator(_crossSectional, _sdmxSchemaV20);
            }
            else
            {
                var dataWriterBuilder = new DataWriterBuilder(dataFormat, sdmxSchema);
                simpleDataResponseGenerator = new SimpleDataResponseGenerator <XmlWriter>(this.GetDataRetrievalWithWriter(sdmxSchema.EnumType), dataWriterBuilder);
                dataRequestValidator        = new DataRequestValidator(dataFormat, sdmxSchema);
            }

            var dataController = new DataController <IDataQuery, XmlWriter>(simpleDataResponseGenerator);
            IDataflowLogManager dataflowLogManager = new DataflowLogManager(dataFormat);
            var requestLogDataController           = new RequestLogDataController <IDataQuery, XmlWriter>(dataController, dataflowLogManager);

            var validatingDataController = new ValidatingDataController <IDataQuery, XmlWriter>(requestLogDataController, dataRequestValidator);
            var authDataController       = new AuthDataController <IDataQuery, XmlWriter>(validatingDataController, principal);

            var simpleDataController = new SimpleDataController <XmlWriter>(authDataController, this._mappingStoreSdmxObjectRetrievalManager);

            return(simpleDataController);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Builds the cross sectional data controller for SDMX V20.
 /// </summary>
 /// <param name="principal">
 /// The principal.
 /// </param>
 /// <returns>
 /// The <see cref="IController{XmlNode,XmlWriter}"/>.
 /// </returns>
 public IController<XmlNode, XmlWriter> BuildCrossSectionalDataV20(DataflowPrincipal principal)
 {
     var dataWriterBuilder = new CrossDataWriterBuilder();
     var simpleDataResponseGenerator = new SimpleCrossDataResponseGenerator<XmlWriter>(this._retrievalWithCrossWriter, dataWriterBuilder);
     var simpleDataController = new SimpleDataController<XmlWriter>(simpleDataResponseGenerator, new DataRequestValidator(_crossSectional, _sdmxSchemaV20), principal);
     return simpleDataController;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the simple data controller for SDMX v2.0 SOAP or REST.
        /// </summary>
        /// <param name="dataFormat">
        /// The compact data format.
        /// </param>
        /// <param name="sdmxSchema">
        /// The SDMX schema V20.
        /// </param>
        /// <param name="principal">
        /// The principal.
        /// </param>
        /// <returns>
        /// The <see cref="IController{XmlNode,XmlWriter}"/>.
        /// </returns>
        private SimpleDataController<XmlWriter> GetSimpleDataController(BaseDataFormat dataFormat, SdmxSchema sdmxSchema, DataflowPrincipal principal)
        {
            SimpleDataController<XmlWriter> simpleDataController;
            if (dataFormat.EnumType == BaseDataFormatEnumType.CrossSectional)
            {
                if (sdmxSchema.EnumType != SdmxSchemaEnumType.VersionTwo)
                {
                    throw new SdmxSemmanticException("Impossible request. Requested CrossSectional for SDMX v2.1.");
                }

                var dataWriterBuilder = new CrossDataWriterBuilder();
                var simpleDataResponseGenerator = new SimpleCrossDataResponseGenerator<XmlWriter>(this._retrievalWithCrossWriter, dataWriterBuilder);
                simpleDataController = new SimpleDataController<XmlWriter>(simpleDataResponseGenerator, new DataRequestValidator(_crossSectional, _sdmxSchemaV20), principal);
            }
            else
            {
                var dataWriterBuilder = new DataWriterBuilder(dataFormat, sdmxSchema);
                var simpleDataResponseGenerator = new SimpleDataResponseGenerator<XmlWriter>(this.GetDataRetrievalWithWriter(sdmxSchema.EnumType), dataWriterBuilder);
                simpleDataController = new SimpleDataController<XmlWriter>(simpleDataResponseGenerator, new DataRequestValidator(dataFormat, sdmxSchema), principal);
            }

            return simpleDataController;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets the simple data controller for SDMX v2.0 SOAP or REST.
        /// </summary>
        /// <param name="dataFormat">
        /// The compact data format.
        /// </param>
        /// <param name="sdmxSchema">
        /// The SDMX schema V20.
        /// </param>
        /// <param name="principal">
        /// The principal.
        /// </param>
        /// <returns>
        /// The <see cref="IController{XmlNode,XmlWriter}"/>.
        /// </returns>
        private SimpleDataController<XmlWriter> GetSimpleDataController(BaseDataFormat dataFormat, SdmxSchema sdmxSchema, DataflowPrincipal principal)
        {
            DataRequestValidator dataRequestValidator;
            IResponseGenerator<XmlWriter, IDataQuery> simpleDataResponseGenerator;
            if (dataFormat.EnumType == BaseDataFormatEnumType.CrossSectional)
            {
                if (sdmxSchema.EnumType != SdmxSchemaEnumType.VersionTwo)
                {
                    throw new SdmxSemmanticException("Impossible request. Requested CrossSectional for SDMX v2.1.");
                }

                var dataWriterBuilder = new CrossDataWriterBuilder();
                simpleDataResponseGenerator = new SimpleCrossDataResponseGenerator<XmlWriter>(this._retrievalWithCrossWriter, dataWriterBuilder);
                dataRequestValidator = new DataRequestValidator(_crossSectional, _sdmxSchemaV20);
            }
            else
            {
                var dataWriterBuilder = new DataWriterBuilder(dataFormat, sdmxSchema);
                simpleDataResponseGenerator = new SimpleDataResponseGenerator<XmlWriter>(this.GetDataRetrievalWithWriter(sdmxSchema.EnumType), dataWriterBuilder);
                dataRequestValidator = new DataRequestValidator(dataFormat, sdmxSchema);
            }

            var dataController = new DataController<IDataQuery, XmlWriter>(simpleDataResponseGenerator);
            IDataflowLogManager dataflowLogManager = new DataflowLogManager(dataFormat);
            var requestLogDataController = new RequestLogDataController<IDataQuery, XmlWriter>(dataController, dataflowLogManager);

            var validatingDataController = new ValidatingDataController<IDataQuery, XmlWriter>(requestLogDataController, dataRequestValidator);
            var authDataController = new AuthDataController<IDataQuery, XmlWriter>(validatingDataController, principal);

            var simpleDataController = new SimpleDataController<XmlWriter>(authDataController, this._mappingStoreSdmxObjectRetrievalManager);

            return simpleDataController;
        }