예제 #1
0
        void ISourceFolder.CopyTo(IFxProxy destFxProxy, CopyPropertiesFlags flags, PropTag[] excludeTags)
        {
            MrsTracer.ProxyClient.Function("ISourceFolder.CopyTo({0}): {1}", new object[]
            {
                flags,
                base.FolderName
            });
            byte[]          objectData = destFxProxy.GetObjectData();
            DataExportBatch dataExportBatch;

            if (base.ServerVersion[30])
            {
                dataExportBatch = base.MrsProxy.ISourceFolder_CopyTo(base.Handle, (int)flags, DataConverter <PropTagConverter, PropTag, int> .GetData(excludeTags), objectData);
            }
            else
            {
                dataExportBatch = base.MrsProxy.ISourceFolder_Export2(base.Handle, DataConverter <PropTagConverter, PropTag, int> .GetData(excludeTags), objectData);
            }
            long dataExportHandle = dataExportBatch.DataExportHandle;

            using (FxProxyReceiver fxProxyReceiver = new FxProxyReceiver(destFxProxy, false))
            {
                using (BufferedReceiver bufferedReceiver = new BufferedReceiver(fxProxyReceiver, false, base.MrsProxyClient.UseBuffering, base.MrsProxyClient.UseCompression))
                {
                    RemoteDataExport.ExportRoutine(base.MrsProxy, dataExportHandle, bufferedReceiver, dataExportBatch, base.MrsProxyClient.UseCompression);
                }
            }
        }
예제 #2
0
        void ISourceMailbox.CopyTo(IFxProxy destMailbox, PropTag[] excludeProps)
        {
            MrsTracer.ProxyClient.Function("RemoteSourceMailbox.CopyTo", new object[0]);
            base.VerifyMailboxConnection();
            byte[]          objectData      = destMailbox.GetObjectData();
            DataExportBatch dataExportBatch = base.MrsProxy.ISourceMailbox_Export2(base.Handle, DataConverter <PropTagConverter, PropTag, int> .GetData(excludeProps), objectData);

            using (FxProxyReceiver fxProxyReceiver = new FxProxyReceiver(destMailbox, false))
            {
                using (BufferedReceiver bufferedReceiver = new BufferedReceiver(fxProxyReceiver, false, base.MrsProxyClient.UseBuffering, base.MrsProxyClient.UseCompression))
                {
                    RemoteDataExport.ExportRoutine(base.MrsProxy, dataExportBatch.DataExportHandle, bufferedReceiver, dataExportBatch, base.MrsProxyClient.UseCompression);
                }
            }
        }
예제 #3
0
        string ISourceMailbox.GetMailboxSyncState()
        {
            MrsTracer.ProxyClient.Function("RemoteSourceMailbox.GetMailboxSyncState", new object[0]);
            base.VerifyMailboxConnection();
            DataExportBatch dataExportBatch = base.MrsProxy.ISourceMailbox_GetMailboxSyncState(base.Handle);
            string          syncState       = null;

            using (PagedReceiver pagedReceiver = new PagedReceiver(delegate(string data)
            {
                syncState = data;
            }, base.MrsProxyClient.UseCompression))
            {
                RemoteDataExport.ExportRoutine(base.MrsProxy, dataExportBatch.DataExportHandle, pagedReceiver, dataExportBatch, base.MrsProxyClient.UseCompression);
            }
            return(syncState);
        }
예제 #4
0
        void ISourceMailbox.ExportFolders(List <byte[]> folderIds, IFxProxyPool proxyPool, ExportFoldersDataToCopyFlags exportFoldersDataToCopyFlags, GetFolderRecFlags folderRecFlags, PropTag[] additionalFolderRecProps, CopyPropertiesFlags copyPropertiesFlags, PropTag[] excludeProps, AclFlags extendedAclFlags)
        {
            MrsTracer.ProxyClient.Function("RemoteSourceMailbox.ExportFolders", new object[0]);
            base.VerifyMailboxConnection();
            if (!base.ServerVersion[54])
            {
                throw new UnsupportedRemoteServerVersionWithOperationPermanentException(base.MrsProxyClient.ServerName, base.ServerVersion.ToString(), "ISourceMailbox_ExportFolders");
            }
            DataExportBatch dataExportBatch = base.MrsProxy.ISourceMailbox_ExportFolders(base.Handle, folderIds, (int)exportFoldersDataToCopyFlags, (int)folderRecFlags, DataConverter <PropTagConverter, PropTag, int> .GetData(additionalFolderRecProps), (int)copyPropertiesFlags, DataConverter <PropTagConverter, PropTag, int> .GetData(excludeProps), (int)extendedAclFlags);

            using (IDataImport dataImport = new FxProxyPoolReceiver(proxyPool, false))
            {
                using (BufferedReceiver bufferedReceiver = new BufferedReceiver(dataImport, false, base.MrsProxyClient.UseBuffering, base.MrsProxyClient.UseCompression))
                {
                    RemoteDataExport.ExportRoutine(base.MrsProxy, dataExportBatch.DataExportHandle, bufferedReceiver, dataExportBatch, base.MrsProxyClient.UseCompression);
                }
            }
        }
예제 #5
0
        void ISourceFolder.ExportMessages(IFxProxy destFolderProxy, CopyMessagesFlags flags, byte[][] entryIds)
        {
            MrsTracer.ProxyClient.Function("ISourceFolder.ExportMessages({0}): {1}", new object[]
            {
                flags,
                base.FolderName
            });
            byte[]          objectData       = destFolderProxy.GetObjectData();
            DataExportBatch dataExportBatch  = base.MrsProxy.ISourceFolder_ExportMessages(base.Handle, (int)flags, entryIds, objectData);
            long            dataExportHandle = dataExportBatch.DataExportHandle;

            using (FxProxyReceiver fxProxyReceiver = new FxProxyReceiver(destFolderProxy, false))
            {
                using (BufferedReceiver bufferedReceiver = new BufferedReceiver(fxProxyReceiver, false, base.MrsProxyClient.UseBuffering, base.MrsProxyClient.UseCompression))
                {
                    RemoteDataExport.ExportRoutine(base.MrsProxy, dataExportHandle, bufferedReceiver, dataExportBatch, base.MrsProxyClient.UseCompression);
                }
            }
        }
예제 #6
0
        string IMailbox.LoadSyncState(byte[] key)
        {
            MrsTracer.ProxyClient.Function("RemoteMailbox.LoadSyncState", new object[0]);
            if (!(this is RemoteDestinationMailbox))
            {
                throw new UnsupportedRemoteServerVersionWithOperationPermanentException(base.MrsProxyClient.ServerName, base.ServerVersion.ToString(), "IMailbox_LoadSyncState");
            }
            this.VerifyMailboxConnection();
            DataExportBatch dataExportBatch = base.MrsProxy.IDestinationMailbox_LoadSyncState2(base.Handle, key);
            string          syncState       = null;

            using (PagedReceiver pagedReceiver = new PagedReceiver(delegate(string data)
            {
                syncState = data;
            }, base.MrsProxyClient.UseCompression))
            {
                RemoteDataExport.ExportRoutine(base.MrsProxy, dataExportBatch.DataExportHandle, pagedReceiver, dataExportBatch, base.MrsProxyClient.UseCompression);
            }
            return(syncState);
        }
예제 #7
0
        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);
                            }
                        }
                    }
                }
            }
        }