/// <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); }
/// <summary> /// Gets the Advanced (SDMX v2.1 SOAP) data controller. /// </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 IController <Message, XmlWriter> GetAdvancedDataController(BaseDataFormat dataFormat, SdmxSchema sdmxSchema, DataflowPrincipal principal) { var dataWriterBuilder = new DataWriterBuilder(dataFormat, sdmxSchema); var dataResponseGenerator = new AdvancedDataResponseGenerator <XmlWriter>(this._advancedRetrievalWithWriter, dataWriterBuilder); var operation = dataFormat.GetSoapOperation(SdmxSchemaEnumType.VersionTwoPointOne); var dataController = new DataController <IComplexDataQuery, XmlWriter>(dataResponseGenerator); IDataflowLogManager dataflowLogManager = new DataflowLogManager(dataFormat); var requestLogDataController = new RequestLogDataController <IComplexDataQuery, XmlWriter>(dataController, dataflowLogManager); var validatingDataController = new ValidatingDataController <IComplexDataQuery, XmlWriter>(requestLogDataController, new DataRequestValidator(dataFormat, sdmxSchema)); var authDataController = new AuthDataController <IComplexDataQuery, XmlWriter>(validatingDataController, principal); return(new AdvancedDataController <XmlWriter>(operation, authDataController, this._mappingStoreSdmxObjectRetrievalManager)); }
/// <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; }
/// <summary> /// Gets the Advanced (SDMX v2.1 SOAP) data controller. /// </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 IController<Message, XmlWriter> GetAdvancedDataController(BaseDataFormat dataFormat, SdmxSchema sdmxSchema, DataflowPrincipal principal) { var dataWriterBuilder = new DataWriterBuilder(dataFormat, sdmxSchema); var dataResponseGenerator = new AdvancedDataResponseGenerator<XmlWriter>(this._advancedRetrievalWithWriter, dataWriterBuilder); var operation = dataFormat.GetSoapOperation(SdmxSchemaEnumType.VersionTwoPointOne); var dataController = new DataController<IComplexDataQuery, XmlWriter>(dataResponseGenerator); IDataflowLogManager dataflowLogManager = new DataflowLogManager(dataFormat); var requestLogDataController = new RequestLogDataController<IComplexDataQuery, XmlWriter>(dataController, dataflowLogManager); var validatingDataController = new ValidatingDataController<IComplexDataQuery, XmlWriter>(requestLogDataController, new DataRequestValidator(dataFormat, sdmxSchema)); var authDataController = new AuthDataController<IComplexDataQuery, XmlWriter>(validatingDataController, principal); return new AdvancedDataController<XmlWriter>(operation, authDataController, this._mappingStoreSdmxObjectRetrievalManager); }