Exemple #1
0
        protected void RenderGeneralInformation()
        {
            base.Response.Write("<div class='diagBlock'>");
            LocalSession localSession = LocalSession.Current;
            ExchangeRunspaceConfiguration rbacConfiguration = localSession.RbacConfiguration;
            bool flag = localSession.IsInRole("Mailbox+MailboxFullAccess");

            this.Write("Logon user:"******"{0} [{1}]", localSession.Name, rbacConfiguration.ExecutingUserPrimarySmtpAddress));
            this.Write("User-Agent:", HttpContext.Current.Request.UserAgent);
            this.Write("SKU:", Util.IsDataCenter ? "DataCenter" : "On-Premise");
            if (flag)
            {
                this.Write("Mailbox server version:", localSession.Context.MailboxServerVersion);
            }
            else
            {
                this.Write("Mailbox account:", "None mailbox account.");
            }
            this.Write("Current server version:", Util.ApplicationVersion);
            this.Write("Request URL:", HttpContext.Current.GetRequestUrl().ToString());
            this.Write("Display language:", CultureInfo.CurrentCulture.IetfLanguageTag);
            if (flag)
            {
                this.Write("User time zone:", (localSession.UserTimeZone != null) ? localSession.UserTimeZone.DisplayName : "Not set.");
            }
            this.Write("RBAC roles:", this.GetRoles(localSession));
            this.Write("Features:", FlightProvider.Instance.GetAllEnabledFeatures().ToLogString <string>());
            VariantConfigurationSnapshot snapshotForCurrentUser = EacFlightUtility.GetSnapshotForCurrentUser();

            this.Write("Flights:", snapshotForCurrentUser.Flights.ToLogString <string>());
            base.Response.Write("</div>");
        }
        public string GetRewriteUrl(string url)
        {
            string text = null;

            if (url == null)
            {
                throw new ArgumentNullException("url");
            }
            url = url.Trim().Replace('\\', '/');
            if (EacFlightProvider.eacRewriteToSectionMap.ContainsKey(url))
            {
                VariantConfigurationSnapshot snapshotForCurrentUser = EacFlightUtility.GetSnapshotForCurrentUser();
                IUrlMapping @object = snapshotForCurrentUser.Eac.GetObject <IUrlMapping>(EacFlightProvider.eacRewriteToSectionMap[url]);
                text = @object.RemapTo;
                if (text != null)
                {
                    text = text.Trim();
                }
                if (text == string.Empty)
                {
                    text = null;
                }
            }
            return(text);
        }
