Example #1
0
        // Token: 0x060006D6 RID: 1750 RVA: 0x00020B4C File Offset: 0x0001ED4C
        private bool IsServerStartedForDACMode(ref LocalizedString error)
        {
            string adError = null;
            IADDatabaseAvailabilityGroup iaddatabaseAvailabilityGroup;

            if (this.DagConfig != null)
            {
                iaddatabaseAvailabilityGroup = this.DagConfig.Dag;
                if (iaddatabaseAvailabilityGroup == null)
                {
                    CouldNotFindDagObjectForServer couldNotFindDagObjectForServer = new CouldNotFindDagObjectForServer(this.ServerToCheck.NetbiosName);
                    adError = couldNotFindDagObjectForServer.Message;
                }
            }
            else
            {
                iaddatabaseAvailabilityGroup = AmBestCopySelectionHelper.GetLocalServerDatabaseAvailabilityGroup(out adError);
            }
            if (iaddatabaseAvailabilityGroup == null)
            {
                error = ReplayStrings.AmBcsDagNotFoundInAd(this.ServerToCheck.Fqdn, adError);
                this.ReportServerBlocked(AmBcsServerChecks.DatacenterActivationModeStarted, error);
                return(false);
            }
            if (AmBestCopySelectionHelper.IsServerInDacAndStopped(iaddatabaseAvailabilityGroup, this.ServerToCheck))
            {
                AmTrace.Error("AmBcsServerValidation: Rejecting server '{0}' for DB '{1}' since it is stopped in the DAC mode.", new object[]
                {
                    this.ServerToCheck,
                    this.Database.Name
                });
                error = ReplayStrings.AmBcsTargetServerIsStoppedOnDAC(this.ServerToCheck.Fqdn);
                this.ReportServerBlocked(AmBcsServerChecks.DatacenterActivationModeStarted, error);
                return(false);
            }
            return(true);
        }