Esempio n. 1
0
 // Token: 0x06000B42 RID: 2882 RVA: 0x0004FE3E File Offset: 0x0004E03E
 private void EnqueueLicensingError(OwaStoreObjectId messageId, SanitizedHtmlString requestStatusMessage, string requestCorrelator)
 {
     if (this.licensingResponseQueue.EnqueueLicensingError(messageId, requestStatusMessage, requestCorrelator))
     {
         this.DataAvailable(this, EventArgs.Empty);
     }
 }
Esempio n. 2
0
 // Token: 0x06000B4E RID: 2894 RVA: 0x00050218 File Offset: 0x0004E418
 internal LicensingResponse(OwaStoreObjectId messageId, bool failure, SanitizedHtmlString requestStatusMessage, string requestCorrelator)
 {
     this.messageId            = messageId;
     this.failure              = failure;
     this.requestStatusMessage = requestStatusMessage;
     this.requestCorrelator    = requestCorrelator;
 }
Esempio n. 3
0
 // Token: 0x06000B41 RID: 2881 RVA: 0x0004FE1C File Offset: 0x0004E01C
 private void EnqueueLicenseAcquired(OwaStoreObjectId messageId, string requestCorrelator)
 {
     if (this.licensingResponseQueue.EnqueueLicenseAcquired(messageId, requestCorrelator))
     {
         this.DataAvailable(this, EventArgs.Empty);
     }
 }
 // Token: 0x06001464 RID: 5220 RVA: 0x0007C924 File Offset: 0x0007AB24
 internal bool HasDataFolderChanged(OwaStoreObjectId inDataFolderId)
 {
     if (inDataFolderId == null)
     {
         throw new ArgumentNullException("inDataFolderId");
     }
     return(!this.dataFolderId.Equals(inDataFolderId));
 }
Esempio n. 5
0
 internal static OwaStoreObjectId CreateFromMailboxFolderId(StoreObjectId mailboxFolderStoreObjectId)
 {
     if (mailboxFolderStoreObjectId == null)
     {
         throw new ArgumentNullException("mailboxFolderStoreObjectId");
     }
     return(OwaStoreObjectId.CreateFromFolderId(mailboxFolderStoreObjectId, OwaStoreObjectIdType.MailBoxObject));
 }
Esempio n. 6
0
 internal static OwaStoreObjectId CreateFromPublicFolderId(StoreObjectId publicStoreFolderId)
 {
     if (publicStoreFolderId == null)
     {
         throw new ArgumentNullException("publicStoreFolderId");
     }
     return(OwaStoreObjectId.CreateFromFolderId(publicStoreFolderId, OwaStoreObjectIdType.PublicStoreFolder));
 }
Esempio n. 7
0
 private Queue <QueryNotification> GetFolderContentChangePayloadQueue(OwaStoreObjectId folderId)
 {
     if (this.folderContentChangeNotifications.ContainsKey(folderId))
     {
         return(this.folderContentChangeNotifications[folderId].Queue);
     }
     return(null);
 }
