Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        /// <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);
        }