IFxProxyPool IDestinationMailbox.GetFxProxyPool(ICollection <byte[]> folderIds) { MrsTracer.ProxyClient.Function("RemoteDestinationMailbox.GetFxProxyPool", new object[0]); base.VerifyMailboxConnection(); List <byte[]> list = new List <byte[]>(folderIds); byte[] data; long handle = base.MrsProxy.IDestinationMailbox_GetFxProxyPool(base.Handle, list.ToArray(), out data); IDataMessage getDataResponseMsg = FxProxyPoolGetFolderDataResponseMessage.Deserialize(DataMessageOpcode.FxProxyPoolGetFolderDataResponse, data, base.MrsProxyClient.UseCompression); BufferedTransmitter destination = new BufferedTransmitter(new RemoteDataImport(base.MrsProxy, handle, getDataResponseMsg), base.ExportBufferSizeKB, true, base.MrsProxyClient.UseBuffering, base.MrsProxyClient.UseCompression); AsynchronousTransmitter destination2 = new AsynchronousTransmitter(destination, true); return(new FxProxyPoolTransmitter(destination2, true, base.ServerVersion)); }
private void EnsureFolderDataCached() { if (this.folderDataMap != null) { return; } IDataMessage dataMessage = base.WrappedObject.SendMessageAndWaitForReply(FxProxyPoolGetFolderDataRequestMessage.Instance); FxProxyPoolGetFolderDataResponseMessage fxProxyPoolGetFolderDataResponseMessage = dataMessage as FxProxyPoolGetFolderDataResponseMessage; if (fxProxyPoolGetFolderDataResponseMessage == null) { throw new UnexpectedErrorPermanentException(-2147024809); } this.folderDataMap = fxProxyPoolGetFolderDataResponseMessage.FolderData; }
void ISourceMailbox.ExportMessages(List <MessageRec> messages, IFxProxyPool proxyPool, ExportMessagesFlags flags, PropTag[] propsToCopyExplicitly, PropTag[] excludeProps) { MrsTracer.ProxyClient.Function("RemoteSourceMailbox.ExportMessages({0} messages)", new object[] { messages.Count }); if (propsToCopyExplicitly != null) { throw new UnsupportedRemoteServerVersionWithOperationPermanentException(base.MrsProxyClient.ServerName, base.ServerVersion.ToString(), "ISourceMailbox_ExportMessages"); } base.VerifyMailboxConnection(); using (IDataImport dataImport = new FxProxyPoolReceiver(proxyPool, false)) { IDataMessage dataMessage = new FxProxyPoolGetFolderDataResponseMessage(proxyPool.GetFolderData()); DataMessageOpcode dataMessageOpcode; byte[] targetObjectData; dataMessage.Serialize(base.MrsProxyClient.UseCompression, out dataMessageOpcode, out targetObjectData); DataExportBatch dataExportBatch; if (!base.ServerVersion[8]) { if ((flags & ExportMessagesFlags.OneByOne) != ExportMessagesFlags.None || excludeProps != null) { throw new UnsupportedRemoteServerVersionWithOperationPermanentException(base.MrsProxyClient.ServerName, base.ServerVersion.ToString(), "ISourceMailbox_ExportMessages"); } dataExportBatch = base.MrsProxy.ISourceMailbox_ExportMessageBatch2(base.Handle, messages, targetObjectData); } else { int[] data = DataConverter <PropTagConverter, PropTag, int> .GetData(excludeProps); dataExportBatch = base.MrsProxy.ISourceMailbox_ExportMessages(base.Handle, messages, (int)flags, data, targetObjectData); } MessageExportResultReceiver messageExportResultReceiver = null; IDataImport destination = dataImport; if (!base.ServerVersion[16]) { messageExportResultReceiver = new MessageExportResultReceiver(destination, false); destination = messageExportResultReceiver; } using (messageExportResultReceiver) { using (BufferedReceiver bufferedReceiver = new BufferedReceiver(destination, false, base.MrsProxyClient.UseBuffering, base.MrsProxyClient.UseCompression)) { RemoteDataExport.ExportRoutine(base.MrsProxy, dataExportBatch.DataExportHandle, bufferedReceiver, dataExportBatch, base.MrsProxyClient.UseCompression); if (messageExportResultReceiver != null) { List <BadMessageRec> badMessages = messageExportResultReceiver.BadMessages; if (messageExportResultReceiver.MissingMessages != null) { foreach (MessageRec msg in messageExportResultReceiver.MissingMessages) { badMessages.Add(BadMessageRec.MissingItem(msg)); } } if (badMessages != null && badMessages.Count > 0) { throw new DownlevelBadItemsPermanentException(badMessages); } } } } } }