Exemple #3
0
        public static StoreObjectId OptUserIn(MailboxSession session, VariantConfigurationSnapshot snapshot, IFrontEndLocator frontEndLocator)
        {
            snapshot = ClutterUtilities.LoadSnapshotIfNeeded(session, snapshot);
            StoreObjectId storeObjectId = null;

            if (!session.Mailbox.GetValueOrDefault <bool>(MailboxSchema.InferenceClutterEnabled, false) || !session.Mailbox.GetValueOrDefault <bool>(MailboxSchema.InferenceClassificationEnabled, false))
            {
                using (MailboxSession mailboxSession = ClutterUtilities.OpenAdminSession(session))
                {
                    StoreObjectId storeObjectId2 = ClutterUtilities.SetClassificationEnabled(mailboxSession, true);
                    ClutterUtilities.AddClutterToFavorite(session);
                    ClutterUtilities.VerifyReadyVersionInCrumb(mailboxSession);
                    storeObjectId = session.RefreshDefaultFolder(DefaultFolderType.Clutter);
                    ClutterUtilities.RefreshInferenceProperties(session, true);
                    using (NotificationManager notificationManager = new NotificationManager(session, snapshot, frontEndLocator))
                    {
                        notificationManager.SendNotification(ClutterNotificationType.OptedIn, DefaultFolderType.Inbox);
                        notificationManager.ScheduleNotification(ClutterNotificationType.FirstReminder, 5, DayOfWeek.Monday);
                        notificationManager.CancelScheduledNotification(ClutterNotificationType.AutoEnablementNotice);
                        notificationManager.Save();
                    }
                    ExAssert.RetailAssert(mailboxSession.Mailbox.GetValueOrDefault <bool>(MailboxSchema.InferenceClutterEnabled, false), "InferenceClutterEnabled should have been set to true in admin session");
                    ExAssert.RetailAssert(mailboxSession.Mailbox.GetValueOrDefault <bool>(MailboxSchema.InferenceClassificationEnabled, false), "InferenceClassificationEnabled should have been set to true in admin session");
                    ExAssert.RetailAssert(storeObjectId2 != null, "Clutter folder id created in admin session should not be null");
                    ExAssert.RetailAssert(storeObjectId2.Equals(storeObjectId), "Clutter folder id created in admin session should equal the id created by refreshing the user session");
                    goto IL_FD;
                }
            }
            storeObjectId = ClutterUtilities.ValidateClutterFolder(session);
IL_FD:
            ExAssert.RetailAssert(session.Mailbox.GetValueOrDefault <bool>(MailboxSchema.InferenceClutterEnabled, false), "InferenceClutterEnabled should have been set to true in user session");
            ExAssert.RetailAssert(session.Mailbox.GetValueOrDefault <bool>(MailboxSchema.InferenceClassificationEnabled, false), "InferenceClassificationEnabled should have been set to true in user session");
            ExAssert.RetailAssert(storeObjectId != null, "Clutter folder could not be created");
            return(storeObjectId);
        }
        // Token: 0x060075F5 RID: 30197 RVA: 0x0018411C File Offset: 0x0018231C
        public virtual ResourceLoad GetResourceLoad(WorkloadType type, bool raw = false, object optionalData = null)
        {
            VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null);
            IWorkloadSettings            @object  = snapshot.WorkloadManagement.GetObject <IWorkloadSettings>(type, new object[0]);

            return(this.GetResourceLoad(@object.Classification, raw, optionalData));
        }
        internal static string GetFlightInfoForLog()
        {
            string result;

            try
            {
                bool flag;
                VariantConfigurationSnapshot snapshotForCurrentUser = EacFlightUtility.GetSnapshotForCurrentUser(out flag);
                Dictionary <string, bool>    allEacRelatedFeatures  = EacFlightUtility.GetAllEacRelatedFeatures(snapshotForCurrentUser);
                string[] flights = snapshotForCurrentUser.Flights;
                KeyValuePair <string, string>[] constraints = snapshotForCurrentUser.Constraints;
                result = string.Format("Features:{0},  Flights:[{1}],  Constraints:{2}, IsGlobalSnapshot: {3}", new object[]
                {
                    allEacRelatedFeatures.ToLogString <string, bool>(),
                    (flights == null) ? "" : string.Join(",", flights),
                    constraints.ToLogString <string, string>(),
                    flag.ToString()
                });
            }
            catch (Exception)
            {
                result = "Feature status not available, Flight APIs is in Invalid Status";
            }
            return(result);
        }
Exemple #6
0
        private XElement GetConfigurationDiagnosticInfo(VariantConfigurationSnapshot snapshot)
        {
            XElement xelement = new XElement("Configuration");
            bool     enabled  = snapshot.VariantConfig.InternalAccess.Enabled;

            foreach (string text in VariantConfiguration.Settings.GetComponents(enabled))
            {
                XElement xelement2 = new XElement(text);
                xelement.Add(xelement2);
                VariantConfigurationComponent variantConfigurationComponent = VariantConfiguration.Settings[text];
                foreach (string text2 in variantConfigurationComponent.GetSections(enabled))
                {
                    XElement xelement3 = new XElement(text2);
                    xelement2.Add(xelement3);
                    ISettings @object = snapshot.GetObject <ISettings>(Path.GetFileName(variantConfigurationComponent.FileName), text2);
                    foreach (Type type in new List <Type>(variantConfigurationComponent[text2].Type.GetInterfaces())
                    {
                        variantConfigurationComponent[text2].Type
                    })
                    {
                        foreach (PropertyInfo propertyInfo in type.GetProperties())
                        {
                            if (!propertyInfo.Name.Equals("Name"))
                            {
                                XElement content = new XElement(propertyInfo.Name, this.GetConfigurationDiagnosticValueString(propertyInfo.GetValue(@object)));
                                xelement3.Add(content);
                            }
                        }
                    }
                }
            }
            return(xelement);
        }
        private static T GetObjectForEac <T>(VariantConfigurationSnapshot snapshot, string eacSecion) where T : class, ISettings
        {
            if (eacSecion == null)
            {
                throw new ArgumentNullException("eacSection");
            }
            int num = eacSecion.IndexOf('.');

            if (num == -1 || num == eacSecion.Length - 1)
            {
                throw new ArgumentException(string.Format("Incorrect section name: {0}, the valid EAC feature name should be 'Eac.XXX', 'Global.XXX'", eacSecion));
            }
            string text = eacSecion.Substring(0, num + 1);
            string id   = eacSecion.Substring(num + 1);
            string a;

            if ((a = text) != null)
            {
                if (a == "Global.")
                {
                    return(snapshot.Global.GetObject <T>(id));
                }
                if (a == "Eac.")
                {
                    return(snapshot.Eac.GetObject <T>(id));
                }
            }
            throw new ArgumentException(string.Format("Incorrect section name: {0}, the valid EAC feature name should be 'Eac.XXX', 'Global.XXX'", eacSecion));
        }
