示例#1
0
        public static void Config(XmlElement xmlElement,
                                  ref ReplicationConfig cfg, bool compulsory)
        {
            uint uintValue = new uint();

            if (Configuration.ConfigUint(xmlElement, "AckTimeout",
                                         ref uintValue, compulsory))
            {
                cfg.AckTimeout = uintValue;
            }
            Configuration.ConfigBool(xmlElement, "BulkTransfer",
                                     ref cfg.BulkTransfer, compulsory);
            if (Configuration.ConfigUint(xmlElement, "CheckpointDelay",
                                         ref uintValue, compulsory))
            {
                cfg.CheckpointDelay = uintValue;
            }
            if (Configuration.ConfigUint(xmlElement, "ConnectionRetry",
                                         ref uintValue, compulsory))
            {
                cfg.ConnectionRetry = uintValue;
            }
            Configuration.ConfigBool(xmlElement, "DelayClientSync",
                                     ref cfg.DelayClientSync, compulsory);
            if (Configuration.ConfigUint(xmlElement, "ElectionRetry",
                                         ref uintValue, compulsory))
            {
                cfg.ElectionRetry = uintValue;
            }
            if (Configuration.ConfigUint(xmlElement, "ElectionTimeout",
                                         ref uintValue, compulsory))
            {
                cfg.ElectionTimeout = uintValue;
            }
            if (Configuration.ConfigUint(xmlElement, "FullElectionTimeout",
                                         ref uintValue, compulsory))
            {
                cfg.FullElectionTimeout = uintValue;
            }
            if (Configuration.ConfigUint(xmlElement, "HeartbeatMonitor",
                                         ref uintValue, compulsory))
            {
                cfg.HeartbeatMonitor = uintValue;
            }
            if (Configuration.ConfigUint(xmlElement, "HeartbeatSend",
                                         ref uintValue, compulsory))
            {
                cfg.HeartbeatSend = uintValue;
            }
            if (Configuration.ConfigUint(xmlElement, "LeaseTimeout",
                                         ref uintValue, compulsory))
            {
                cfg.LeaseTimeout = uintValue;
            }
            Configuration.ConfigBool(xmlElement, "AutoInit",
                                     ref cfg.AutoInit, compulsory);
            Configuration.ConfigBool(xmlElement, "NoBlocking",
                                     ref cfg.NoBlocking, compulsory);
            if (Configuration.ConfigUint(xmlElement, "Priority",
                                         ref uintValue, compulsory))
            {
                cfg.Priority = uintValue;
            }
            Configuration.ConfigAckPolicy(xmlElement,
                                          "RepMgrAckPolicy", ref cfg.RepMgrAckPolicy,
                                          compulsory);
            DbSiteConfig siteConfig = new DbSiteConfig();

            siteConfig.LocalSite = true;
            Configuration.ConfigReplicationHostAddress(xmlElement,
                                                       "RepMgrLocalSite", ref siteConfig, compulsory);
            cfg.RepmgrSitesConfig.Add(siteConfig);
            Configuration.ConfigBool(xmlElement, "Strict2Site",
                                     ref cfg.Strict2Site, compulsory);
            Configuration.ConfigBool(xmlElement, "UseMasterLeases",
                                     ref cfg.UseMasterLeases, compulsory);
        }