Ejemplo n.º 1
0
        private void DumpResourceIpAddress(AmClusterResource resource, string typeName)
        {
            this.m_indentlevel += 1U;
            this.WriteLine("Address = [{0}]", new object[]
            {
                resource.GetPrivateProperty <string>("Address")
            });
            if (SharedHelper.StringIEquals(typeName, "IP Address"))
            {
                this.m_indentlevel += 1U;
                this.WriteLine("EnableDhcp = [{0}]", new object[]
                {
                    resource.GetPrivateProperty <int>("EnableDhcp")
                });
                this.m_indentlevel -= 1U;
            }
            string networkNameFromIpResource = AmClusterResourceHelper.GetNetworkNameFromIpResource(null, resource);

            this.m_indentlevel += 1U;
            this.WriteLine("Network = [{0}]", new object[]
            {
                networkNameFromIpResource
            });
            this.m_indentlevel -= 1U;
            this.m_indentlevel -= 1U;
        }
Ejemplo n.º 2
0
 private void ReopenClusterIfNecessary()
 {
     if (this.m_removeNode)
     {
         this.m_clusDag.Dispose();
         this.CheckServerDagAdSettings();
         IEnumerable <AmServerName> enumerable = from server in this.m_serversInDag
                                                 where !SharedHelper.StringIEquals(server.Fqdn, this.m_mailboxAmServerName.Fqdn)
                                                 select new AmServerName(server.Fqdn);
         try
         {
             IEnumerable <string> source = from serverName in enumerable
                                           select serverName.NetbiosName;
             this.m_output.AppendLogMessage("Reopening a handle to the cluster using the names [{0}].", new object[]
             {
                 string.Join(", ", source.ToArray <string>())
             });
             this.m_clusDag = AmCluster.OpenByNames(enumerable);
         }
         catch (ClusterException)
         {
             this.m_output.WriteErrorSimple(new DagTaskClusteringMustBeInstalledAndRunningException(this.m_mailboxServerName));
         }
     }
 }
Ejemplo n.º 3
0
        public static List <string> GetServersWithServerRoleInSite(string serverName, ServerRole serverRole)
        {
            IADToplogyConfigurationSession iadtoplogyConfigurationSession = ADSessionFactory.CreateIgnoreInvalidRootOrgSession(true);
            IADServer iadserver = null;

            if (!string.IsNullOrEmpty(serverName))
            {
                if (!SharedHelper.StringIEquals(serverName, "localhost"))
                {
                    goto IL_2F;
                }
            }
            try
            {
                iadserver = iadtoplogyConfigurationSession.FindServerByName(Environment.MachineName);
                goto IL_5A;
            }
            catch (LocalServerNotFoundException)
            {
                goto IL_5A;
            }
IL_2F:
            string nodeNameFromFqdn = MachineName.GetNodeNameFromFqdn(serverName);

            iadserver = iadtoplogyConfigurationSession.FindServerByName(nodeNameFromFqdn);
            string arg = "FindServerByName";

            if (iadserver == null)
            {
                ExTraceGlobals.ReplayConfigurationTracer.TraceDebug <string, string>(0L, "GetServersWithServerRoleInSite: {0} didn't find any server for {1}", arg, serverName);
            }
IL_5A:
            return(ReplayConfiguration.GetServersWithServerRoleInSiteByServer(iadserver, serverRole));
        }
Ejemplo n.º 4
0
 internal void SetCrossSiteFlag(IADServer activeServer, IADServer passiveServer)
 {
     this.m_isCrossSite = false;
     if (activeServer == null)
     {
         PassiveBlockMode.Tracer.TraceError((long)this.GetHashCode(), "Unable to determine the cross-site flag, because active server AD object is null.");
         return;
     }
     if (passiveServer == null)
     {
         PassiveBlockMode.Tracer.TraceError((long)this.GetHashCode(), "Unable to determine the cross-site flag, because passive server AD object is null.");
         return;
     }
     if (passiveServer.ServerSite == null && activeServer.ServerSite != null)
     {
         PassiveBlockMode.Tracer.TraceDebug <string>((long)this.GetHashCode(), "This block mode client is cross-site because passive server has no site and active server is in site '{0}'.", activeServer.ServerSite.Name);
         this.m_isCrossSite = true;
         return;
     }
     if (passiveServer.ServerSite != null && activeServer.ServerSite == null)
     {
         PassiveBlockMode.Tracer.TraceDebug <string>((long)this.GetHashCode(), "This block mode client is cross-site because active server has no site and passive server is in site '{0}'.", passiveServer.ServerSite.Name);
         this.m_isCrossSite = true;
         return;
     }
     if (!SharedHelper.StringIEquals(activeServer.ServerSite.Name, passiveServer.ServerSite.Name))
     {
         PassiveBlockMode.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "This block mode client is cross-site. Active site is '{0}' and passive site is '{1}'.", activeServer.ServerSite.Name, passiveServer.ServerSite.Name);
         this.m_isCrossSite = true;
     }
 }