Exemple #8
0
        public SyncStateMetadata GetMetadataFromPropertyBag(IStorePropertyBag propertyBag, string displayName, ISyncLogger syncLogger = null)
        {
            byte[] byteArray = null;
            if (!DeviceSyncStateMetadata.TryGetPropertyFromBag <byte[]>(propertyBag, InternalSchema.SyncFolderSourceKey, out byteArray, syncLogger))
            {
                syncLogger.TraceDebug <string>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] Creating custom sync state metadata for folder '{0}'", displayName);
                return(new SyncStateMetadata(this, displayName, null, null));
            }
            StoreObjectId storeObjectId = StoreObjectId.Deserialize(byteArray);

            syncLogger.TraceDebug <string, StoreObjectId>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] Found SyncFolderSourceKey for {0}, so it is a FolderSyncState: {1}", displayName, storeObjectId);
            long localCommitTimeMax  = 0L;
            int  deletedCountTotal   = 0;
            int  syncKey             = 0;
            int  airSyncFilter       = 0;
            bool conversationMode    = false;
            int  airSyncSettingsHash = 0;
            int  airSyncMaxItems     = 0;
            VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null);
            bool flag = snapshot != null && snapshot.DataStorage.IgnoreInessentialMetaDataLoadErrors != null && snapshot.DataStorage.IgnoreInessentialMetaDataLoadErrors.Enabled;

            syncLogger.TraceDebug <bool>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] ignoreInessentialMetaDataLoadErrors: {0}", flag);
            long airSyncLastSyncTime;
            bool flag2 = DeviceSyncStateMetadata.TryGetPropertyFromBag <long>(propertyBag, AirSyncStateSchema.MetadataLastSyncTime, out airSyncLastSyncTime, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <long>(propertyBag, AirSyncStateSchema.MetadataLocalCommitTimeMax, out localCommitTimeMax, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataDeletedCountTotal, out deletedCountTotal, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataSyncKey, out syncKey, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataFilter, out airSyncFilter, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <bool>(propertyBag, AirSyncStateSchema.MetadataConversationMode, out conversationMode, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataSettingsHash, out airSyncSettingsHash, syncLogger);
            bool flag3 = flag2 && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataMaxItems, out airSyncMaxItems, syncLogger);

            flag2 = (flag ? flag2 : flag3);
            if (flag2)
            {
                syncLogger.TraceDebug <string>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] Creating FolderSync metadata for folder '{0}'", displayName);
                return(new FolderSyncStateMetadata(this, displayName, null, null, localCommitTimeMax, deletedCountTotal, syncKey, conversationMode, airSyncFilter, airSyncLastSyncTime, airSyncSettingsHash, airSyncMaxItems, storeObjectId));
            }
            syncLogger.TraceDebug <string>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] Failed to get nullSync properties for sync folder '{0}'.", displayName);
            return(new FolderSyncStateMetadata(this, displayName, null, null, 0L, 0, 0, false, 0, 0L, 0, 0, storeObjectId));
        }
 public static bool IsAuditConfigFromUCCPolicyEnabled(MailboxSession mailboxSession, IExchangePrincipal exchangePrincipal)
 {
     if (AuditFeatureManager.AuditConfigFromUCCPolicyOverride != null)
     {
         return(AuditFeatureManager.AuditConfigFromUCCPolicyOverride());
     }
     if (AuditFeatureManager.isAuditConfigFromUCCPolicyInRegistry)
     {
         bool?flag = AuditFeatureManager.ReadTertiaryValueFromRegistry("SOFTWARE\\Microsoft\\ExchangeServer\\v15\\Audit\\Parameters", "AuditConfigFromUCCPolicyEnabled");
         AuditFeatureManager.isAuditConfigFromUCCPolicyInRegistry = (flag != null);
         if (flag != null)
         {
             return(flag.Value);
         }
     }
     if (mailboxSession != null)
     {
         return(mailboxSession.IsAuditConfigFromUCCPolicyEnabled);
     }
     if (exchangePrincipal != null)
     {
         VariantConfigurationSnapshot configuration = exchangePrincipal.GetConfiguration();
         if (configuration != null)
         {
             return(configuration.Ipaed.AuditConfigFromUCCPolicy.Enabled);
         }
     }
     return(false);
 }
        protected virtual FeaturesManager CreateFeaturesManager()
        {
            IList <string> flightsFromQueryString = this.GetFlightsFromQueryString(this.currentFlightsOverride);
            VariantConfigurationSnapshot configurationSnapshot = string.IsNullOrWhiteSpace(this.rampId) ? VariantConfiguration.GetSnapshot(this.recipient.GetContext(null), null, flightsFromQueryString) : VariantConfiguration.GetSnapshot(this.recipient.GetContext(this.rampId, this.isFirstRelease), null, flightsFromQueryString);

            return(FeaturesManager.Create(configurationSnapshot, this.configurationContext, this.featureStateOverrideFactory));
        }
