public void FolderExport(ISourceFolder folder, CopyPropertiesFlags flags, PropTag[] excludeTags) { this.RunExportThread(delegate { using (BufferedTransmitter bufferedTransmitter = new BufferedTransmitter(this, this.service.ExportBufferSizeFromMrsKB, false, this.service.UseBufferring, this.service.UseCompression)) { using (AsynchronousTransmitter asynchronousTransmitter = new AsynchronousTransmitter(bufferedTransmitter, false)) { using (FxProxyTransmitter fxProxyTransmitter = new FxProxyTransmitter(asynchronousTransmitter, false)) { folder.CopyTo(fxProxyTransmitter, flags, excludeTags); } } } }); }
private void ExportSingleFolder(IFxProxyPool proxyPool, byte[] folderEntryId, ExportFoldersDataToCopyFlags exportFoldersDataToCopyFlags, GetFolderRecFlags folderRecFlags, PropTag[] additionalFolderRecProps, CopyPropertiesFlags copyPropertiesFlags, PropTag[] excludePropertiesFromCopy, AclFlags extendedAclFlags) { ExecutionContext.Create(new DataContext[] { new OperationDataContext("StorageSourceMailbox.ExportSingleFolder", OperationType.None), new EntryIDsDataContext(folderEntryId), new SimpleValueDataContext("exportFoldersDataToCopyFlags", exportFoldersDataToCopyFlags), new SimpleValueDataContext("folderRecFlags", folderRecFlags), new PropTagsDataContext(additionalFolderRecProps), new SimpleValueDataContext("copyPropertiesFlags", copyPropertiesFlags), new PropTagsDataContext(excludePropertiesFromCopy), new SimpleValueDataContext("extendedAclFlags", extendedAclFlags) }).Execute(delegate { using (this.RHTracker.Start()) { using (ISourceFolder folder = this.GetFolder <StorageSourceFolder>(folderEntryId)) { if (folder == null) { MrsTracer.Provider.Debug("Folder {0} is missing in source. Skipping.", new object[] { TraceUtils.DumpEntryId(folderEntryId) }); } else { using (IFolderProxy folderProxyForExportFolder = StorageSourceMailbox.GetFolderProxyForExportFolder(proxyPool, folder, exportFoldersDataToCopyFlags, folderRecFlags, additionalFolderRecProps)) { if (extendedAclFlags != AclFlags.None) { this.ExportExtendedAcls(extendedAclFlags, folder, folderProxyForExportFolder); } using (FxProxyBudgetWrapper fxProxyBudgetWrapper = new FxProxyBudgetWrapper(folderProxyForExportFolder, false, new Func <IDisposable>(this.RHTracker.StartExclusive), new Action <uint>(this.RHTracker.Charge))) { if (exportFoldersDataToCopyFlags.HasFlag(ExportFoldersDataToCopyFlags.IncludeCopyToStream)) { folder.CopyTo(fxProxyBudgetWrapper, copyPropertiesFlags, excludePropertiesFromCopy); } } } } } } }); }
public override void CopyFolderProperties(FolderRecWrapper sourceFolderRecWrapper, ISourceFolder sourceFolder, IDestinationFolder destFolder, FolderRecDataFlags dataToCopy, out bool wasPropertyCopyingSkipped) { wasPropertyCopyingSkipped = false; if (this.sessionSpecificEntryIds.ContainsKey(sourceFolderRecWrapper.EntryId) && destFolder != null) { if (base.SupportsPerUserReadUnreadDataTransfer) { using (IFxProxy fxProxy = destFolder.GetFxProxy(FastTransferFlags.PassThrough)) { using (IFxProxy fxProxy2 = base.CreateFxProxyTransmissionPipeline(fxProxy)) { sourceFolder.CopyTo(fxProxy2, CopyPropertiesFlags.CopyFolderPerUserData, Array <PropTag> .Empty); } } } base.CopyFolderProperties(sourceFolderRecWrapper, sourceFolder, destFolder, FolderRecDataFlags.Rules, out wasPropertyCopyingSkipped); } }
public void FinalSyncCopyMailboxData() { if (base.MRSJob.TestIntegration.RemoteExchangeGuidOverride == Guid.Empty) { using (IFxProxy fxProxy = base.DestMailbox.GetFxProxy()) { using (IFxProxy fxProxy2 = base.CreateFxProxyTransmissionPipeline(fxProxy)) { base.SourceMailbox.CopyTo(fxProxy2, new PropTag[] { PropTag.ContainerHierarchy, PropTag.ContainerContents }); } } if (this.ServerSupportsInferencePropertiesMove(base.SourceMailboxWrapper.MailboxVersion) && this.ServerSupportsInferencePropertiesMove(base.DestMailboxWrapper.MailboxVersion) && base.MRSJob.GetConfig <bool>("CopyInferenceProperties")) { byte[] badItemId = BitConverter.GetBytes(base.SourceMailbox.GetHashCode()); CommonUtils.ProcessKnownExceptions(delegate { List <PropValueData> list = new List <PropValueData>(2); foreach (PropValueData propValueData in this.SourceMailbox.GetProps(MailboxMover.inferencePropertiesToMove)) { if (((PropTag)propValueData.PropTag).ValueType() != PropType.Error) { list.Add(propValueData); } } badItemId = BadMessageRec.ComputeKey(list.ToArray()); if (!this.SyncState.BadItems.ContainsKey(badItemId)) { this.DestMailbox.SetProps(list.ToArray()); } }, delegate(Exception failure) { if (MapiUtils.IsBadItemIndicator(failure)) { List <BadMessageRec> list = new List <BadMessageRec>(1); list.Add(BadMessageRec.InferenceData(failure, badItemId)); this.ReportBadItems(list); return(true); } return(false); }); } } if (base.SupportsPerUserReadUnreadDataTransfer) { base.Report.Append(MrsStrings.ReportCopyPerUserReadUnreadDataStarted); using (ISourceFolder folder = base.SourceMailbox.GetFolder(null)) { using (IDestinationFolder folder2 = base.DestMailbox.GetFolder(null)) { using (IFxProxy fxProxy3 = folder2.GetFxProxy(FastTransferFlags.PassThrough)) { using (IFxProxy fxProxy4 = base.CreateFxProxyTransmissionPipeline(fxProxy3)) { folder.CopyTo(fxProxy4, CopyPropertiesFlags.CopyMailboxPerUserData, Array <PropTag> .Empty); } } } } base.Report.Append(MrsStrings.ReportCopyPerUserReadUnreadDataCompleted); } }