Ejemplo n.º 5
0
        // Token: 0x06001D3C RID: 7484 RVA: 0x00083D00 File Offset: 0x00081F00
        protected override void CheckForGaps(long fromNumber)
        {
            this.m_countdownToGapTest = 6L;
            string text          = Path.Combine(this.FromDir, base.GetFilenameFromGenerationNumber(fromNumber));
            string searchPattern = this.Config.LogFilePrefix + "*." + this.Config.LogExtension;

            string[] files = Directory.GetFiles(this.FromDir, searchPattern);
            if (files.Length > 0)
            {
                string text2 = files[0];
                if (SharedHelper.StringIEquals(this.Config.LogFilePrefix, Path.GetFileNameWithoutExtension(text2)))
                {
                    if (files.Length == 1)
                    {
                        return;
                    }
                    text2 = files[1];
                }
                if (File.Exists(text))
                {
                    ExTraceGlobals.LogInspectorTracer.TraceError <long>((long)this.GetHashCode(), "CheckForGaps() shouldn't be called since fromNumber {0} generation is there.", fromNumber);
                    return;
                }
                ExTraceGlobals.LogInspectorTracer.TraceError <string>((long)this.GetHashCode(), "Gap in log file generations after file {0}", text);
                string text3 = string.Format("LogGap:'{0}' Length={1}", text2, files.Length);
                this.m_setBroken.SetBroken(FailureTag.AlertOnly, ReplayEventLogConstants.Tuple_LogInspectorFailed, new string[]
                {
                    text,
                    text3
                });
            }
        }
Ejemplo n.º 6
0
        // Token: 0x06001170 RID: 4464 RVA: 0x00047134 File Offset: 0x00045334
        public void Validate(Guid dbGuid, long pageSizeBytes, string patchFile)
        {
            bool flag = true;

            if (flag && (this.Version.Major != EseDatabasePatchState.VersionNumber.Major || this.Version.Minor > EseDatabasePatchState.VersionNumber.Minor))
            {
                EseDatabasePatchState.Tracer.TraceError <Version, Version>((long)this.GetHashCode(), "Patch file validation failed! Version number is not supported. Actual: {0}; Supported: {1}", this.Version, EseDatabasePatchState.VersionNumber);
                flag = false;
            }
            if (flag && !SharedHelper.StringIEquals(this.ServerName, Environment.MachineName))
            {
                EseDatabasePatchState.Tracer.TraceError <string, string>((long)this.GetHashCode(), "Patch file validation failed! Actual ServerName: {0}; Expected: {1}", this.ServerName, Environment.MachineName);
                flag = false;
            }
            if (flag && this.PageSizeBytes != pageSizeBytes)
            {
                EseDatabasePatchState.Tracer.TraceError <long, long>((long)this.GetHashCode(), "Patch file validation failed! Actual PageSizeBytes: {0}; Expected: {1}", this.PageSizeBytes, pageSizeBytes);
                flag = false;
            }
            if (flag && !dbGuid.Equals(this.DatabaseGuid))
            {
                EseDatabasePatchState.Tracer.TraceError <Guid, Guid>((long)this.GetHashCode(), "Patch file validation failed! Actual DatabaseGuid: {0}; Expected: {1}", this.DatabaseGuid, dbGuid);
                flag = false;
            }
            if (!flag)
            {
                throw new PagePatchInvalidFileException(patchFile);
            }
        }
Ejemplo n.º 7
0
 internal static ADObjectId FindServerAdObjectIdInStampGroup(StampGroup stampGroup, AmServerName serverName)
 {
     foreach (ADObjectId adobjectId in stampGroup.Servers)
     {
         if (SharedHelper.StringIEquals(adobjectId.Name, serverName.NetbiosName))
         {
             return(adobjectId);
         }
     }
     return(null);
 }