Exemple #11
0
 // Token: 0x060026B6 RID: 9910 RVA: 0x0008C649 File Offset: 0x0008A849
 public FeaturesManager(VariantConfigurationSnapshot configurationSnapshot, HashSet <string> clientFeatures, HashSet <string> enabledClientOnlyFeature, HashSet <string> enabledServerOnlyFeature, HashSet <string> enabledClientServerOnlyFeature)
 {
     this.configurationSnapshot       = configurationSnapshot;
     this.allEnabledClientFeatures    = clientFeatures;
     this.enabledClientOnlyFeatures   = enabledClientOnlyFeature;
     this.enabledServerOnlyFeatures   = enabledServerOnlyFeature;
     this.enabledClientServerFeatures = enabledClientServerOnlyFeature;
 }
Exemple #12
0
 private static bool IsIncreasingQuotaEnabled(ADUser user)
 {
     if (user != null)
     {
         VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(user.GetContext(null), null, null);
         return(snapshot.Ipaed.IncreaseQuotaForOnHoldMailboxes.Enabled);
     }
     return(false);
 }
Exemple #13
0
 internal static bool IsWorkingSetAgentFeatureEnabled(MiniRecipient miniRecipient)
 {
     if (miniRecipient != null)
     {
         VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(miniRecipient.GetContext(null), null, null);
         return(snapshot.WorkingSet.WorkingSetAgent.Enabled);
     }
     return(false);
 }
 // Token: 0x06001681 RID: 5761 RVA: 0x0007FF98 File Offset: 0x0007E198
 private bool IsFlightingFeatureEnabled(ADUser adUser)
 {
     if (adUser != null)
     {
         VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(adUser.GetContext(null), null, null);
         return(snapshot.MailboxAssistants.PerformRecipientDLExpansion.Enabled);
     }
     RecipientDLExpansionEventBasedAssistant.Tracer.TraceWarning((long)this.GetHashCode(), "Feature is disabled because AD user is null, hence cannot get per user variant snapshot");
     return(false);
 }
 // Token: 0x060004F8 RID: 1272 RVA: 0x00025B0C File Offset: 0x00023D0C
 private static bool IsElcRemoteArchiveFeatureEnabled(ADUser adUser)
 {
     if (adUser != null)
     {
         VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(adUser.GetContext(null), null, null);
         return(snapshot.MailboxAssistants.ElcRemoteArchive.Enabled);
     }
     ArchiveProcessorFactory.Tracer.TraceWarning(0L, "ElcRemoteArchive feature is disabled because AD user is null, hence cannot get per user variant snapshot");
     return(false);
 }
        public static IDeliveryClassificationStrategy Create(MailboxSession session, VariantConfigurationSnapshot snapshot)
        {
            IDeliveryClassificationStrategy result = null;

            if (snapshot != null && ClutterUtilities.IsClassificationEnabled(session, snapshot))
            {
                result = new FolderBasedClassificationStrategy();
            }
            return(result);
        }