Esempio n. 8
0
 internal static OwaStoreObjectId CreateFromOtherUserMailboxFolderId(StoreObjectId otherMailboxFolderStoreObjectId, string legacyDN)
 {
     if (otherMailboxFolderStoreObjectId == null)
     {
         throw new ArgumentNullException("otherMailboxFolderStoreObjectId");
     }
     return(OwaStoreObjectId.CreateFromFolderId(otherMailboxFolderStoreObjectId, OwaStoreObjectIdType.OtherUserMailboxObject, legacyDN));
 }
        // Token: 0x06000FA0 RID: 4000 RVA: 0x000619BC File Offset: 0x0005FBBC
        public void UnsubscribeFolderChanges(OwaStoreObjectId folderId, MailboxSession sessionIn)
        {
            if (!this.userContext.LockedByCurrentThread())
            {
                throw new InvalidOperationException("UserContext lock should be acquired before calling this method");
            }
            MailboxSession mailboxSession = this.userContext.MailboxSession;

            if (sessionIn == null || sessionIn == mailboxSession)
            {
                if (this.omnhLoggedUser != null)
                {
                    this.omnhLoggedUser.SubscribeForFolderChanges();
                    this.omnhLoggedUser.DeleteFolderChangeNotification(folderId);
                    this.UnsubscribeFolderContentChanges(folderId);
                    return;
                }
            }
            else if (Utilities.IsArchiveMailbox(sessionIn))
            {
                if (this.omnhArchives != null)
                {
                    OwaMapiNotificationHandler owaMapiNotificationHandler = null;
                    foreach (OwaMapiNotificationHandler owaMapiNotificationHandler2 in this.omnhArchives)
                    {
                        if (owaMapiNotificationHandler2.ArchiveMailboxSession == sessionIn)
                        {
                            owaMapiNotificationHandler = owaMapiNotificationHandler2;
                            break;
                        }
                    }
                    if (owaMapiNotificationHandler != null)
                    {
                        owaMapiNotificationHandler.SubscribeForFolderChanges();
                        owaMapiNotificationHandler.DeleteFolderChangeNotification(folderId);
                        return;
                    }
                }
            }
            else if (this.omnhDelegates != null)
            {
                OwaMapiNotificationHandler owaMapiNotificationHandler3 = null;
                foreach (OwaMapiNotificationHandler owaMapiNotificationHandler4 in this.omnhDelegates)
                {
                    if (owaMapiNotificationHandler4.DelegateSessionHandle.Session == sessionIn)
                    {
                        owaMapiNotificationHandler3 = owaMapiNotificationHandler4;
                        break;
                    }
                }
                if (owaMapiNotificationHandler3 != null)
                {
                    owaMapiNotificationHandler3.SubscribeForFolderChanges();
                    owaMapiNotificationHandler3.DeleteFolderChangeNotification(folderId);
                }
            }
        }
 internal OwaConditionAdvisor(MailboxSession mailboxSession, OwaStoreObjectId folderId, EventObjectType objectType, EventType eventType)
 {
     this.eventCondition            = new EventCondition();
     this.folderId                  = folderId;
     this.eventCondition.ObjectType = objectType;
     this.eventCondition.EventType  = eventType;
     this.eventCondition.ContainerFolderIds.Add(folderId.StoreObjectId);
     this.conditionAdvisor = ConditionAdvisor.Create(mailboxSession, this.eventCondition);
 }
        // Token: 0x06000FA9 RID: 4009 RVA: 0x00061E3C File Offset: 0x0006003C
        public QueryResult GetFolderQueryResult(OwaStoreObjectId folderId)
        {
            FolderContentChangeNotificationHandler folderContentChangeNotificationHandler = this.GetFolderContentChangeNotificationHandler(folderId);

            if (folderContentChangeNotificationHandler != null)
            {
                return(folderContentChangeNotificationHandler.QueryResult);
            }
            return(null);
        }
        // Token: 0x06000FAA RID: 4010 RVA: 0x00061E5C File Offset: 0x0006005C
        public SortBy[] GetFolderSortBy(OwaStoreObjectId folderId)
        {
            FolderContentChangeNotificationHandler folderContentChangeNotificationHandler = this.GetFolderContentChangeNotificationHandler(folderId);

            if (folderContentChangeNotificationHandler != null)
            {
                return(folderContentChangeNotificationHandler.SortBy);
            }
            return(null);
        }
        // Token: 0x06000FAB RID: 4011 RVA: 0x00061E7C File Offset: 0x0006007C
        public FolderVirtualListViewFilter GetFolderFilter(OwaStoreObjectId folderId)
        {
            FolderContentChangeNotificationHandler folderContentChangeNotificationHandler = this.GetFolderContentChangeNotificationHandler(folderId);

            if (folderContentChangeNotificationHandler != null)
            {
                return(folderContentChangeNotificationHandler.FolderFilter);
            }
            return(null);
        }
        // Token: 0x06000FA7 RID: 4007 RVA: 0x00061D7C File Offset: 0x0005FF7C
        private void RemoveFolderContentChangeSubscription(OwaStoreObjectId folderId)
        {
            FolderContentChangeNotificationHandler folderContentChangeNotificationHandler = this.GetFolderContentChangeNotificationHandler(folderId);

            if (folderContentChangeNotificationHandler != null)
            {
                folderContentChangeNotificationHandler.RemoveSubscription(this.connectionDroppedNotificationHandler);
                folderContentChangeNotificationHandler.Dispose();
                this.folderContentChangeNotificationHandlers.Remove(folderId);
            }
        }