Ejemplo n.º 8
0
 private bool DoesClusterNetworkContainNode(ClusterNetwork clusNet, string nodeName)
 {
     foreach (ClusterNic clusterNic in clusNet.Nics)
     {
         if (SharedHelper.StringIEquals(nodeName, clusterNic.NodeName))
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 9
0
 public bool IsClusterGroup()
 {
     using (IAmClusterGroup amClusterGroup = this.OwningCluster.FindCoreClusterGroup())
     {
         if (amClusterGroup != null && SharedHelper.StringIEquals(amClusterGroup.Name, this.Name))
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 10
0
 public ClusterNode FindNode(string nodeName)
 {
     foreach (ClusterNode clusterNode in this.Nodes)
     {
         if (SharedHelper.StringIEquals(nodeName, clusterNode.Name.NetbiosName))
         {
             return(clusterNode);
         }
     }
     return(null);
 }
Ejemplo n.º 11
0
 private bool IsNodeMemberOfDag(AmServerName node, IADDatabaseAvailabilityGroup dag)
 {
     foreach (ADObjectId adobjectId in dag.Servers)
     {
         if (SharedHelper.StringIEquals(node.NetbiosName, adobjectId.Name))
         {
             return(true);
         }
     }
     return(false);
 }
 // Token: 0x06000111 RID: 273 RVA: 0x00007432 File Offset: 0x00005632
 private ServiceStartMode MapStartMode(string mode)
 {
     if (SharedHelper.StringIEquals(mode, "Manual"))
     {
         return(ServiceStartMode.Manual);
     }
     if (SharedHelper.StringIEquals(mode, "Disabled"))
     {
         return(ServiceStartMode.Disabled);
     }
     return(ServiceStartMode.Automatic);
 }
Ejemplo n.º 13
0
        internal static IEnumerable <AmClusterResource> GetIpResourcesFromNetName(AmClusterGroup resGroup, AmClusterResource netName)
        {
            if (!SharedHelper.StringIEquals(netName.GetTypeName(), "Network Name"))
            {
                throw new ArgumentException("GetIpResourceFromNetName() needs a NetName resource.");
            }
            List <AmClusterResource> list = new List <AmClusterResource>(8);

            list.AddRange(resGroup.EnumerateResourcesOfType("IP Address"));
            list.AddRange(resGroup.EnumerateResourcesOfType("IPv6 Address"));
            return(list);
        }
 // Token: 0x06001986 RID: 6534 RVA: 0x0006AA54 File Offset: 0x00068C54
 protected SeederInstanceBase(RpcSeederArgs rpcArgs, ConfigurationArgs configArgs)
 {
     this.SeederArgs     = rpcArgs;
     this.ConfigArgs     = configArgs;
     this.m_seederStatus = new RpcSeederStatus();
     ExTraceGlobals.SeederServerTracer.TraceDebug <string, string>((long)this.GetHashCode(), "SeederInstanceBase constructed with the following arguments: {0}; {1}", this.SeederArgs.ToString(), this.ConfigArgs.ToString());
     this.InitializePerfCounters();
     this.m_completedTimeUtc = DateTime.MaxValue;
     if (!string.IsNullOrEmpty(rpcArgs.SourceMachineName) && !SharedHelper.StringIEquals(rpcArgs.SourceMachineName, configArgs.SourceMachine))
     {
         this.m_fPassiveSeeding = true;
     }
 }
Ejemplo n.º 15
0
        public static bool IsAutoActivationAllowed(IADServer sourceServer, IADServer targetServer, out LocalizedString error)
        {
            string name  = sourceServer.Name;
            string name2 = targetServer.Name;

            error = LocalizedString.Empty;
            if (SharedHelper.StringIEquals(name, name2))
            {
                AmTrace.Debug("IsAutoActivationAllowed: Skipping check since source == target. TargetServer: {0}", new object[]
                {
                    name2
                });
                return(true);
            }
            switch (targetServer.DatabaseCopyAutoActivationPolicy)
            {
            case DatabaseCopyAutoActivationPolicyType.Unrestricted:
                return(true);

            case DatabaseCopyAutoActivationPolicyType.IntrasiteOnly:
                if (!targetServer.ServerSite.Equals(sourceServer.ServerSite))
                {
                    AmTrace.Debug("IsAutoActivationAllowed: Rejecting server '{0}' (Site={1}) because it is in a different site from source server '{2}' (Site={2}). ", new object[]
                    {
                        name2,
                        targetServer.ServerSite.Name,
                        name,
                        sourceServer.ServerSite.Name
                    });
                    error = ReplayStrings.AmBcsTargetServerActivationIntraSite(targetServer.Fqdn, sourceServer.Fqdn, targetServer.ServerSite.Name, sourceServer.ServerSite.Name);
                    return(false);
                }
                return(true);

            case DatabaseCopyAutoActivationPolicyType.Blocked:
                AmTrace.Debug("IsAutoActivationAllowed: Rejecting server '{0}' because it is activation policy Blocked.", new object[]
                {
                    name2
                });
                error = ReplayStrings.AmBcsTargetServerActivationBlocked(targetServer.Fqdn);
                return(false);

            default:
                DiagCore.RetailAssert(false, "Unhandled case for DatabaseCopyAutoActivationPolicyType: {0}", new object[]
                {
                    targetServer.DatabaseCopyAutoActivationPolicy
                });
                return(false);
            }
        }
Ejemplo n.º 16
0
        public IEnumerable <AmClusterResource> EnumerateResourcesOfType(string resourceType)
        {
            IEnumerable <AmClusterResource> enumerable = this.EnumerateResources();
            List <AmClusterResource>        list       = (from resource in enumerable
                                                          where SharedHelper.StringIEquals(resource.GetTypeName(), resourceType)
                                                          select resource).ToList <AmClusterResource>();
            IEnumerable <AmClusterResource> enumerable2 = enumerable.Except(list);

            foreach (AmClusterResource amClusterResource in enumerable2)
            {
                amClusterResource.Dispose();
            }
            return(list);
        }
Ejemplo n.º 17
0
 // Token: 0x06000F2A RID: 3882 RVA: 0x0004059C File Offset: 0x0003E79C
 private bool IsPropertyChanged <T>(T oldValue, T newValue)
 {
     if (oldValue is string)
     {
         return(!SharedHelper.StringIEquals(oldValue as string, newValue as string));
     }
     if (oldValue is List <string> )
     {
         List <string> first  = oldValue as List <string>;
         List <string> second = newValue as List <string>;
         return(!first.SequenceEqual(second, StringComparer.OrdinalIgnoreCase));
     }
     return(!oldValue.Equals(newValue));
 }
Ejemplo n.º 18
0
 // Token: 0x060001D5 RID: 469 RVA: 0x000087E4 File Offset: 0x000069E4
 public bool IsNetworkVisible(string networkStr1, out AmClusterNetInterface networkInterface)
 {
     networkInterface = null;
     foreach (AmClusterNetInterface amClusterNetInterface in this.EnumerateNetInterfaces())
     {
         string networkName = amClusterNetInterface.GetNetworkName();
         if (SharedHelper.StringIEquals(networkStr1, networkName))
         {
             networkInterface = amClusterNetInterface;
             return(true);
         }
         amClusterNetInterface.Dispose();
     }
     return(false);
 }
Ejemplo n.º 19
0
        public IAmClusterResource FindResourceByTypeName(string desiredTypeName)
        {
            AmClusterResource amClusterResource = null;

            foreach (AmClusterResource amClusterResource2 in this.EnumerateResources())
            {
                if (amClusterResource != null || !SharedHelper.StringIEquals(amClusterResource2.GetTypeName(), desiredTypeName))
                {
                    amClusterResource2.Dispose();
                }
                else
                {
                    amClusterResource = amClusterResource2;
                }
            }
            return(amClusterResource);
        }
Ejemplo n.º 20
0
        // Token: 0x06000F4F RID: 3919 RVA: 0x00041E64 File Offset: 0x00040064
        public SafetyNetInfo ReadRequestInfo(SafetyNetRequestKey requestKey, SafetyNetInfo prevInfo)
        {
            this.EnsureOpen();
            string        valueName     = requestKey.ToString();
            string        text          = this.ReadString(valueName);
            SafetyNetInfo safetyNetInfo = null;

            if (prevInfo != null && SharedHelper.StringIEquals(text, prevInfo.GetSerializedForm()))
            {
                safetyNetInfo = prevInfo;
            }
            if (safetyNetInfo == null && !string.IsNullOrEmpty(text))
            {
                safetyNetInfo = SafetyNetInfo.Deserialize(this.m_dbName, text, ExTraceGlobals.DumpsterTracer, true);
            }
            return(safetyNetInfo);
        }
Ejemplo n.º 21
0
        public static void ValidateIpv6Networks(IAmCluster cluster, string[] ipv6Networks)
        {
            for (int i = 0; i < ipv6Networks.Length - 1; i++)
            {
                for (int j = i + 1; j < ipv6Networks.Length; j++)
                {
                    if (SharedHelper.StringIEquals(ipv6Networks[i], ipv6Networks[j]))
                    {
                        throw new IPv6NetworksHasDuplicateEntries(ipv6Networks[i]);
                    }
                }
            }
            Dictionary <string, AmClusterNetwork> ipv6AutoCfgNetworkMap = AmClusterResourceHelper.GetIpv6AutoCfgNetworkMap(cluster, ipv6Networks);

            if (ipv6AutoCfgNetworkMap != null)
            {
                SharedHelper.DisposeObjectList <AmClusterNetwork>(ipv6AutoCfgNetworkMap.Values);
            }
        }
Ejemplo n.º 22
0
        public CiFilesSeederInstance(RpcSeederArgs rpcArgs, ConfigurationArgs configArgs) : base(rpcArgs, configArgs)
        {
            ITopologyConfigurationSession adSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 73, ".ctor", "f:\\15.00.1497\\sources\\dev\\cluster\\src\\Replay\\seeder\\cifileseederinstance.cs");

            this.targetServer = CiFilesSeederInstance.GetLocalServer(adSession);
            if (!string.IsNullOrEmpty(rpcArgs.SourceMachineName) && !SharedHelper.StringIEquals(rpcArgs.SourceMachineName, configArgs.SourceMachine))
            {
                this.m_fPassiveSeeding = true;
            }
            Server server          = this.m_fPassiveSeeding ? CiFilesSeederInstance.GetServerByName(adSession, rpcArgs.SourceMachineName) : CiFilesSeederInstance.GetServerByName(adSession, configArgs.SourceMachine);
            string indexSystemName = FastIndexVersion.GetIndexSystemName(this.ConfigArgs.IdentityGuid);

            this.targetIndexSeeder                     = new IndexSeeder(indexSystemName);
            this.sourceSeederProvider                  = new CiFileSeederProvider(server.Fqdn, this.targetServer.Fqdn, this.ConfigArgs.IdentityGuid);
            this.sourceSeederProvider.NetworkName      = this.SeederArgs.NetworkId;
            this.sourceSeederProvider.CompressOverride = this.SeederArgs.CompressOverride;
            this.sourceSeederProvider.EncryptOverride  = this.SeederArgs.EncryptOverride;
            base.ReadSeedTestHook();
            ExTraceGlobals.SeederServerTracer.TraceDebug <string, string>((long)this.GetHashCode(), "CiFilesSeederInstance constructed with the following arguments: {0}; {1}", this.SeederArgs.ToString(), this.ConfigArgs.ToString());
        }
Ejemplo n.º 23
0
        // Token: 0x06000136 RID: 310 RVA: 0x00007620 File Offset: 0x00005820
        internal static AmConfigChangedFlags CheckForChanges(AmConfig left, AmConfig right)
        {
            AmConfigChangedFlags amConfigChangedFlags = AmConfigChangedFlags.None;

            if (left.Role != right.Role)
            {
                amConfigChangedFlags |= AmConfigChangedFlags.Role;
            }
            if (!object.ReferenceEquals(left.DbState, right.DbState))
            {
                amConfigChangedFlags |= AmConfigChangedFlags.DbState;
            }
            if (!SharedHelper.StringIEquals(left.LastError, right.LastError))
            {
                amConfigChangedFlags |= AmConfigChangedFlags.LastError;
            }
            if ((left.DagConfig == null && right.DagConfig != null) || (left.DagConfig != null && right.DagConfig == null))
            {
                amConfigChangedFlags |= AmConfigChangedFlags.DagConfig;
            }
            if (left.DagConfig != null && right.DagConfig != null)
            {
                if (!left.DagConfig.Id.Equals(right.DagConfig.Id))
                {
                    amConfigChangedFlags |= AmConfigChangedFlags.DagId;
                }
                if (!AmServerName.IsArrayEquals(left.DagConfig.MemberServers, right.DagConfig.MemberServers))
                {
                    amConfigChangedFlags |= AmConfigChangedFlags.MemberServers;
                }
                if (!AmServerName.IsEqual(left.DagConfig.CurrentPAM, right.DagConfig.CurrentPAM))
                {
                    amConfigChangedFlags |= AmConfigChangedFlags.CurrentPAM;
                }
                if (!object.ReferenceEquals(left.DagConfig.Cluster, right.DagConfig.Cluster))
                {
                    amConfigChangedFlags |= AmConfigChangedFlags.Cluster;
                }
            }
            return(amConfigChangedFlags);
        }
Ejemplo n.º 24
0
        private bool ShouldUpgradeService()
        {
            RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("system\\currentcontrolset\\services\\msexchangerepl");
            bool        result;

            if (registryKey == null)
            {
                result = true;
            }
            else
            {
                using (registryKey)
                {
                    string input = (string)registryKey.GetValue("imagepath");
                    string str   = Regex.Replace(input, "\"", "");
                    string str2  = base.ServiceInstallContext.Parameters["assemblypath"];
                    result = !SharedHelper.StringIEquals(str, str2);
                }
            }
            return(result);
        }
Ejemplo n.º 25
0
        private void DumpResource(AmClusterResource resource)
        {
            string        typeName = resource.GetTypeName();
            List <string> list     = new List <string>(resource.EnumeratePossibleOwnerNames());
            string        text     = string.Join(",", list.ToArray());

            this.WriteLine("Resource: {0} [{1}, type = {2}, PossibleOwners = {3} ]", new object[]
            {
                resource.Name,
                resource.GetState(),
                typeName,
                text
            });
            if (SharedHelper.StringIEquals(typeName, "IP Address") || SharedHelper.StringIEquals(typeName, "IPv6 Address"))
            {
                this.DumpResourceIpAddress(resource, typeName);
                return;
            }
            if (SharedHelper.StringIEquals(typeName, "Network Name"))
            {
                this.DumpResourceNetName(resource);
            }
        }
Ejemplo n.º 26
0
        public void SetCopyProperty(Guid dbGuid, string propName, string propVal)
        {
            char[] separator = new char[]
            {
                '.'
            };
            string[] array = propName.Split(separator, 2);
            if (array.Length > 1)
            {
                if (SharedHelper.StringIEquals(array[0], "MonitoredDatabase"))
                {
                    MonitoredDatabase.SetCopyProperty(dbGuid, array[1], propVal);
                    return;
                }
                if (SharedHelper.StringIEquals(array[0], "LogCopier"))
                {
                    LogCopier.SetCopyProperty(dbGuid, array[1], propVal);
                    return;
                }
            }
            string message = string.Format("SetCopyProperty doesn't recognize '{0}'", propName);

            throw new ArgumentException(message);
        }
Ejemplo n.º 27
0
        // Token: 0x0600032D RID: 813 RVA: 0x0001219C File Offset: 0x0001039C
        private void Persist()
        {
            AmLastKnownConfigSerializable amLastKnownConfigSerializable = new AmLastKnownConfigSerializable();

            amLastKnownConfigSerializable.Role = (int)this.Role;
            amLastKnownConfigSerializable.AuthoritativeServer = this.AuthoritativeServer.Fqdn;
            amLastKnownConfigSerializable.Members             = (from server in this.Members
                                                                 select server.Fqdn).ToArray <string>();
            string text = string.Empty;

            try
            {
                text = SerializationUtil.ObjectToXml(amLastKnownConfigSerializable);
                if (!SharedHelper.StringIEquals(text, this.m_prevObjectXml))
                {
                    this.SaveToRegistry(text);
                    this.m_prevObjectXml = text;
                }
            }
            catch (Exception ex)
            {
                ReplayCrimsonEvents.LastKnownGoodConfigSerializationError.Log <string, string>("Serialize", ex.ToString());
            }
        }
        private void PreventMoveOfActiveSeedingSource(AmServerName server, Database[] databases)
        {
            if (this.SkipActiveCopyChecks)
            {
                TaskLogger.Trace("PreventMoveOfActiveSeedingSource: Check skipped because -SkipActiveCopyChecks flag is specified.", new object[0]);
                return;
            }
            Exception ex = null;

            RpcDatabaseCopyStatus2[] array = null;
            try
            {
                Guid[] array2 = null;
                if (databases != null && databases.Length > 0)
                {
                    array2 = new Guid[databases.Length];
                    for (int i = 0; i < databases.Length; i++)
                    {
                        array2[i] = databases[i].Guid;
                    }
                }
                array = ReplayRpcClientHelper.GetCopyStatus(server.Fqdn, RpcGetDatabaseCopyStatusFlags2.ReadThrough, array2);
            }
            catch (TaskServerTransientException ex2)
            {
                ex = ex2;
            }
            catch (TaskServerException ex3)
            {
                ex = ex3;
            }
            if (ex != null)
            {
                TaskLogger.Trace("PreventMoveOfActiveSeedingSource: Check failed because of exception: {2}", new object[]
                {
                    ex
                });
                base.WriteError(new ErrorMoveUnableToGetCopyStatusException(server.NetbiosName, ex.Message), ErrorCategory.InvalidOperation, server.Fqdn);
            }
            foreach (RpcDatabaseCopyStatus2 rpcDatabaseCopyStatus in array)
            {
                if (SharedHelper.StringIEquals(rpcDatabaseCopyStatus.ActiveDatabaseCopy, server.NetbiosName) && rpcDatabaseCopyStatus.SeedingSource)
                {
                    if (!rpcDatabaseCopyStatus.SeedingSourceForDB)
                    {
                        if (rpcDatabaseCopyStatus.SeedingSourceForDB || rpcDatabaseCopyStatus.SeedingSourceForCI)
                        {
                            goto IL_1B6;
                        }
                    }
                    try
                    {
                        IADDatabase iaddatabase = AmHelper.FindDatabaseByGuid(rpcDatabaseCopyStatus.DBGuid);
                        TaskLogger.Trace("PreventMoveOfActiveSeedingSource: Check failed for {0}\\{1} because it is seeding source.", new object[]
                        {
                            iaddatabase.Name,
                            rpcDatabaseCopyStatus.MailboxServer
                        });
                        base.WriteError(new ErrorMoveActiveCopyIsSeedingSourceException(iaddatabase.Name, rpcDatabaseCopyStatus.MailboxServer), ErrorCategory.InvalidOperation, iaddatabase.Identity);
                    }
                    catch (AmDatabaseNotFoundException ex4)
                    {
                        TaskLogger.Trace("PreventMoveOfActiveSeedingSource: Check failed for '{0}' because it is not found in AD. Error: {1}", new object[]
                        {
                            rpcDatabaseCopyStatus.DBGuid,
                            ex4.Message
                        });
                        base.WriteError(new ErrorMoveActiveCopyNotFoundException(rpcDatabaseCopyStatus.DBGuid, ex4.Message), ErrorCategory.InvalidOperation, rpcDatabaseCopyStatus.DBGuid);
                    }
                }
                IL_1B6 :;
            }
        }
 public bool Equals(AmBcsServerFailureLogger.AmBcsCheckInfo other)
 {
     return(this.Type == other.Type && SharedHelper.StringIEquals(this.CheckName, other.CheckName));
 }
        private void ReportFailureInternal(AmServerName server, AmBcsServerFailureLogger.AmBcsCheckInfo checkInfo, string errorMessage, bool overwriteAllowed, ReplayCrimsonEvent evt, params object[] evtArgs)
        {
            OrderedDictionary orderedDictionary;

            if (this.m_failureTable.ContainsKey(server))
            {
                orderedDictionary = this.m_failureTable[server];
            }
            else
            {
                orderedDictionary = new OrderedDictionary(10);
                this.m_failureTable.Add(server, orderedDictionary);
            }
            string str;
            bool   flag = !this.TryGetErrorFromCheckTable(orderedDictionary, checkInfo, out str) || (overwriteAllowed && !SharedHelper.StringIEquals(str, errorMessage));

            if (flag)
            {
                this.AddErrorIntoCheckTable(orderedDictionary, checkInfo, errorMessage);
                if (this.IsEventLoggingEnabled)
                {
                    evt.LogGeneric(evtArgs);
                    return;
                }
            }
            else
            {
                AmTrace.Debug("BCS: Failure for server '{0}' and check [{1}] has already been recorded. Suppressing raising another event.", new object[]
                {
                    server,
                    checkInfo
                });
            }
        }