Beispiel #1
0
        /// <summary>
        /// This method updates the TTL, Responsible Mailbox, and Error Mailbox to the values specified as the input parameters of this method. If a new value for a parameter is not specified, then the current value for the parameter is not changed. The method returns a reference to the modified object as an output parameter.
        /// </summary>
        /// <param name="ttl">Optional - Time, in seconds, that the RR can be cached by a DNS resolver.</param>
        /// <param name="errorMailbox">Optional - FQDN specifying a mailbox to receive error messages related to either the mailing list, or to the mailbox specified by the owner name of the MINFO record.</param>
        /// <param name="responsibleMailbox">Optional - FQDN specifying a mailbox responsible for the mailing list or mailbox specified in the record's Owner Name.</param>
        /// <returns>the modified object.</returns>
        public MINFOType Modify(TimeSpan?ttl, string responsibleMailbox, string errorMailbox)
        {
            ManagementBaseObject inParams = m_mo.GetMethodParameters("Modify");

            if ((ttl != null) && (ttl != this.TTL))
            {
                inParams["TTL"] = ttl.Value.TotalSeconds;
            }
            if ((!string.IsNullOrEmpty(responsibleMailbox)) && (responsibleMailbox != this.ResponsibleMailbox))
            {
                inParams["ResponsibleMailbox"] = IPHelper.FixHostnames(responsibleMailbox);
            }
            if ((!string.IsNullOrEmpty(errorMailbox)) && (errorMailbox != this.ErrorMailbox))
            {
                inParams["ErrorMailbox"] = IPHelper.FixHostnames(errorMailbox);
            }

            try
            {
                return(new MINFOType(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.InvokeMethod("Modify", inParams, null)["RR"].ToString()), null)));
            }
            catch (ManagementException me)
            {
                throw new WMIException(me);
            }
        }
Beispiel #2
0
        public SOAType Modify(TimeSpan?ttl,
                              UInt32?serialNumber,
                              string primaryServer,
                              string responsibleParty,
                              TimeSpan?refreshInterval,
                              TimeSpan?retryDelay,
                              TimeSpan?expireLimit,
                              TimeSpan?minimumTTL
                              )
        {
            ManagementBaseObject inParams = m_mo.GetMethodParameters("Modify");

            if ((ttl != null) && (ttl != this.TTL))
            {
                inParams["TTL"] = ttl.Value.TotalSeconds;
            }

            if ((serialNumber != null) && (serialNumber != this.SerialNumber))
            {
                inParams["SerialNumber"] = serialNumber;
            }
            if ((!string.IsNullOrEmpty(primaryServer)) && (primaryServer != this.PrimaryServer))
            {
                inParams["PrimaryServer"] = IPHelper.FixHostnames(primaryServer);
            }
            if ((!string.IsNullOrEmpty(responsibleParty)) && (responsibleParty != this.ResponsibleParty))
            {
                inParams["ResponsibleParty"] = responsibleParty;
            }
            if ((refreshInterval != null) && (refreshInterval != this.RefreshInterval))
            {
                inParams["RefreshInterval"] = refreshInterval.Value.TotalSeconds;
            }
            if ((retryDelay != null) && (retryDelay != this.RetryDelay))
            {
                inParams["RetryDelay"] = retryDelay.Value.TotalSeconds;
            }
            if ((expireLimit != null) && (expireLimit != this.ExpireLimit))
            {
                inParams["ExpireLimit"] = expireLimit.Value.TotalSeconds;
            }
            if ((minimumTTL != null) && (minimumTTL != this.MinimumTTL))
            {
                inParams["MinimumTTL"] = minimumTTL.Value.TotalSeconds;
            }

            //return new SOAType((ManagementObject)m_mo.InvokeMethod("Modify", inParams, null));
            return(new SOAType(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.InvokeMethod("Modify", inParams, null)["RR"].ToString()), null)));
        }