Esempio n. 15
0
 private void ClearFolderContentChangePayload(OwaStoreObjectId folderId)
 {
     lock (this)
     {
         Queue <QueryNotification> folderContentChangePayloadQueue = this.GetFolderContentChangePayloadQueue(folderId);
         if (folderContentChangePayloadQueue != null)
         {
             folderContentChangePayloadQueue.Clear();
         }
     }
 }
Esempio n. 16
0
 public void AttachFolderContentChangeNotificationHandler(OwaStoreObjectId folderId, FolderContentChangeNotificationHandler notificationHandler)
 {
     lock (this)
     {
         if (this.folderContentChangeNotifications.ContainsKey(folderId))
         {
             throw new OwaInvalidOperationException("There is already an active notification handler for this folder. That should not be the case");
         }
         this.folderContentChangeNotifications[folderId] = new EmailPayload.FCNHState(notificationHandler);
     }
 }
Esempio n. 17
0
 // Token: 0x06000D09 RID: 3337 RVA: 0x000585B8 File Offset: 0x000567B8
 private static OtherMailboxConfigEntry FindOtherMailboxConfigEntry(SimpleConfiguration <OtherMailboxConfigEntry> config, string legacyDN)
 {
     foreach (OtherMailboxConfigEntry otherMailboxConfigEntry in config.Entries)
     {
         OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromString(otherMailboxConfigEntry.RootFolderId);
         if (string.Equals(owaStoreObjectId.MailboxOwnerLegacyDN, legacyDN, StringComparison.OrdinalIgnoreCase))
         {
             return(otherMailboxConfigEntry);
         }
     }
     return(null);
 }
Esempio n. 18
0
 public static OwaStoreObjectId CreateFromItemId(StoreObjectId itemStoreObjectId, OwaStoreObjectId containerFolderId)
 {
     if (itemStoreObjectId == null)
     {
         throw new ArgumentNullException("itemStoreObjectId");
     }
     if (containerFolderId == null)
     {
         throw new ArgumentNullException("containerFolderId");
     }
     return(OwaStoreObjectId.CreateFromItemId(itemStoreObjectId, containerFolderId.StoreObjectId, containerFolderId.OwaStoreObjectIdType, containerFolderId.MailboxOwnerLegacyDN));
 }
Esempio n. 19
0
 internal static OwaStoreObjectId CreateFromArchiveMailboxFolderId(StoreObjectId archiveMailboxFolderStoreObjectId, string legacyDN)
 {
     if (archiveMailboxFolderStoreObjectId == null)
     {
         throw new ArgumentNullException("archiveMailboxFolderStoreObjectId");
     }
     if (string.IsNullOrEmpty(legacyDN))
     {
         throw new ArgumentNullException("legacyDN");
     }
     return(OwaStoreObjectId.CreateFromFolderId(archiveMailboxFolderStoreObjectId, OwaStoreObjectIdType.ArchiveMailboxObject, legacyDN));
 }
Esempio n. 20
0
 public void DetachFolderContentChangeNotificationHandler(OwaStoreObjectId folderId)
 {
     lock (this)
     {
         if (this.folderContentChangeNotifications.ContainsKey(folderId))
         {
             this.ClearFolderContentChangePayload(folderId);
             this.folderContentChangeNotifications[folderId].NotificationHandler = null;
             this.folderContentChangeNotifications[folderId].Queue = null;
             this.folderContentChangeNotifications.Remove(folderId);
         }
     }
 }