Exemple #17
0
        public static bool IsWebRequestAllowed(HttpContext context)
        {
            if (!context.IsAcsOAuthRequest())
            {
                return(true);
            }
            VariantConfigurationSnapshot snapshotForCurrentUser = EacFlightUtility.GetSnapshotForCurrentUser();

            return(OAuthHelper.IsWebRequestAllowed(snapshotForCurrentUser, snapshotForCurrentUser.Eac.GetObjectsOfType <IEacWebRequest>(), context.Request));
        }
Exemple #18
0
        private IConversationCreatorSidCalculator Create(IMailboxSession mailboxSession, IConstraintProvider constraintProvider)
        {
            VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(constraintProvider, null, null);

            if (snapshot.DataStorage.DeleteGroupConversation.Enabled)
            {
                ICoreConversationFactory <IConversation> conversationFactory = new CachedConversationFactory(mailboxSession);
                return(new ConversationCreatorSidCalculator(this.xsoFactory, mailboxSession, conversationFactory));
            }
            return(new LegacyConversationCreatorSidCalculator(mailboxSession));
        }
        // Token: 0x06001640 RID: 5696 RVA: 0x0007DC24 File Offset: 0x0007BE24
        private VariantConfigurationSnapshot GetVariantConfigurationSnapshot(IExchangePrincipal mbxOwner, IRecipientSession recipientSession)
        {
            VariantConfigurationSnapshot result = null;
            ADUser aduser = DirectoryHelper.ReadADRecipient(mbxOwner.MailboxInfo.MailboxGuid, mbxOwner.MailboxInfo.IsArchive, recipientSession) as ADUser;

            if (aduser != null)
            {
                ExTraceGlobals.GeneralTracer.TraceDebug <IExchangePrincipal>((long)this.GetHashCode(), "User found, retrieving flighting information", mbxOwner);
                result = VariantConfiguration.GetSnapshot(aduser.GetContext(null), null, null);
            }
            return(result);
        }
Exemple #20
0
        // Token: 0x060026B4 RID: 9908 RVA: 0x0008C318 File Offset: 0x0008A518
        public static FeaturesManager Create(VariantConfigurationSnapshot configurationSnapshot, IConfigurationContext context, Func <VariantConfigurationSnapshot, IFeaturesStateOverride> featuresStateOverrideFactory)
        {
            IFeaturesStateOverride featureStateOverride = featuresStateOverrideFactory(configurationSnapshot);
            Func <IFeature, bool>  isEnabled            = (IFeature f) => (featureStateOverride == null || featureStateOverride.IsFeatureEnabled(f.Name)) && f.Enabled;
            HashSet <string>       hashSet = new HashSet <string>();

            foreach (object obj in Enum.GetValues(typeof(Feature)))
            {
                if (context.IsFeatureEnabled((Feature)obj))
                {
                    hashSet.Add(obj.ToString());
                }
            }
            foreach (KeyValuePair <string, IFeature> keyValuePair in configurationSnapshot.OwaClient.GetObjectsOfType <IFeature>())
            {
                if (isEnabled(keyValuePair.Value))
                {
                    hashSet.Add(keyValuePair.Value.Name);
                }
            }
            foreach (KeyValuePair <string, IFeature> keyValuePair2 in configurationSnapshot.OwaClientServer.GetObjectsOfType <IFeature>())
            {
                if (isEnabled(keyValuePair2.Value))
                {
                    hashSet.Add(keyValuePair2.Value.Name);
                }
            }
            FeaturesManager result;

            try
            {
                IDictionary <string, IFeature> objectsOfType = configurationSnapshot.OwaClient.GetObjectsOfType <IFeature>();
                HashSet <string> enabledClientOnlyFeature    = new HashSet <string>(from f in objectsOfType.Values
                                                                                    where isEnabled(f)
                                                                                    select f.Name);
                IDictionary <string, IFeature> objectsOfType2 = configurationSnapshot.OwaServer.GetObjectsOfType <IFeature>();
                HashSet <string> enabledServerOnlyFeature     = new HashSet <string>(from f in objectsOfType2.Values
                                                                                     where isEnabled(f)
                                                                                     select f.Name);
                IDictionary <string, IFeature> objectsOfType3   = configurationSnapshot.OwaClientServer.GetObjectsOfType <IFeature>();
                HashSet <string> enabledClientServerOnlyFeature = new HashSet <string>(from f in objectsOfType3.Values
                                                                                       where isEnabled(f)
                                                                                       select f.Name);
                result = new FeaturesManager(configurationSnapshot, hashSet, enabledClientOnlyFeature, enabledServerOnlyFeature, enabledClientServerOnlyFeature);
            }
            catch (KeyNotFoundException ex)
            {
                string message = string.Format("VariantConfigurationSnapshot could not find OWA component settings. Exception {0} {1}.", ex.GetType(), ex.Message);
                ExTraceGlobals.CoreTracer.TraceError(0L, message);
                throw new FlightConfigurationException(message);
            }
            return(result);
        }
        protected virtual bool IsUserFlighted(IRecipientSession adSession, string userLegDn)
        {
            ADRecipient adrecipient = adSession.FindByLegacyExchangeDN(userLegDn);
            ADUser      aduser      = adrecipient as ADUser;

            if (adrecipient == null || aduser == null)
            {
                return(false);
            }
            VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(aduser.GetContext(null), null, null);

            return(snapshot.OwaClientServer.ModernGroupsWorkingSet.Enabled);
        }