Beispiel #3
0
        /// <summary>
        /// This method updates the TTL, RP Mailbox and TXT Domain Name to the values specified as the input parameters of this method. If a new value for a parameter is not specified, then the current value for the parameter is not changed. The method returns a reference to the modified object as an output parameter.
        /// </summary>
        /// <param name="ttl">Optional - Time, in seconds, that the RR can be cached by a DNS resolver.</param>
        /// <param name="rpMailbox">Optional - FQDN specifying the mailbox for the responsible person.</param>
        /// <param name="txtDomainName">Optional - FQDN for which TXT Resource Records exist.</param>
        /// <returns>the modified object.</returns>
        public RPType Modify(TimeSpan?ttl, string rpMailbox, string txtDomainName)
        {
            ManagementBaseObject inParams = m_mo.GetMethodParameters("Modify");

            if ((ttl != null) && (ttl != this.TTL))
            {
                inParams["TTL"] = ttl.Value.TotalSeconds;
            }
            if ((!string.IsNullOrEmpty(rpMailbox)) && (rpMailbox != this.RPMailbox))
            {
                inParams["RPMailbox"] = IPHelper.FixHostnames(rpMailbox);
            }
            if ((!string.IsNullOrEmpty(txtDomainName)) && (txtDomainName != this.TXTDomainName))
            {
                inParams["TXTDomainName"] = IPHelper.FixHostnames(txtDomainName);
            }

            //return new RPType((ManagementObject)m_mo.InvokeMethod("Modify", inParams, null));
            return(new RPType(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.InvokeMethod("Modify", inParams, null)["RR"].ToString()), null)));
        }
Beispiel #4
0
        /// <summary>
        /// Instantiates an AFSDB Resource Record based on the data in the method's
        /// input parameters: the record's DNS Server Name, Container Name, Owner/Cell
        /// Name, class (default = IN), time-to-live value, and host AFS server subtype
        /// and name. Returns a reference to the new object as an output parameter.
        /// </summary>
        /// <param name="server">Server object</param>
        /// <param name="dnsServerName">FQDN or IP address of the DNS Server that contains this RR.</param>
        /// <param name="containerName">Name of the Container for the Zone, Cache, or RootHints instance which contains this RR.</param>
        /// <param name="ownerName">Owner name for the RR.</param>
        /// <param name="recordClass">Class of the RR.</param>
        /// <param name="ttl">Time, in seconds, that the RR can be cached by a DNS resolver.</param>
        /// <param name="subtype">Subtype of the host AFS server.</param>
        /// <param name="serverName">FQDN specifying a host that has a server for the AFS cell specified in the owner name.</param>
        /// <returns>the new object.</returns>
        public static AFSDBType CreateInstanceFromPropertyData(
            Server server,
            string dnsServerName,
            string containerName,
            string ownerName,
            RecordClassEnum?recordClass,
            TimeSpan?ttl,
            SubtypeEnum subtype,
            string serverName)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server is required");
            }

            ManagementClass      dnsClass = new ManagementClass(server.m_scope, new ManagementPath("MicrosoftDNS_AFSDBType"), null);
            ManagementBaseObject inParams = dnsClass.GetMethodParameters("CreateInstanceFromPropertyData");

            inParams["DnsServerName"] = dnsServerName;
            inParams["ContainerName"] = containerName;
            inParams["OwnerName"]     = ownerName;
            if (recordClass != null)
            {
                inParams["RecordClass"] = (UInt32)recordClass.Value;
            }
            if (ttl != null)
            {
                inParams["TTL"] = ttl.Value.TotalSeconds;
            }
            inParams["Subtype"]    = (UInt16)subtype;
            inParams["ServerName"] = IPHelper.FixHostnames(serverName);

            try
            {
                return(new AFSDBType(new ManagementObject(server.m_scope, new ManagementPath(dnsClass.InvokeMethod("CreateInstanceFromPropertyData", inParams, null)["RR"].ToString()), null)));
            }
            catch (ManagementException me)
            {
                throw new WMIException(me);
            }
        }