Esempio n. 21
0
        internal OwaMapiNotificationHandler(UserContext userContext, MailboxSession mailboxSession, OwaStoreObjectIdSessionHandle delegateSessionHandle)
        {
            this.mailboxSession        = mailboxSession;
            this.userContext           = userContext;
            this.delegateSessionHandle = delegateSessionHandle;
            this.owaStoreObjectIdType  = OwaStoreObjectId.GetOwaStoreObjectIdType(userContext, mailboxSession, out this.mailboxOwnerLegacyDN);
            StoreObjectId remindersSearchFolderId = this.userContext.RemindersSearchFolderId;

            this.emailPayload = new EmailPayload(userContext, mailboxSession, this);
            this.emailPayload.RegisterWithPendingRequestNotifier();
            this.searchPayload = new SearchPayload(userContext, mailboxSession, this);
            this.searchPayload.RegisterWithPendingRequestNotifier();
        }
 internal void AsyncAcquireLicenses(OrganizationId organizationId, OwaStoreObjectId messageId, string publishLicense, string userSmtpAddress, SecurityIdentifier userSid, RecipientTypeDetails userType, string requestCorrelator)
 {
     if (organizationId == null)
     {
         throw new ArgumentNullException("organizationId");
     }
     if (messageId == null)
     {
         throw new ArgumentNullException("messageId");
     }
     if (string.IsNullOrEmpty(publishLicense))
     {
         throw new ArgumentNullException("publishLicense");
     }
     if (string.IsNullOrEmpty(userSmtpAddress))
     {
         throw new ArgumentNullException("userSmtpAddress");
     }
     if (userSid == null)
     {
         throw new ArgumentNullException("userSid");
     }
     if (string.IsNullOrEmpty("requestCorrelator"))
     {
         throw new ArgumentNullException("requestCorrelator");
     }
     this.licensingResponseQueue.InitializeErrorIconUrl(this.userContext.GetThemeFileUrl(ThemeFileId.Error));
     this.userCulture = this.userContext.UserCulture;
     this.licensingResponseQueue.InitializeUserCulture(this.userContext.UserCulture);
     try
     {
         IrmLicensingManager.Tracer.TraceDebug((long)this.GetHashCode(), "AsyncAcquireLicenses: issuing async license req. orgId: {0}; msgId: {1}; userId: {2}; correlator: {3}", new object[]
         {
             organizationId,
             messageId,
             userSmtpAddress,
             requestCorrelator
         });
         RmsClientManager.BeginAcquireUseLicenseAndUsageRights(new RmsClientManagerContext(organizationId, RmsClientManagerContext.ContextId.MessageId, messageId.ToString(), publishLicense), publishLicense, userSmtpAddress, userSid, userType, new AsyncCallback(this.AcquireUseLicenseAndUsageRightsCallback), new IrmLicensingManager.AsyncState(messageId, requestCorrelator));
     }
     catch (ExchangeConfigurationException arg)
     {
         IrmLicensingManager.Tracer.TraceError <string, ExchangeConfigurationException>((long)this.GetHashCode(), "AsyncAcquireLicenses: exception at BeginAcquireUseLicenseAndUsageRights.  Correlator: {0}; Exception: {1}", requestCorrelator, arg);
         this.HandleExchangeConfigurationException(messageId, requestCorrelator);
     }
     catch (RightsManagementException ex)
     {
         IrmLicensingManager.Tracer.TraceError <string, RightsManagementException>((long)this.GetHashCode(), "AsyncAcquireLicenses: exception at BeginAcquireUseLicenseAndUsageRights.  Correlator: {0}; Exception: {1}", requestCorrelator, ex);
         this.HandleRightsManagementException(ex, messageId, requestCorrelator);
     }
 }
