internal bool InLockdown()
        {
            RelocationStatusDetailsSource relocationStatusDetailsSource = this.RelocationStatusDetailsSource;

            if (relocationStatusDetailsSource <= RelocationStatusDetailsSource.LockdownStartedFinalDeltaSync)
            {
                if (relocationStatusDetailsSource != RelocationStatusDetailsSource.LockdownStarted && relocationStatusDetailsSource != RelocationStatusDetailsSource.LockdownStartedFinalDeltaSync)
                {
                    return(false);
                }
            }
            else if (relocationStatusDetailsSource != RelocationStatusDetailsSource.LockdownFinishedFinalDeltaSync && relocationStatusDetailsSource != RelocationStatusDetailsSource.LockdownSwitchedGLS && relocationStatusDetailsSource != RelocationStatusDetailsSource.RetiredUpdatedSourceForest)
            {
                return(false);
            }
            return(true);
        }
        internal static bool TryLoadTenantRelocationStateSourceReplica(string tenantName, PartitionId partitionId, out RelocationStatusDetailsSource status)
        {
            ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromAllTenantsPartitionId(partitionId), 164, "TryLoadTenantRelocationStateSourceReplica", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\RelocationCache\\TenantRelocationStateCache.cs");

            tenantConfigurationSession.SessionSettings.TenantConsistencyMode = TenantConsistencyMode.IncludeRetiredTenants;
            ExchangeConfigurationUnit exchangeConfigurationUnitByName = tenantConfigurationSession.GetExchangeConfigurationUnitByName(tenantName);

            if (exchangeConfigurationUnitByName != null)
            {
                status = exchangeConfigurationUnitByName.RelocationStatusDetailsSource;
                return(true);
            }
            status = RelocationStatusDetailsSource.NotStarted;
            return(false);
        }
        internal bool InPostGLSSwitchState()
        {
            RelocationStatusDetailsSource relocationStatusDetailsSource = this.RelocationStatusDetailsSource;

            return(relocationStatusDetailsSource == RelocationStatusDetailsSource.LockdownSwitchedGLS || relocationStatusDetailsSource == RelocationStatusDetailsSource.RetiredUpdatedSourceForest || relocationStatusDetailsSource == RelocationStatusDetailsSource.RetiredUpdatedTargetForest);
        }
        internal bool InLockdownBeforeGLSSwitchState()
        {
            RelocationStatusDetailsSource relocationStatusDetailsSource = this.RelocationStatusDetailsSource;

            return(relocationStatusDetailsSource == RelocationStatusDetailsSource.LockdownStarted || relocationStatusDetailsSource == RelocationStatusDetailsSource.LockdownStartedFinalDeltaSync || relocationStatusDetailsSource == RelocationStatusDetailsSource.LockdownFinishedFinalDeltaSync);
        }