Exemple #22
0
 protected ClutterNotification(MailboxSession session, VariantConfigurationSnapshot snapshot, IFrontEndLocator frontEndLocator)
 {
     ArgumentValidator.ThrowIfNull("session", session);
     ArgumentValidator.ThrowIfNull("snapshot", snapshot);
     if (frontEndLocator == null)
     {
         InferenceDiagnosticsLog.Log("ClutterNotification.ctor", "FrontEndLocator was not provided (it must be dependency injected). Using default OWA path.");
     }
     this.Session         = session;
     this.Snapshot        = snapshot;
     this.FrontEndLocator = frontEndLocator;
     this.Culture         = ClutterNotification.GetPreferredCulture(this.Session);
 }
        internal static Dictionary <string, bool> GetAllEacRelatedFeatures(VariantConfigurationSnapshot snapshot)
        {
            Dictionary <string, bool> dictionary = new Dictionary <string, bool>();

            foreach (KeyValuePair <string, IFeature> keyValuePair in snapshot.Global.GetObjectsOfType <IFeature>())
            {
                dictionary.Add("Global." + keyValuePair.Key, keyValuePair.Value.Enabled);
            }
            foreach (KeyValuePair <string, IFeature> keyValuePair2 in snapshot.Eac.GetObjectsOfType <IFeature>())
            {
                dictionary.Add("Eac." + keyValuePair2.Key, keyValuePair2.Value.Enabled);
            }
            return(dictionary);
        }
        // Token: 0x060015A3 RID: 5539 RVA: 0x0007A858 File Offset: 0x00078A58
        public override List <ResourceKey> GetResourceDependencies()
        {
            this.TraceDebugExecuting(ExTraceGlobals.ProbeTimeBasedAssistantTracer.IsTraceEnabled(TraceType.DebugTrace) ? MethodBase.GetCurrentMethod().Name : string.Empty);
            VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null);

            if (!snapshot.WorkloadManagement.DiskLatency.Enabled)
            {
                return(base.GetResourceDependencies());
            }
            List <ResourceKey> resourceDependencies = base.GetResourceDependencies();

            resourceDependencies.Add(new DiskLatencyResourceKey(base.DatabaseInfo.Guid));
            return(resourceDependencies);
        }
        // Token: 0x060005DC RID: 1500 RVA: 0x0002C868 File Offset: 0x0002AA68
        private bool IsMoveDeletionsToPurgesFlightingEnabled()
        {
            bool result = false;

            if (base.MailboxDataForTags.MailboxSession != null)
            {
                VariantConfigurationSnapshot configuration = base.MailboxDataForTags.MailboxSession.MailboxOwner.GetConfiguration();
                if (configuration != null)
                {
                    result = configuration.Ipaed.MoveDeletionsToPurges.Enabled;
                }
            }
            return(result);
        }