Esempio n. 23
0
 public void DeleteFolderCountsNotification(OwaStoreObjectId folderId)
 {
     if (!this.userContext.LockedByCurrentThread())
     {
         throw new InvalidOperationException("UserContext lock should be acquired before calling this method");
     }
     lock (this)
     {
         if (this.folderCountsList != null && this.folderCountsList.Contains(folderId))
         {
             this.folderCountsList.Remove(folderId);
         }
     }
 }
        // Token: 0x0600191C RID: 6428 RVA: 0x00092254 File Offset: 0x00090454
        private Folder GetFolderFromId(OwaStoreObjectId owaStoreObjectId)
        {
            Folder result = null;

            try
            {
                result = Utilities.GetFolder <Folder>(this.userContext, owaStoreObjectId, this.folderViewProperties);
            }
            catch (ObjectNotFoundException)
            {
                ExTraceGlobals.WebPartRequestTracer.TraceDebug <string>(0L, "Web part request could not bind to folder {0}.  User may not have sufficient folder permissions", owaStoreObjectId.ToBase64String());
            }
            return(result);
        }
        // Token: 0x0600191D RID: 6429 RVA: 0x000922A4 File Offset: 0x000904A4
        private Folder GetFolderFromPath(string path, bool isPublicFolder)
        {
            string[] array = path.Split(new char[]
            {
                '/',
                '\\'
            }, StringSplitOptions.RemoveEmptyEntries);
            CultureInfo          userCulture   = Culture.GetUserCulture();
            StoreObjectId        storeObjectId = null;
            StoreSession         storeSession  = null;
            OwaStoreObjectIdType objectIdType  = OwaStoreObjectIdType.MailBoxObject;

            try
            {
                if (isPublicFolder)
                {
                    storeSession  = PublicFolderSession.OpenAsAdmin(this.userContext.ExchangePrincipal.MailboxInfo.OrganizationId, this.userContext.ExchangePrincipal, Guid.Empty, null, userCulture, "Client=OWA;Action=WebPart + Admin + GetFolderFromPath", null);
                    storeObjectId = this.userContext.PublicFolderRootId;
                    objectIdType  = OwaStoreObjectIdType.PublicStoreFolder;
                }
                else
                {
                    storeSession = MailboxSession.OpenAsAdmin(this.owaContext.ExchangePrincipal, userCulture, "Client=OWA;Action=WebPart + Admin + GetFolderFromPath");
                    GccUtils.SetStoreSessionClientIPEndpointsFromHttpRequest(storeSession, this.owaContext.HttpContext.Request);
                    storeObjectId = this.userContext.GetRootFolderId(this.userContext.MailboxSession);
                }
                for (int i = 0; i < array.Length; i++)
                {
                    object[][] folderIdByDisplayName = this.GetFolderIdByDisplayName(array[i], storeObjectId, storeSession);
                    if (folderIdByDisplayName == null || folderIdByDisplayName.Length == 0)
                    {
                        return(null);
                    }
                    storeObjectId = ((VersionedId)folderIdByDisplayName[0][0]).ObjectId;
                }
            }
            finally
            {
                if (storeSession != null)
                {
                    storeSession.Dispose();
                    storeSession = null;
                }
            }
            if (storeObjectId == null)
            {
                return(null);
            }
            return(this.GetFolderFromId(OwaStoreObjectId.CreateFromFolderId(storeObjectId, objectIdType)));
        }
Esempio n. 26
0
 public void AddFolderChangeNotification(OwaStoreObjectId folderId)
 {
     if (!this.userContext.LockedByCurrentThread())
     {
         throw new InvalidOperationException("UserContext lock should be acquired before calling this method");
     }
     lock (this)
     {
         if (!this.folderChangeList.Contains(folderId))
         {
             this.folderChangeList.Add(folderId);
         }
     }
 }