Beispiel #5
0
        /// <summary>
        /// updates the TTL, Subtype and Server Name to the values specified
        /// as the input parameters of this method. If a new value for a
        /// parameter is not specified, then the current value for the
        /// parameter is not changed. The method returns a reference to
        /// the modified object as an output parameter.
        /// </summary>
        /// <param name="ttl">Time, in seconds, that the RR can be cached by a DNS resolver.</param>
        /// <param name="subType">Subtype of the host AFS server. </param>
        /// <param name="serverName">FQDN specifying a host that has a server for the AFS cell specified in the owner name.</param>
        /// <returns>the modified object.</returns>
        public AFSDBType Modify(TimeSpan?ttl, SubtypeEnum?subType, string serverName)
        {
            ManagementBaseObject inParams = m_mo.GetMethodParameters("Modify");

            if ((ttl != null) && (ttl != this.TTL))
            {
                inParams["TTL"] = ttl.Value.TotalSeconds;
            }
            if ((subType != null) && (subType != this.Subtype))
            {
                inParams["Subtype"] = (UInt16)subType;
            }
            if ((!string.IsNullOrEmpty(serverName)) && (serverName != this.ServerName))
            {
                //workaround for MS bug.
                inParams["ServerName"] = IPHelper.FixHostnames(serverName);
            }


            return(new AFSDBType(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.InvokeMethod("Modify", inParams, null)["RR"].ToString()), null)));
        }
Beispiel #6
0
        /// <summary>
        /// Updates the TTL, Preference, and Intermediate Host to the values specified as the input parameters of this method. If a new value for a parameter is not specified, then the current value for the parameter is not changed. The method returns a reference to the modified object as an output parameter.
        /// </summary>
        /// <param name="ttl">Optional - Time, in seconds, that the RR can be cached by a DNS resolver.</param>
        /// <returns>the modified object.</returns>
        public RTType Modify(TimeSpan?ttl, string intermediateHost, UInt16?preference)
        {
            ManagementBaseObject inParams = m_mo.GetMethodParameters("Modify");

            if ((ttl != null) && (ttl != this.TTL))
            {
                inParams["TTL"] = ttl.Value.TotalSeconds;
            }

            if ((preference != null) && (preference != this.Preference))
            {
                inParams["Preference"] = (UInt16)preference;
            }

            if ((!string.IsNullOrEmpty(intermediateHost)) && (intermediateHost != this.IntermediateHost))
            {
                inParams["IntermediateHost"] = IPHelper.FixHostnames(intermediateHost);
            }

            //return new RTType((ManagementObject)m_mo.InvokeMethod("Modify", inParams, null));
            return(new RTType(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.InvokeMethod("Modify", inParams, null)["RR"].ToString()), null)));
        }
Beispiel #7
0
        /// <summary>
        /// Updates the TTL, Priority, Weight, Port, and Domain Name to the values specified as the input parameters of this method. If a new value for a parameter is not specified, then the current value for the parameter is not changed. The method returns a reference to the modified object as an output parameter.
        /// </summary>
        /// <param name="ttl">Optional - Time, in seconds, that the RR can be cached by a DNS resolver.</param>
        /// <param name="domainName">Optional - FQDN of the target host. A target of \.\ means that the service is decidedly not available at this domain.</param>
        /// <param name="port">Optional - Port used on the target host of a protocol service.</param>
        /// <param name="priority">Optional - Priority of the target host specified in the owner name. Lower numbers imply higher priorities.</param>
        /// <param name="weight">Optional - Weight of the target host. This is useful when selecting among hosts that have the same priority. The chances of using this host should be proportional to its weight.</param>
        /// <returns>the modified object.</returns>
        public SRVType Modify(TimeSpan?ttl, UInt16?priority, UInt16?weight, UInt16?port,
                              string srvDomainName)
        {
            ManagementBaseObject inParams = m_mo.GetMethodParameters("Modify");

            if ((ttl != null) && (ttl != this.TTL))
            {
                inParams["TTL"] = ttl.Value.TotalSeconds;
            }

            if ((priority != null) && (priority != this.Priority))
            {
                inParams["Priority"] = priority;
            }
            if ((weight != null) && (weight != this.Weight))
            {
                inParams["Weight"] = weight;
            }
            if ((port != null) && (port != this.Port))
            {
                inParams["Port"] = port;
            }
            if ((!string.IsNullOrEmpty(srvDomainName)) && (srvDomainName != this.SRVDomainName))
            {
                inParams["SRVDomainName"] = IPHelper.FixHostnames(srvDomainName);
            }

            try
            {
                return(new SRVType(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.InvokeMethod("Modify", inParams, null)["RR"].ToString()), null)));
            }
            catch (ManagementException me)
            {
                throw new WMIException(me);
            }
        }