Ejemplo n.º 1
0
        // Token: 0x06000B7A RID: 2938 RVA: 0x0004A418 File Offset: 0x00048618
        private static bool InternalCheckForAutomaticBooking(bool isEventForConfigObject, MailboxSession itemStore, CachedState cachedState)
        {
            cachedState.LockForRead();
            CalendarConfiguration calendarConfiguration;

            try
            {
                calendarConfiguration = (cachedState.State[0] as CalendarConfiguration);
                if (calendarConfiguration == null || isEventForConfigObject)
                {
                    LockCookie lockCookie = cachedState.UpgradeToWriterLock();
                    try
                    {
                        using (CalendarConfigurationDataProvider calendarConfigurationDataProvider = new CalendarConfigurationDataProvider(itemStore))
                        {
                            calendarConfiguration = (CalendarConfiguration)calendarConfigurationDataProvider.Read <CalendarConfiguration>(null);
                            if (calendarConfiguration == null)
                            {
                                Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_CorruptCalendarConfiguration, null, new object[]
                                {
                                    itemStore.MailboxOwner.LegacyDn
                                });
                                calendarConfigurationDataProvider.Delete(new CalendarConfiguration());
                                calendarConfiguration = new CalendarConfiguration();
                            }
                        }
                        if (calendarConfiguration.AutomateProcessing == CalendarProcessingFlags.AutoAccept)
                        {
                            calendarConfiguration.AddNewRequestsTentatively = true;
                        }
                        cachedState.State[0] = calendarConfiguration;
                        ResourceCheck.Tracer.TraceDebug((long)itemStore.GetHashCode(), "{0}: The calendar settings object was new or has been changed - (re)reading contents.", new object[]
                        {
                            TraceContext.Get()
                        });
                    }
                    catch (ObjectNotFoundException innerException)
                    {
                        ResourceCheck.Tracer.TraceError((long)itemStore.GetHashCode(), "{0}: The calendar configuration was deleted while we were looking at it. Back off and retry.", new object[]
                        {
                            TraceContext.Get()
                        });
                        throw new TransientMailboxException(innerException);
                    }
                    finally
                    {
                        cachedState.DowngradeFromWriterLock(ref lockCookie);
                    }
                }
            }
            finally
            {
                cachedState.ReleaseReaderLock();
            }
            ResourceCheck.Tracer.TraceDebug <object, CalendarProcessingFlags>((long)itemStore.GetHashCode(), "{0}: MailboxType {1}", TraceContext.Get(), calendarConfiguration.AutomateProcessing);
            ResourceCheck.TracerPfd.TracePfd <int, object, CalendarProcessingFlags>((long)itemStore.GetHashCode(), "PFD IWR {0} {1}: ResourceMailbox: {2}", 19223, TraceContext.Get(), calendarConfiguration.AutomateProcessing);
            return(calendarConfiguration.AutomateProcessing == CalendarProcessingFlags.AutoAccept);
        }
Ejemplo n.º 2
0
        // Token: 0x060004EE RID: 1262 RVA: 0x00025828 File Offset: 0x00023A28
        internal static UserRetentionPolicyCache DetailedCheckForRetentionPolicy(MapiEvent mapiEvent, MailboxSession itemStore, StoreObject item, CachedState cachedState)
        {
            UserRetentionPolicyCache userRetentionPolicyCache = null;

            cachedState.LockForRead();
            try
            {
                userRetentionPolicyCache = (cachedState.State[5] as UserRetentionPolicyCache);
                if (userRetentionPolicyCache == null || (item != null && RetentionPolicyCheck.IsEventConfigChange(mapiEvent)) || (userRetentionPolicyCache.HasPendingFaiEvent && userRetentionPolicyCache.PendingFaiEventCounter <= mapiEvent.EventCounter))
                {
                    LockCookie lockCookie = cachedState.UpgradeToWriterLock();
                    try
                    {
                        if (userRetentionPolicyCache == null || !userRetentionPolicyCache.UnderRetentionPolicy)
                        {
                            userRetentionPolicyCache = new UserRetentionPolicyCache();
                        }
                        userRetentionPolicyCache.LoadStoreTagDataFromStore(itemStore);
                        if (!userRetentionPolicyCache.UnderRetentionPolicy)
                        {
                            userRetentionPolicyCache = RetentionPolicyCheck.CachedOffState;
                        }
                        cachedState.State[5] = userRetentionPolicyCache;
                        RetentionPolicyCheck.Tracer.TraceDebug((long)itemStore.GetHashCode(), "{0}: The MRM settings object was new or has been changed - (re)reading contents.", new object[]
                        {
                            TraceContext.Get()
                        });
                    }
                    finally
                    {
                        cachedState.DowngradeFromWriterLock(ref lockCookie);
                    }
                }
            }
            finally
            {
                cachedState.ReleaseReaderLock();
            }
            RetentionPolicyCheck.Tracer.TraceDebug <object, bool>((long)itemStore.GetHashCode(), "{0}: Mailbox under retention policy: {1}", TraceContext.Get(), userRetentionPolicyCache.UnderRetentionPolicy);
            RetentionPolicyCheck.TracerPfd.TracePfd <int, object, bool>((long)itemStore.GetHashCode(), "PFD IWR {0} {1}: Mailbox under retention policy: {2}", 19223, TraceContext.Get(), userRetentionPolicyCache.UnderRetentionPolicy);
            return(userRetentionPolicyCache);
        }