Esempio n. 27
0
        private static void DeleteAdvisorFromTable <T>(OwaStoreObjectId folderId, Dictionary <OwaStoreObjectId, T> advisorTable) where T : IDisposable
        {
            if (folderId == null)
            {
                throw new ArgumentNullException("folderId");
            }
            if (advisorTable == null || !advisorTable.ContainsKey(folderId))
            {
                return;
            }
            T t = advisorTable[folderId];

            advisorTable.Remove(folderId);
            t.Dispose();
        }
        // Token: 0x0600191A RID: 6426 RVA: 0x00092150 File Offset: 0x00090350
        private OwaStoreObjectId GetFolderId(string folderId, bool isPublicFolder)
        {
            OwaStoreObjectId result = null;

            try
            {
                StoreObjectId folderStoreObjectId = Utilities.CreateStoreObjectId(folderId);
                result = OwaStoreObjectId.CreateFromFolderId(folderStoreObjectId, isPublicFolder ? OwaStoreObjectIdType.PublicStoreFolder : OwaStoreObjectIdType.MailBoxObject);
            }
            catch (OwaInvalidIdFormatException)
            {
                ExTraceGlobals.WebPartRequestTracer.TraceDebug <string>(0L, "Web part request invalid store object id: {0}", folderId);
            }
            return(result);
        }
        internal PublicFolderViewStates(UserContext userContext, Folder folder)
        {
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            if (folder == null)
            {
                throw new ArgumentNullException("folder");
            }
            this.cache = PublicFolderViewStatesCache.GetInstance(userContext);
            OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromStoreObject(folder);

            this.folderId = owaStoreObjectId.ToString();
        }
        // Token: 0x06000FA2 RID: 4002 RVA: 0x00061B7C File Offset: 0x0005FD7C
        public void SubscribeForFolderContentChanges(MailboxSession sessionIn, OwaStoreObjectId contextFolderId, OwaStoreObjectId dataFolderId, QueryResult queryResult, ListViewContents2 listView, PropertyDefinition[] subscriptionProperties, Dictionary <PropertyDefinition, int> propertyMap, SortBy[] sortBy, FolderVirtualListViewFilter folderFilter, bool isConversationView)
        {
            MailboxSession mailboxSession = this.userContext.MailboxSession;

            this.SubscribeForFolderChanges(contextFolderId, sessionIn);
            if (queryResult == null)
            {
                return;
            }
            if (sessionIn == mailboxSession)
            {
                FolderContentChangeNotificationHandler folderContentChangeNotificationHandler = null;
                this.folderContentChangeNotificationHandlers.TryGetValue(contextFolderId, out folderContentChangeNotificationHandler);
                if (folderContentChangeNotificationHandler != null && folderContentChangeNotificationHandler.NeedReinitSubscriptions)
                {
                    this.RemoveFolderContentChangeSubscription(contextFolderId);
                    folderContentChangeNotificationHandler = null;
                }
                if (folderContentChangeNotificationHandler == null)
                {
                    this.ClearOldFolderContentChangeSubscriptions();
                    this.InitializeConnectionDroppedHandler();
                    folderContentChangeNotificationHandler = new FolderContentChangeNotificationHandler(this.userContext, mailboxSession, contextFolderId, dataFolderId, queryResult, this.omnhLoggedUser.EmailPayload, listView, subscriptionProperties, propertyMap, sortBy, folderFilter, isConversationView);
                    try
                    {
                        if (!folderContentChangeNotificationHandler.TrySubscribe(this.connectionDroppedNotificationHandler))
                        {
                            ExTraceGlobals.NotificationsCallTracer.TraceError((long)this.GetHashCode(), "Failed to create a folder content change subscription.");
                            folderContentChangeNotificationHandler.Dispose();
                            folderContentChangeNotificationHandler = null;
                            return;
                        }
                        this.folderContentChangeNotificationHandlers[contextFolderId] = folderContentChangeNotificationHandler;
                        folderContentChangeNotificationHandler = null;
                        return;
                    }
                    finally
                    {
                        if (folderContentChangeNotificationHandler != null)
                        {
                            folderContentChangeNotificationHandler.Dispose();
                            folderContentChangeNotificationHandler = null;
                        }
                    }
                }
                folderContentChangeNotificationHandler.MissedNotifications = false;
            }
        }