コード例 #1
0
ファイル: SIF_Request.cs プロジェクト: rubitek/OpenADK-csharp
// BEGIN EXTRA METHODS (C:/GitHub/rafidzal/OpenADK-java/adk-generator/../adk-generator/datadef/core/sif20/SIF_Request.txt.cs)

        /// <summary>
        /// Parses the list of SIF_Version elements and returns an array of SIFVersions
        /// </summary>
        /// <param name="failureLog">The log to write failures to, if any of the SIFVersions fail
        /// to be parsed.</param>
        /// <returns><An array of SIFVersion elements. This will never be null/returns>
        internal SifVersion[] parseRequestVersions(log4net.ILog failureLog)
        {
            if (failureLog == null)
            {
                failureLog = Adk.Log;
            }
            System.Collections.Generic.List <SifVersion> versionList = new System.Collections.Generic.List <SifVersion>();
            foreach (SifElement element in GetChildList(InfraDTD.SIF_REQUEST_SIF_VERSION))
            {
                SIF_Version candidate = (SIF_Version)element;
                SifVersion  version   = null;
                try {
                    // Check for "1.*" and "2.*"
                    String ver = candidate.Value;
                    if (ver != null)
                    {
                        if (ver.IndexOf(".*") > 0)
                        {
                            version = SifVersion.GetLatest(int.Parse(ver.Substring(0, 1)));
                        }
                        else
                        {
                            version = SifVersion.Parse(ver);
                        }
                    }
                } catch (ArgumentException exc) {
                    failureLog.Warn(String.Format("Unable to parse '{0}' from SIF_Request/SIF_Version as SIFVersion.", candidate.Value), exc);
                }
                catch (FormatException exc)
                {
                    failureLog.Warn(String.Format("Unable to parse '{0}' from SIF_Request/SIF_Version as SIFVersion.", candidate.Value), exc);
                }
                if (version != null && !versionList.Contains(version))
                {
                    versionList.Add(version);
                }
            }

            return(versionList.ToArray());
        }
コード例 #2
0
 /// <summary>
 /// Sets all SIF_Version object instances. All existing 
 /// <c>SIF_Version</c> instances 
 /// are removed and replaced with this list. Calling this method with the 
 /// parameter value set to null removes all <c>SIF_Versions</c>.
 /// </summary>
 /// <remarks>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void SetSIF_Versions( SIF_Version[] items)
 {
     SetChildren( InfraDTD.SIF_REGISTER_SIF_VERSION, items );
 }
コード例 #3
0
 /// <summary>Adds a new <c>&lt;SIF_Version&gt;</c> child element.</summary>
 /// <param name="val">A SIF_Version object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Specifies which SIF Specification version(s) the agent supports. If the ZIS cannot communicate in this format, it should reject the request."</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void AddSIF_Version( SIF_Version val )
 {
     AddChild( InfraDTD.SIF_REGISTER_SIF_VERSION, val );
 }
コード例 #4
0
ファイル: SIF_Request.cs プロジェクト: rubitek/OpenADK-csharp
 /// <summary>Adds a new <c>&lt;SIF_Version&gt;</c> child element.</summary>
 /// <param name="val">A SIF_Version object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "
 ///         Specifies which SIF Specification version should be used when returning the response data; wildcards are allowed.
 ///         The version specified by SIF_Message/@Version SHOULD be the preferred version
 ///         to return if it exists in the list, either explicitly or implicitly via a wildcard.  Otherwise the responding agent
 ///         can return data in any version it chooses that matches/satisfies one of the versions in the list.
 ///       "</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void AddSIF_Version(SIF_Version val)
 {
     AddChild(InfraDTD.SIF_REQUEST_SIF_VERSION, val);
 }
コード例 #5
0
 /// <summary>
 /// Sets all SIF_Version object instances. All existing 
 /// <c>SIF_Version</c> instances 
 /// are removed and replaced with this list. Calling this method with the 
 /// parameter value set to null removes all <c>SIF_Versions</c>.
 /// </summary>
 /// <remarks>
 /// <para>Version: 2.5</para>
 /// <para>Since: 2.3</para>
 /// </remarks>
 public void SetSIF_Versions( SIF_Version[] items)
 {
     SetChildren( InfraDTD.SIF_SERVICEINPUT_SIF_VERSION, items );
 }
コード例 #6
0
 /// <summary>Adds a new <c>&lt;SIF_Version&gt;</c> child element.</summary>
 /// <param name="val">A SIF_Version object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "
 ///         Specifies which SIF Implementation Specification version should be used when returning the response data.
 ///         Is a responder cannot return response data in this format, it should reject the SIF_ServiceInput.
 ///         It is recommended that requesters use a wild card version for the minor portion of the version, such as 2.*.
 ///       "</para>
 /// <para>Version: 2.5</para>
 /// <para>Since: 2.3</para>
 /// </remarks>
 public void AddSIF_Version( SIF_Version val )
 {
     AddChild( InfraDTD.SIF_SERVICEINPUT_SIF_VERSION, val );
 }
コード例 #7
0
 /// <summary>Adds a new <c>&lt;SIF_Version&gt;</c> child element.</summary>
 /// <param name="val">A SIF_Version object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "
 ///         Specifies which SIF Implementation Specification version should be used when returning the response data.
 ///         Is a responder cannot return response data in this format, it should reject the SIF_ServiceInput.
 ///         It is recommended that requesters use a wild card version for the minor portion of the version, such as 2.*.
 ///       "</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.3</para>
 /// </remarks>
 public void AddSIF_Version(SIF_Version val)
 {
     AddChild(InfraDTD.SIF_SERVICEINPUT_SIF_VERSION, val);
 }