Exemple #1
0
        // Token: 0x06000361 RID: 865 RVA: 0x00012710 File Offset: 0x00010910
        public static void ReadConfigurationPaged <T>(ADConfigurationReader <ADPagedReader <T> > configurationReader, ADConfigurationProcessor <T> configurationProcessor, int retryCount) where T : IConfigurable, new()
        {
            if (configurationProcessor == null)
            {
                throw new ArgumentNullException("configurationProcessor");
            }
            ADPagedReader <T> pagedReader = ADNotificationAdapter.ReadConfiguration <ADPagedReader <T> >(configurationReader, retryCount);
            IEnumerator <T>   enumerator  = null;

            ADNotificationAdapter.RunADOperation(delegate()
            {
                enumerator = pagedReader.GetEnumerator();
            }, retryCount);
            Breadcrumbs <Exception> exceptions = new Breadcrumbs <Exception>(32);

            try
            {
                for (;;)
                {
                    bool hasMore = false;
                    ADNotificationAdapter.RunADOperation(delegate()
                    {
                        try
                        {
                            hasMore = enumerator.MoveNext();
                        }
                        catch (Exception bc)
                        {
                            exceptions.Drop(bc);
                            enumerator.Dispose();
                            enumerator = pagedReader.GetEnumerator();
                            throw;
                        }
                    }, retryCount);
                    if (!hasMore)
                    {
                        break;
                    }
                    configurationProcessor(enumerator.Current);
                }
            }
            finally
            {
                enumerator.Dispose();
            }
        }
Exemple #2
0
        // Token: 0x06000352 RID: 850 RVA: 0x00012014 File Offset: 0x00010214
        public static ADNotificationRequestCookie RegisterChangeNotification <T>(ADObjectId baseDN, object wrappedContext, bool wrapAsADOperation, int retryCount) where T : ADConfigurationObject, new()
        {
            ADNotificationRequestCookie cookie = null;

            if (wrapAsADOperation)
            {
                ADNotificationAdapter.RunADOperation(delegate()
                {
                    cookie = ADNotificationAdapter.RegisterChangeNotification <T>(baseDN, new ADNotificationCallback(ADNotificationAdapter.OnNotification), wrappedContext);
                }, retryCount);
            }
            else
            {
                cookie = ADNotificationAdapter.RegisterChangeNotification <T>(baseDN, new ADNotificationCallback(ADNotificationAdapter.OnNotification), wrappedContext);
            }
            return(cookie);
        }
Exemple #3
0
        // Token: 0x0600035C RID: 860 RVA: 0x000124F8 File Offset: 0x000106F8
        public static T ReadConfiguration <T>(ADConfigurationReader <T> configurationReader, int retryCount)
        {
            if (configurationReader == null)
            {
                throw new ArgumentNullException("configurationReader");
            }
            if (retryCount < 0)
            {
                throw new ArgumentOutOfRangeException("retryCount", "Number of retries must be equal to or larger than zero.");
            }
            T result = default(T);

            ADNotificationAdapter.RunADOperation(delegate()
            {
                result = configurationReader();
            }, retryCount);
            return(result);
        }
Exemple #4
0
 // Token: 0x06000368 RID: 872 RVA: 0x000129FC File Offset: 0x00010BFC
 public static ADOperationResult TryRunADOperation(ADOperation adOperation, int retryCount)
 {
     try
     {
         ADNotificationAdapter.RunADOperation(adOperation, retryCount);
     }
     catch (TransientException ex)
     {
         ExTraceGlobals.ADNotificationsTracer.TraceDebug <TransientException>(0L, "AD operation failed with exception: {0}", ex);
         return(new ADOperationResult(ADOperationErrorCode.RetryableError, ex));
     }
     catch (DataSourceOperationException ex2)
     {
         ExTraceGlobals.ADNotificationsTracer.TraceDebug <DataSourceOperationException>(0L, "AD operation failed with exception: {0}", ex2);
         return(new ADOperationResult(ADOperationErrorCode.PermanentError, ex2));
     }
     catch (DataValidationException ex3)
     {
         ExTraceGlobals.ADNotificationsTracer.TraceDebug <DataValidationException>(0L, "AD operation failed with exception: {0}", ex3);
         return(new ADOperationResult(ADOperationErrorCode.PermanentError, ex3));
     }
     return(ADOperationResult.Success);
 }
Exemple #5
0
 // Token: 0x06000365 RID: 869 RVA: 0x0001295C File Offset: 0x00010B5C
 public static void RunADOperation(ADOperation adOperation)
 {
     ADNotificationAdapter.RunADOperation(adOperation, 10);
 }