Esempio n. 1
0
        // Token: 0x060017EA RID: 6122 RVA: 0x00063084 File Offset: 0x00061284
        internal bool RemoveNetwork(string nameToRemove)
        {
            PersistentDagNetwork persistentDagNetwork = this.FindNetwork(nameToRemove);

            if (persistentDagNetwork != null)
            {
                this.Networks.Remove(persistentDagNetwork);
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        // Token: 0x0600177E RID: 6014 RVA: 0x0006121C File Offset: 0x0005F41C
        internal PersistentDagNetworkConfig UpdateNetConfig(SetDagNetworkRequest changeReq)
        {
            ExchangeNetwork network = this.GetNetwork(changeReq.Name);

            if (changeReq.NewName != null)
            {
                ExchangeNetwork network2 = this.GetNetwork(changeReq.NewName);
                if (network2 != null && network2 != network)
                {
                    NetworkManager.TraceError("SetDagNetwork Cannot rename {0} because {1} already exists", new object[]
                    {
                        changeReq.Name,
                        changeReq.NewName
                    });
                    throw new DagNetworkManagementException(ServerStrings.DagNetworkCreateDupName(changeReq.NewName));
                }
            }
            PersistentDagNetworkConfig persistentDagNetworkConfig = this.BuildNetConfigWithChange(changeReq);

            if (network == null)
            {
                PersistentDagNetwork persistentDagNetwork = new PersistentDagNetwork();
                persistentDagNetwork.Name               = changeReq.Name;
                persistentDagNetwork.Description        = changeReq.Description;
                persistentDagNetwork.IgnoreNetwork      = changeReq.IgnoreNetwork;
                persistentDagNetwork.ReplicationEnabled = changeReq.ReplicationEnabled;
                if (changeReq.Subnets.Count > 0)
                {
                    foreach (DatabaseAvailabilityGroupSubnetId databaseAvailabilityGroupSubnetId in changeReq.Subnets.Keys)
                    {
                        persistentDagNetwork.Subnets.Add(databaseAvailabilityGroupSubnetId.ToString());
                    }
                }
                persistentDagNetworkConfig.Networks.Add(persistentDagNetwork);
            }
            return(persistentDagNetworkConfig);
        }
Esempio n. 3
0
        // Token: 0x0600177D RID: 6013 RVA: 0x00060F88 File Offset: 0x0005F188
        private PersistentDagNetworkConfig BuildNetConfigWithChange(SetDagNetworkRequest changeReq)
        {
            PersistentDagNetworkConfig persistentDagNetworkConfig = new PersistentDagNetworkConfig();

            persistentDagNetworkConfig.ReplicationPort    = this.m_mgr.ReplicationPort;
            persistentDagNetworkConfig.NetworkCompression = this.m_mgr.NetworkCompression;
            persistentDagNetworkConfig.NetworkEncryption  = this.m_mgr.NetworkEncryption;
            foreach (KeyValuePair <string, ExchangeNetwork> keyValuePair in this.m_networks)
            {
                ExchangeNetwork      value = keyValuePair.Value;
                PersistentDagNetwork persistentDagNetwork = new PersistentDagNetwork();
                persistentDagNetwork.Name               = value.Name;
                persistentDagNetwork.Description        = value.Description;
                persistentDagNetwork.ReplicationEnabled = value.ReplicationEnabled;
                persistentDagNetwork.IgnoreNetwork      = value.IgnoreNetwork;
                bool flag = false;
                if (changeReq != null && DatabaseAvailabilityGroupNetwork.NameComparer.Equals(changeReq.Name, value.Name))
                {
                    if (changeReq.NewName != null)
                    {
                        persistentDagNetwork.Name = changeReq.NewName;
                    }
                    if (changeReq.Description != null)
                    {
                        persistentDagNetwork.Description = changeReq.Description;
                    }
                    if (changeReq.IsIgnoreChanged)
                    {
                        persistentDagNetwork.IgnoreNetwork = changeReq.IgnoreNetwork;
                    }
                    if (changeReq.IsReplicationChanged)
                    {
                        persistentDagNetwork.ReplicationEnabled = changeReq.ReplicationEnabled;
                    }
                    if (changeReq.SubnetListIsSet || changeReq.Subnets.Count > 0)
                    {
                        flag = true;
                        foreach (KeyValuePair <DatabaseAvailabilityGroupSubnetId, object> keyValuePair2 in changeReq.Subnets)
                        {
                            persistentDagNetwork.Subnets.Add(keyValuePair2.Key.ToString());
                        }
                    }
                }
                if (!flag)
                {
                    foreach (ExchangeSubnet exchangeSubnet in value.Subnets)
                    {
                        if (changeReq != null && changeReq.Subnets.Count > 0 && changeReq.Subnets.ContainsKey(exchangeSubnet.SubnetId))
                        {
                            NetworkManager.TraceDebug("Subnet '{0}' moving from net '{1}' to net '{2}'", new object[]
                            {
                                exchangeSubnet.SubnetId,
                                value.Name,
                                changeReq.LatestName
                            });
                        }
                        else
                        {
                            string item = exchangeSubnet.SubnetId.ToString();
                            persistentDagNetwork.Subnets.Add(item);
                        }
                    }
                }
                persistentDagNetworkConfig.Networks.Add(persistentDagNetwork);
            }
            return(persistentDagNetworkConfig);
        }