コード例 #1
0
            public IReadableUserConfiguration Read(IMailboxSession session, UserConfigurationDescriptor descriptor)
            {
                IReadableUserConfiguration readableUserConfiguration = this.reader.Read(session, descriptor);

                if (readableUserConfiguration != null)
                {
                    this.FaiCacheHit();
                }
                return(readableUserConfiguration);
            }
コード例 #2
0
        public IReadableUserConfiguration GetReadOnlyFolderConfiguration(string configName, UserConfigurationTypes freefetchDataTypes, StoreId folderId)
        {
            IReadableUserConfiguration result = null;

            if (!this.TryGetAggregatedConfiguration(() => UserConfigurationDescriptor.CreateFolderDescriptor(configName, freefetchDataTypes, StoreId.GetStoreObjectId(folderId)), out result))
            {
                result = this.GetFolderConfiguration(configName, freefetchDataTypes, folderId);
            }
            return(result);
        }
コード例 #3
0
        public IReadableUserConfiguration GetReadOnlyMailboxConfiguration(string configName, UserConfigurationTypes freefetchDataTypes)
        {
            IReadableUserConfiguration result = null;

            if (!this.TryGetAggregatedConfiguration(() => UserConfigurationDescriptor.CreateMailboxDescriptor(configName, freefetchDataTypes), out result))
            {
                result = this.GetMailboxConfiguration(configName, freefetchDataTypes);
            }
            return(result);
        }
コード例 #4
0
 public AggregatedUserConfigurationSchema()
 {
     this.all = new List <AggregatedUserConfigurationDescriptor>();
     this.owaUserConfiguration = new AggregatedUserConfigurationDescriptor("Aggregated.OwaUserConfiguration", new UserConfigurationDescriptor[]
     {
         UserConfigurationDescriptor.CreateMailboxDescriptor("OWA.UserOptions", UserConfigurationTypes.Dictionary),
         UserConfigurationDescriptor.CreateDefaultFolderDescriptor("WorkHours", UserConfigurationTypes.XML, DefaultFolderType.Calendar),
         UserConfigurationDescriptor.CreateDefaultFolderDescriptor("Calendar", UserConfigurationTypes.Dictionary, DefaultFolderType.Calendar),
         UserConfigurationDescriptor.CreateMailboxDescriptor("OWA.ViewStateConfiguration", UserConfigurationTypes.Dictionary),
         UserConfigurationDescriptor.CreateDefaultFolderDescriptor("CategoryList", UserConfigurationTypes.XML, DefaultFolderType.Calendar),
         UserConfigurationDescriptor.CreateDefaultFolderDescriptor("MRM", UserConfigurationTypes.Stream | UserConfigurationTypes.XML | UserConfigurationTypes.Dictionary, DefaultFolderType.Inbox),
         UserConfigurationDescriptor.CreateDefaultFolderDescriptor("Inference.Settings", UserConfigurationTypes.Dictionary, DefaultFolderType.Inbox),
         UserConfigurationDescriptor.CreateMailboxDescriptor("AggregatedAccountList", UserConfigurationTypes.XML)
     });
     this.all.Add(this.owaUserConfiguration);
 }
コード例 #5
0
 private bool TryGetAggregatedConfiguration(Func <UserConfigurationDescriptor> descriptorFactory, out IReadableUserConfiguration config)
 {
     config = null;
     if (this.aggregators.Count > 0)
     {
         lock (this.aggregators)
         {
             UserConfigurationDescriptor descriptor = descriptorFactory();
             foreach (UserConfigurationManager.AggregationContext aggregationContext in this.aggregators)
             {
                 config = aggregationContext.Read(this.mailboxSession, descriptor);
                 if (config != null)
                 {
                     break;
                 }
             }
         }
     }
     return(null != config);
 }
コード例 #6
0
 private AggregatedUserConfiguration.PendingUpdate PrepareUpdate(UserConfigurationDescriptor descriptor, ICoreObject item)
 {
     UserConfigurationDescriptor.MementoClass descriptorMemento = descriptor.ToMemento(this.manager.MailboxSession);
     if (this.memento.Pending.Exists((AggregatedUserConfiguration.PendingUpdate p) => descriptorMemento.Equals(p.DescriptorMemento)))
     {
         ExTraceGlobals.StorageTracer.TraceWarning <StoreObjectId, string>((long)this.GetHashCode(), "The core item with id=[{0}] and name=[{1}] already has a pending update.  It will be marked for rebuild.", item.StoreObjectId, descriptor.ConfigurationName);
         this.memento.ConcurrentUpdates.Add(descriptorMemento);
     }
     AggregatedUserConfiguration.PendingUpdate pendingUpdate = new AggregatedUserConfiguration.PendingUpdate
     {
         Guid              = Guid.NewGuid().ToString(),
         PreparedUtc       = ExDateTime.UtcNow.ToBinary(),
         Descriptor        = descriptor,
         DescriptorMemento = descriptorMemento
     };
     this.memento.Pending.Add(pendingUpdate);
     this.Parts.Remove(descriptorMemento);
     this.memento.Parts.Remove(descriptorMemento);
     this.SaveMemento(AggregatedUserConfiguration.SaveFailureMode.Fail);
     return(pendingUpdate);
 }