/// <summary> /// Builds the Advanced Structure controller for SDMX V21 SOAP. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <param name="soapOperation"> /// The SOAP operation. /// </param> /// <returns> /// The <see cref="IController{XmlNode,XmlWriter}"/>. /// </returns> public IController<Message, XmlWriter> BuildAdvancedQueryStructureV21(DataflowPrincipal principal, SoapOperation soapOperation) { IWriterBuilder<IStructureWriterManager, XmlWriter> structureManagerBuilder = new StructureBuilder(WebServiceEndpoint.StandardEndpoint, _sdmxSchemaV21); IResponseGenerator<XmlWriter, ISdmxObjects> responseGenerator = new StructureResponseGenerator(structureManagerBuilder, StructureOutputFormatEnumType.SdmxV21StructureDocument); var structureRequestController = new StructureRequestV21AdvancedController<XmlWriter>( responseGenerator, this._authAdvancedMutableStructureSearchManager, this._advancedMutableStructureSearchManager, principal, soapOperation); return structureRequestController; }
/// <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; }
/// <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); }
private SdmxJsonDataController<Newtonsoft.Json.JsonTextWriter> GetSdmxJsonDataController(BaseDataFormat dataFormat, SdmxSchema sdmxSchema, DataflowPrincipal principal) { SdmxJsonDataController<Newtonsoft.Json.JsonTextWriter> sdmxjsonDataController; var dataWriterBuilder = new SdmxJsonDataWriterBuilder(dataFormat, sdmxSchema); var sdmxjsonDataResponseGenerator = new SdmxJsonDataResponseGenerator<Newtonsoft.Json.JsonTextWriter>(this.SdmxJsonGetDataRetrievalWithWriter(), dataWriterBuilder); sdmxjsonDataController = new SdmxJsonDataController<Newtonsoft.Json.JsonTextWriter>(sdmxjsonDataResponseGenerator, new DataRequestValidator(dataFormat, sdmxSchema), principal); return sdmxjsonDataController; }
/// <summary> /// Builds the CSV ziped data controller for SDMX V21. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <param name="baseDataFormat"> /// The base data format. /// </param> /// <param name="sdmxSchema"> /// The SDMX schema. /// </param> /// <returns> /// The <see cref="IController{XmlNode,XmlWriter}"/>. /// </returns> /// <exception cref="SdmxSemmanticException"> /// Impossible request. Requested CrossSectional for SDMX v2.1. /// </exception> public IController<IRestDataQuery, CsvZipTextWriter> BuildCsvZipDataRest(DataflowPrincipal principal, BaseDataFormat baseDataFormat, SdmxSchema sdmxSchema) { CsvZipDataController<CsvZipTextWriter> CsvZipDataController; var dataWriterBuilder = new CsvZipDataWriterBuilder(baseDataFormat, sdmxSchema); var CsvZipDataResponseGenerator = new CsvZipDataResponseGenerator<CsvZipTextWriter>(this.GetDataRetrievalWithWriter(sdmxSchema.EnumType), dataWriterBuilder); CsvZipDataController = new CsvZipDataController<CsvZipTextWriter>(CsvZipDataResponseGenerator, new DataRequestValidator(baseDataFormat, sdmxSchema), principal); return CsvZipDataController; }
/// <summary> /// Builds the query structure for REST for the specified <paramref name="schema"/>. /// </summary> /// <param name="schema"> /// The SDMX schema version. /// </param> /// <param name="principal"> /// The principal. /// </param> /// <returns> /// The <see cref="IController{IRestStructureQuery,XmlWriter}"/>. /// </returns> public IController<IRestStructureQuery, XmlWriter> BuildQueryStructureRest(SdmxSchema schema, DataflowPrincipal principal) { IWriterBuilder<IStructureWriterManager, XmlWriter> structureManagerBuilder = new StructureBuilder(WebServiceEndpoint.StandardEndpoint, schema); StructureOutputFormatEnumType outputFormat; IAuthMutableStructureSearchManager authMutableStructureSearchManager; IMutableStructureSearchManager mutableStructureSearchManager; switch (schema.EnumType) { case SdmxSchemaEnumType.VersionTwo: authMutableStructureSearchManager = this._authMutableStructureSearchManagerV20; mutableStructureSearchManager = this._mutableStructureSearchManagerV20; outputFormat = StructureOutputFormatEnumType.SdmxV2StructureDocument; break; default: authMutableStructureSearchManager = this._authMutableStructureSearchManagerV21; mutableStructureSearchManager = this._mutableStructureSearchManagerV21; outputFormat = StructureOutputFormatEnumType.SdmxV21StructureDocument; break; } IResponseGenerator<XmlWriter, ISdmxObjects> responseGenerator = new StructureResponseGenerator(structureManagerBuilder, outputFormat); var structureRequestController = new StructureRequestRestController<XmlWriter>(responseGenerator, mutableStructureSearchManager, authMutableStructureSearchManager, principal); return structureRequestController; }
/// <summary> /// Initializes a new instance of the <see cref="DataControllerBase"/> class. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <exception cref="SdmxSemmanticException"> /// Operation not accepted with query used /// </exception> protected DataControllerBase(DataflowPrincipal principal) { this._principal = principal; this._sdmxRetrievalManager = new MappingStoreSdmxObjectRetrievalManager(SettingsManager.MappingStoreConnectionSettings); }
/// <summary> /// Builds the generic data controller for SDMX V21. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <param name="dataFormat"> /// The data format. /// </param> /// <returns> /// The <see cref="IController{XmlNode,XmlWriter}"/>. /// </returns> public IController<Message, XmlWriter> BuildDataV21Advanced(DataflowPrincipal principal, BaseDataFormat dataFormat) { var sdmxSchema = _sdmxSchemaV21; return this.GetAdvancedDataController(dataFormat, sdmxSchema, principal); }
public IController<Message, DsplTextWriter> BuildDsplDataFromMessage(DataflowPrincipal principal, BaseDataFormat baseDataFormat) { return this.GetDsplDataController(principal); }
/// <summary> /// Gets the DSPL 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 DsplDataController<DsplTextWriter> GetDsplDataController(BaseDataFormat dataFormat, SdmxSchema sdmxSchema, DataflowPrincipal principal) //{ // DsplDataController<DsplTextWriter> dsplDataController; // var dataWriterBuilder = new DsplDataWriterBuilder(dataFormat, sdmxSchema); // var dsplDataResponseGenerator = new DsplDataResponseGenerator<DsplTextWriter>(this.GetDataRetrievalWithWriter(sdmxSchema.EnumType), dataWriterBuilder); // dsplDataController = new DsplDataController<DsplTextWriter>(dsplDataResponseGenerator, new DataRequestValidator(dataFormat, sdmxSchema), principal); // return dsplDataController; //} private DsplDataController<DsplTextWriter> GetDsplDataController(DataflowPrincipal principal) { DsplDataController<DsplTextWriter> dsplDataController; var dataWriterBuilder = new DsplDataWriterBuilder(); var dsplDataResponseGenerator = new DsplDataResponseGenerator<DsplTextWriter>(this.GetDataRetrievalWithWriter(), dataWriterBuilder); dsplDataController = new DsplDataController<DsplTextWriter>(dsplDataResponseGenerator, new DsplDataFormat.Controller.DataRequestValidator(), principal); return dsplDataController; }
public IController<IRestDataQuery, DsplTextWriter> BuildDataRest(DataflowPrincipal principal) { return this.GetDsplDataController(principal); }
/// <summary> /// Builds the DSPL data controller for SDMX V21. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <param name="baseDataFormat"> /// The base data format. /// </param> /// <param name="sdmxSchema"> /// The SDMX schema. /// </param> /// <returns> /// The <see cref="IController{XmlNode,XmlWriter}"/>. /// </returns> /// <exception cref="SdmxSemmanticException"> /// Impossible request. Requested CrossSectional for SDMX v2.1. /// </exception> public IController<IRestDataQuery, DsplTextWriter> BuildDsplDataRest(DataflowPrincipal principal, BaseDataFormat baseDataFormat, SdmxSchema sdmxSchema) { DsplDataController<DsplTextWriter> dsplDataController; var dataWriterBuilder = new DsplDataWriterBuilder(baseDataFormat, sdmxSchema); var dsplDataResponseGenerator = new DsplDataResponseGenerator<DsplTextWriter>(this.GetDataRetrievalWithWriter(sdmxSchema.EnumType), dataWriterBuilder); dsplDataController = new DsplDataController<DsplTextWriter>(dsplDataResponseGenerator, new DataRequestValidator(baseDataFormat, sdmxSchema), principal); return dsplDataController; }
/// <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> /// Builds the generic data controller for SDMX V21. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <param name="baseDataFormat"> /// The base data format. /// </param> /// <param name="sdmxSchema"> /// The SDMX schema. /// </param> /// <returns> /// The <see cref="IController{XmlNode,XmlWriter}"/>. /// </returns> /// <exception cref="SdmxSemmanticException"> /// Impossible request. Requested CrossSectional for SDMX v2.1. /// </exception> public IController<IRestDataQuery, XmlWriter> BuildDataRest(DataflowPrincipal principal, BaseDataFormat baseDataFormat, SdmxSchema sdmxSchema) { return this.GetSimpleDataController(baseDataFormat, sdmxSchema, principal); }
/// <summary> /// Builds the query structure for SDMX v20 SOAP requests /// </summary> /// <param name="endpoint"> /// The endpoint. /// </param> /// <param name="principal"> /// The principal. /// </param> /// <returns> /// The <see cref="IController{XElement,XmlWriter}"/>. /// </returns> public IController<Message, XmlWriter> BuildQueryStructureV20FromMessage(WebServiceEndpoint endpoint, DataflowPrincipal principal) { IWriterBuilder<IStructureWriterManager, XmlWriter> structureManagerBuilder = new StructureBuilder(endpoint, _sdmxSchemaV20); IResponseGenerator<XmlWriter, ISdmxObjects> responseGenerator = new StructureResponseGenerator(structureManagerBuilder, StructureOutputFormatEnumType.SdmxV2RegistryQueryResponseDocument); var structureRequestController = new StructureRequestV20Controller<XmlWriter>( responseGenerator, this._mutableStructureSearchManagerV20, this._authMutableStructureSearchManagerV20, principal); return structureRequestController; }
/// <summary> /// Builds the generic data controller for SDMX V21. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <param name="baseDataFormat"> /// The base data format. /// </param> /// <returns> /// The <see cref="IController{XElement,XmlWriter}"/>. /// </returns> /// <exception cref="SdmxSemmanticException"> /// Impossible request. Requested CrossSectional for SDMX v2.1. /// </exception> public IController<Message, XmlWriter> BuildDataV20FromMessage(DataflowPrincipal principal, BaseDataFormat baseDataFormat) { return this.GetSimpleDataController(baseDataFormat, _sdmxSchemaV20, principal); }
/// <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 AdvancedDataController<XmlWriter>(dataResponseGenerator, new DataRequestValidator(dataFormat, sdmxSchema), principal, operation); return dataController; }
/// <summary> /// Builds the generic data controller for SDMX V20. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <returns> /// The <see cref="IController{XmlNode,XmlWriter}"/>. /// </returns> public IController<XmlNode, XmlWriter> BuildGenericDataV20(DataflowPrincipal principal) { var compactDataFormat = _genericDataFormat; var sdmxSchemaV20 = _sdmxSchemaV20; return this.GetSimpleDataController(compactDataFormat, sdmxSchemaV20, principal); }
/// <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; }
public IController<Message, CsvZipTextWriter> BuildCsvZipDataFromMessage(DataflowPrincipal principal, BaseDataFormat baseDataFormat) { return this.GetCsvZipDataController(baseDataFormat, _sdmxSchemaV20, principal); }
//private static readonly BaseDataFormat _jsonDataFormat; /// <summary> /// Builds the json data controller for SDMX V21. /// </summary> /// <param name="principal"> /// The principal. /// </param> /// <param name="baseDataFormat"> /// The base data format. /// </param> /// <param name="sdmxSchema"> /// The SDMX schema. /// </param> /// <returns> /// The <see cref="IController{XmlNode,XmlWriter}"/>. /// </returns> /// <exception cref="SdmxSemmanticException"> /// Impossible request. Requested CrossSectional for SDMX v2.1. /// </exception> public IController<IRestDataQuery, Newtonsoft.Json.JsonTextWriter> BuildJsonDataRest(DataflowPrincipal principal, BaseDataFormat baseDataFormat, SdmxSchema sdmxSchema) { return this.GetSdmxJsonDataController(baseDataFormat, sdmxSchema, principal); }
/// <summary> /// Gets the CsvZip 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 CsvZipDataController<CsvZipTextWriter> GetCsvZipDataController(BaseDataFormat dataFormat, SdmxSchema sdmxSchema, DataflowPrincipal principal) { CsvZipDataController<CsvZipTextWriter> CsvZipDataController; var dataWriterBuilder = new CsvZipDataWriterBuilder(dataFormat, sdmxSchema); var CsvZipDataResponseGenerator = new CsvZipDataResponseGenerator<CsvZipTextWriter>(this.GetDataRetrievalWithWriter(sdmxSchema.EnumType), dataWriterBuilder); CsvZipDataController = new CsvZipDataController<CsvZipTextWriter>(CsvZipDataResponseGenerator, new DataRequestValidator(dataFormat, sdmxSchema), principal); return CsvZipDataController; }
/// <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 compactDataFormat = _crossSectional; var sdmxSchemaV20 = _sdmxSchemaV20; return this.GetSimpleDataController(compactDataFormat, sdmxSchemaV20, principal); }