Exemple #26
0
        // Token: 0x06000393 RID: 915 RVA: 0x00019684 File Offset: 0x00017884
        private bool IsMoveClearNrnFlightingEnabled()
        {
            bool result = false;

            if (base.MailboxData.MailboxSession != null)
            {
                VariantConfigurationSnapshot configuration = base.MailboxData.MailboxSession.MailboxOwner.GetConfiguration();
                if (configuration != null)
                {
                    result = configuration.Ipaed.MoveClearNrn.Enabled;
                }
            }
            return(result);
        }
        // Token: 0x0600163F RID: 5695 RVA: 0x0007DAA0 File Offset: 0x0007BCA0
        protected override void HandleEventInternal(MapiEvent mapiEvent, MailboxSession itemStore, StoreObject item, List <KeyValuePair <string, object> > customDataToLog)
        {
            ArgumentValidator.ThrowIfNull("mapiEvent", mapiEvent);
            ArgumentValidator.ThrowIfNull("itemStore", itemStore);
            ArgumentValidator.ThrowIfNull("customDataToLog", customDataToLog);
            ExTraceGlobals.GeneralTracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "RemindersAssistant.HandleEventInternal event: {0}", mapiEvent);
            string value = string.Empty;

            try
            {
                VariantConfigurationSnapshot variantConfigurationSnapshot = this.GetVariantConfigurationSnapshot(itemStore.MailboxOwner, itemStore.GetADRecipientSession(true, ConsistencyMode.IgnoreInvalid));
                if (variantConfigurationSnapshot != null)
                {
                    bool flag = Globals.IsItemInDumpster(itemStore, item);
                    if (flag)
                    {
                        ExTraceGlobals.GeneralTracer.TraceDebug((long)this.GetHashCode(), "RemindersAssistant.HandleEventInternal running on a dumpster item");
                    }
                    bool flag2 = false;
                    foreach (IEventProcessor eventProcessor in this.EventProcessors)
                    {
                        if (eventProcessor.IsEnabled(variantConfigurationSnapshot) && eventProcessor.IsEventInteresting(mapiEvent))
                        {
                            ExTraceGlobals.GeneralTracer.TraceDebug <string>((long)this.GetHashCode(), "Calling HandleEventInternal for event processor {0}", eventProcessor.Name);
                            eventProcessor.HandleEvent(mapiEvent, itemStore, item, flag, customDataToLog);
                            flag2 = true;
                        }
                    }
                    if (!flag2)
                    {
                        value = "FlightNotEnabled";
                    }
                }
                else
                {
                    value = "UserNotFound";
                }
            }
            catch (CorruptDataException e)
            {
                this.Log.LogEntry(itemStore, e, false, "CorruptDataException occurred in HandleEvent", new object[0]);
                return;
            }
            catch (Exception e2)
            {
                this.Log.LogEntry(itemStore, e2, false, "Exception occurred in HandleEvent", new object[0]);
                throw;
            }
            customDataToLog.Add(new KeyValuePair <string, object>("SkipEventReason", value));
        }
