Beispiel #1
0
 private QueryFilter ApplyFolderFilter(QueryFilter filter, MailboxInfo mailboxInfo, MultiMailboxSearchClient client)
 {
     if (!string.IsNullOrEmpty(mailboxInfo.Folder))
     {
         Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search folder inclusion Folder:", mailboxInfo.Folder);
         VersionedId versionedId = VersionedId.Deserialize(mailboxInfo.Folder);
         filter = QueryFilter.AndTogether(new QueryFilter[]
         {
             filter,
             new ComparisonFilter(ComparisonOperator.Equal, StoreObjectSchema.ParentEntryId, versionedId.ObjectId)
         });
     }
     else
     {
         List <StoreId> excludedFolderListForMailbox = client.GetExcludedFolderListForMailbox(mailboxInfo);
         if (excludedFolderListForMailbox != null && excludedFolderListForMailbox.Count > 0)
         {
             Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search folder exclusion List:", excludedFolderListForMailbox);
             List <QueryFilter> list = new List <QueryFilter>();
             list.Add(filter);
             list.AddRange(from s in excludedFolderListForMailbox
                           select new ComparisonFilter(ComparisonOperator.NotEqual, StoreObjectSchema.ParentEntryId, s));
             filter = QueryFilter.AndTogether(list.ToArray());
         }
     }
     return(filter);
 }
        private static VersionedId EwsIdToVersionedId(string ewsId, string changeKey, out MailboxId mailboxId)
        {
            IdHeaderInformation idHeaderInformation = ServiceIdConverter.ConvertFromConcatenatedId(ewsId, BasicTypes.Item, null);

            mailboxId = idHeaderInformation.MailboxId;
            byte[]          byteArrayChangeKey;
            StoreObjectType objectType;

            WebServiceMailboxSearchGroup.ParseChangeKeyString(changeKey, out byteArrayChangeKey, out objectType);
            return(VersionedId.Deserialize(idHeaderInformation.StoreIdBytes, byteArrayChangeKey, objectType));
        }
 internal UnifiedPolicyNotificationBase(WorkItemBase workItem, ADObjectId mailboxOwnerId)
 {
     if (workItem == null)
     {
         throw new ArgumentNullException("workItem");
     }
     if (mailboxOwnerId == null)
     {
         throw new ArgumentNullException("mailboxOwnerId");
     }
     this.InternalIdentity = new UnifiedPolicySyncNotificationId(workItem.ExternalIdentity);
     this.workItem         = workItem;
     base.MailboxOwnerId   = mailboxOwnerId;
     if (!string.IsNullOrEmpty(workItem.WorkItemId))
     {
         this.StoreObjectId = VersionedId.Deserialize(workItem.WorkItemId);
     }
 }
Beispiel #4
0
 public void Delete(WorkItemBase item)
 {
     if (item == null)
     {
         throw new ArgumentException("item is null");
     }
     try
     {
         VersionedId rootId = VersionedId.Deserialize(item.WorkItemId);
         using (UnifiedPolicySyncNotificationDataProvider dataProvider = this.GetDataProvider(item.TenantContext.TenantId))
         {
             UnifiedPolicyNotificationBase[] array = (UnifiedPolicyNotificationBase[])dataProvider.Find <UnifiedPolicyNotificationBase>(null, rootId, false, null);
             if (array != null && array.Length > 0)
             {
                 dataProvider.Delete(array[0]);
             }
         }
     }
     catch (ObjectNotFoundException)
     {
     }
     catch (StorageTransientException innerException)
     {
         throw new SyncAgentTransientException("Failed to delete sync workitem from persistent queue because of StorageTransientException", innerException);
     }
     catch (StoragePermanentException innerException2)
     {
         throw new SyncAgentPermanentException("Failed to delete sync workitem from persistent queue because of StoragePermanentException", innerException2);
     }
     catch (TransientException innerException3)
     {
         throw new SyncAgentTransientException("Failed to delete sync workitem from persistent queue because of TransientException", innerException3);
     }
     catch (DataSourceOperationException innerException4)
     {
         throw new SyncAgentPermanentException("Failed to delete sync workitem from persistent queue because of DataSourceOperationException", innerException4);
     }
     catch (DataValidationException innerException5)
     {
         throw new SyncAgentPermanentException("Failed to delete sync workitem from persistent queue because of DataValidationException", innerException5);
     }
 }