Exemple #1
0
        // Token: 0x060016C9 RID: 5833 RVA: 0x0005D090 File Offset: 0x0005B290
        public ClusterNetwork(AmClusterNetwork clusNet)
        {
            this.SubnetId     = ExchangeSubnet.ExtractSubnetId(clusNet);
            this.ClusterState = clusNet.GetState(false);
            if (this.SubnetId == null)
            {
                ExTraceGlobals.NetworkManagerTracer.TraceError <string>(0L, "ClusterNetwork.Subnet is null for network {0}", clusNet.Name);
                throw new ClusterNetworkNullSubnetException(clusNet.Name);
            }
            IEnumerable <AmClusterNetInterface> enumerable = clusNet.EnumerateNetworkInterfaces();

            try
            {
                foreach (AmClusterNetInterface clusNic in enumerable)
                {
                    ClusterNic item = new ClusterNic(clusNic, this);
                    this.m_nics.Add(item);
                }
            }
            finally
            {
                foreach (AmClusterNetInterface amClusterNetInterface in enumerable)
                {
                    using (amClusterNetInterface)
                    {
                    }
                }
            }
        }
Exemple #2
0
        // Token: 0x06001779 RID: 6009 RVA: 0x00060A2C File Offset: 0x0005EC2C
        internal void SynchronizeClusterNetworkRoles(IAmCluster cluster)
        {
            IEnumerable <AmClusterNetwork> enumerable = cluster.EnumerateNetworks();

            try
            {
                foreach (AmClusterNetwork amClusterNetwork in enumerable)
                {
                    DatabaseAvailabilityGroupSubnetId databaseAvailabilityGroupSubnetId = ExchangeSubnet.ExtractSubnetId(amClusterNetwork);
                    if (databaseAvailabilityGroupSubnetId != null)
                    {
                        ExchangeSubnet exchangeSubnet = this.FindSubnet(databaseAvailabilityGroupSubnetId);
                        if (exchangeSubnet != null)
                        {
                            AmNetworkRole nativeClusterNetworkRole = exchangeSubnet.Network.GetNativeClusterNetworkRole();
                            AmNetworkRole nativeRole = amClusterNetwork.GetNativeRole();
                            if (nativeRole != nativeClusterNetworkRole)
                            {
                                NetworkManager.TraceDebug("Changing network role for subnet {0} from {1} to {2}", new object[]
                                {
                                    databaseAvailabilityGroupSubnetId,
                                    nativeRole,
                                    nativeClusterNetworkRole
                                });
                                bool flag = false;
                                try
                                {
                                    amClusterNetwork.SetNativeRole(nativeClusterNetworkRole);
                                    flag = true;
                                }
                                finally
                                {
                                    if (!flag)
                                    {
                                        if (nativeClusterNetworkRole == AmNetworkRole.ClusterNetworkRoleNone)
                                        {
                                            exchangeSubnet.Network.IgnoreNetwork = false;
                                            this.ConfigUpdated = true;
                                        }
                                    }
                                    else
                                    {
                                        ReplayEventLogConstants.Tuple_NetworkRoleChanged.LogEvent(null, new object[]
                                        {
                                            amClusterNetwork.Name,
                                            databaseAvailabilityGroupSubnetId.ToString(),
                                            nativeRole.ToString(),
                                            nativeClusterNetworkRole.ToString()
                                        });
                                    }
                                }
                            }
                        }
                    }
                }
            }
            finally
            {
                foreach (AmClusterNetwork amClusterNetwork2 in enumerable)
                {
                    using (amClusterNetwork2)
                    {
                    }
                }
            }
        }