Exemple #28
0
        public static CalendarUpgrade.CalendarUpgradeStatus MarkMailboxForUpgrade(IMailboxSession session, IXSOFactory xsoFactory)
        {
            ExAssert.RetailAssert(session != null, "session is null");
            ExAssert.RetailAssert(xsoFactory != null, "xsoFactory is null");
            VariantConfigurationSnapshot configuration = session.MailboxOwner.GetConfiguration();

            if (!configuration.DataStorage.CalendarUpgrade.Enabled)
            {
                ExTraceGlobals.StorageTracer.TraceDebug <Guid>(0L, "Mailbox {0}: Not flighted user", session.MailboxGuid);
                return(CalendarUpgrade.CalendarUpgradeStatus.NotFlightedUser);
            }
            if (!CalendarUpgrade.IsInterestingMailboxType(session.MailboxOwner.RecipientTypeDetails))
            {
                ExTraceGlobals.StorageTracer.TraceDebug <Guid>(0L, "Mailbox {0}: Not user mailbox", session.MailboxGuid);
                return(CalendarUpgrade.CalendarUpgradeStatus.NotUserMailbox);
            }
            IXSOMailbox mailbox = session.Mailbox;

            if (!CalendarUpgrade.IsMailboxActive(mailbox))
            {
                ExTraceGlobals.StorageTracer.TraceDebug <Guid>(0L, "Mailbox {0}: Inactive mailbox", session.MailboxGuid);
                return(CalendarUpgrade.CalendarUpgradeStatus.InactiveMailbox);
            }
            if (mailbox.GetValueOrDefault <int?>(MailboxSchema.ItemsPendingUpgrade, null) != null)
            {
                ExTraceGlobals.StorageTracer.TraceDebug <Guid>(0L, "Mailbox {0}: Already marked for upgrade", session.MailboxGuid);
                return(CalendarUpgrade.CalendarUpgradeStatus.AlreadyMarkedForUpgrade);
            }
            int?num  = null;
            int?num2 = null;

            CalendarUpgrade.GetCalendarFolderProperties(session, xsoFactory, out num, out num2);
            if (num != null && num == 1)
            {
                ExTraceGlobals.StorageTracer.TraceDebug <Guid>(0L, "Mailbox {0}: Upgrade complete", session.MailboxGuid);
                return(CalendarUpgrade.CalendarUpgradeStatus.UpgradeComplete);
            }
            int minCalendarItemsForUpgrade = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).DataStorage.CalendarUpgradeSettings.MinCalendarItemsForUpgrade;

            if (num2 == null || num2 < minCalendarItemsForUpgrade)
            {
                ExTraceGlobals.StorageTracer.TraceDebug <Guid>(0L, "Mailbox {0}: Not enough calendar items", session.MailboxGuid);
                return(CalendarUpgrade.CalendarUpgradeStatus.NotEnoughCalendarItems);
            }
            session.Mailbox.SetOrDeleteProperty(MailboxSchema.ItemsPendingUpgrade, num2);
            session.Mailbox.Save();
            ExTraceGlobals.StorageTracer.TraceDebug <Guid>(0L, "Mailbox {0}: Marked for upgrade", session.MailboxGuid);
            return(CalendarUpgrade.CalendarUpgradeStatus.MarkedForUpgrade);
        }
Exemple #29
0
        private XElement GetConstraintDiagnosticInfo(VariantConfigurationSnapshot snapshot)
        {
            XElement xelement = new XElement("Constraints");

            foreach (KeyValuePair <string, string> keyValuePair in snapshot.Constraints)
            {
                XElement content = new XElement("Constraint", new object[]
                {
                    keyValuePair.Value,
                    new XAttribute("Name", keyValuePair.Key)
                });
                xelement.Add(content);
            }
            return(xelement);
        }
        // Token: 0x060003DA RID: 986 RVA: 0x000121DC File Offset: 0x000103DC
        public bool IsAssistantEnabled()
        {
            bool flag;

            if (this.AssistantType.WorkCycle.Equals(TimeSpan.Zero) || this.AssistantType.WorkCycleCheckpoint.Equals(TimeSpan.Zero))
            {
                ExTraceGlobals.TimeBasedDriverManagerTracer.TraceDebug((long)this.GetHashCode(), "{0}: Assistant {1} disabled with work cycle period {2}, work cycle check point {3}", new object[]
                {
                    this,
                    this.AssistantType.Identifier,
                    this.AssistantType.WorkCycle,
                    this.AssistantType.WorkCycleCheckpoint
                });
                flag = false;
            }
            else
            {
                ExTraceGlobals.TimeBasedDriverManagerTracer.TraceDebug <TimeBasedDatabaseDriver, TimeBasedAssistantIdentifier>((long)this.GetHashCode(), "{0}: Assistant {1} enabled on server.", this, this.AssistantType.Identifier);
                flag = true;
            }
            if (flag)
            {
                VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(DatabaseSettingsContext.Get(this.databaseInfo.Guid), null, null);
                flag = snapshot.MailboxAssistants.GetObject <IMailboxAssistantSettings>(this.assistantType.Identifier, new object[0]).Enabled;
                ExTraceGlobals.TimeBasedDriverManagerTracer.TraceDebug((long)this.GetHashCode(), "{0}: Assistant {1} is enabled: {2}, on database {3}.", new object[]
                {
                    this.ToString(),
                    this.assistantType.Identifier,
                    flag,
                    this.databaseInfo.Guid
                });
            }
            lock (this.instanceLock)
            {
                if (flag)
                {
                    if (this.assistantWorkloadState != TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.EnabledAndRunning)
                    {
                        this.assistantWorkloadState = TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.Enabled;
                    }
                }
                else if (this.assistantWorkloadState != TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.DisabledAndNotRunning)
                {
                    this.assistantWorkloadState = TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.Disabled;
                }
            }
            return(flag);
        }