Exemplo n.º 1
0
        // Token: 0x060001A4 RID: 420 RVA: 0x0000A358 File Offset: 0x00008558
        internal static void ValidateForCurrentRole(bool isStandaloneAllowed, string operation)
        {
            if (RegistryParameters.ConfigInitializedCheckTimeoutInSec > 0)
            {
                ManualOneShotEvent.Result result = AmSystemManager.Instance.ConfigInitializedEvent.WaitOne(TimeSpan.FromSeconds((double)RegistryParameters.ConfigInitializedCheckTimeoutInSec));
                if (result != ManualOneShotEvent.Result.Success)
                {
                    ReplayCrimsonEvents.ConfigInitializedEventNotSet.LogPeriodic <TimeSpan, ManualOneShotEvent.Result, string>(AmSystemManager.Instance, DiagCore.DefaultEventSuppressionInterval, TimeSpan.FromSeconds((double)RegistryParameters.ConfigInitializedCheckTimeoutInSec), result, operation);
                }
            }
            AmConfig config = AmSystemManager.Instance.Config;

            if (config.Role == AmRole.SAM)
            {
                AmReferralException ex = new AmReferralException(config.DagConfig.CurrentPAM.Fqdn);
                throw ex;
            }
            if (!isStandaloneAllowed && config.Role == AmRole.Standalone)
            {
                throw new AmOperationInvalidForStandaloneRoleException();
            }
            if (config.Role == AmRole.Unknown)
            {
                throw new AmInvalidConfiguration(config.LastError);
            }
        }
Exemplo n.º 2
0
        protected virtual void CheckIfOperationIsAllowedOnCurrentRole()
        {
            AmConfig config = AmSystemManager.Instance.Config;

            if (config.Role == AmRole.SAM)
            {
                AmReferralException ex = new AmReferralException(config.DagConfig.CurrentPAM.Fqdn);
                throw ex;
            }
            if (config.Role == AmRole.Unknown)
            {
                throw new AmInvalidConfiguration(config.LastError);
            }
        }