Exemple #1
0
        void IMapiFxProxy.ProcessRequest(FxOpcodes opCode, byte[] data)
        {
            switch (opCode)
            {
            case FxOpcodes.Config:
                this.folderProcessor = FastTransferFolderCopyTo.CreateUploadStateMachine((PstFxFolder)this.targetObject);
                this.uploadContext   = new FastTransferUploadContext(Encoding.ASCII, NullResourceTracker.Instance, PropertyFilterFactory.IncludeAllFactory, false);
                this.uploadContext.PushInitial(this.folderProcessor);
                return;

            case FxOpcodes.TransferBuffer:
                try
                {
                    this.uploadContext.PutNextBuffer(new ArraySegment <byte>(data));
                    return;
                }
                catch (PSTExceptionBase innerException)
                {
                    throw new MailboxReplicationPermanentException(new LocalizedString("TransferBuffer"), innerException);
                }
                break;

            case FxOpcodes.IsInterfaceOk:
            case FxOpcodes.TellPartnerVersion:
                return;
            }
            throw new NotSupportedException();
        }
Exemple #2
0
            public void ProcessRequest(FxOpcodes opCode, byte[] request)
            {
                try
                {
                    switch (opCode)
                    {
                    case FxOpcodes.Config:
                        this.messageProcessor = new FastTransferMessageCopyTo(false, this.message, true);
                        this.uploadContext    = new FastTransferUploadContext(Encoding.ASCII, NullResourceTracker.Instance, PropertyFilterFactory.IncludeAllFactory, false);
                        this.uploadContext.PushInitial(this.messageProcessor);
                        break;

                    case FxOpcodes.TransferBuffer:
                        this.uploadContext.PutNextBuffer(new ArraySegment <byte>(request));
                        break;

                    case FxOpcodes.IsInterfaceOk:
                    case FxOpcodes.TellPartnerVersion:
                        break;

                    default:
                        throw new NotSupportedException();
                    }
                }
                catch (PSTExceptionBase innerException)
                {
                    throw new UnableToCreatePSTMessagePermanentException(this.message.PstMailbox.IPst.FileName, innerException);
                }
            }
 void IMapiFxProxy.ProcessRequest(FxOpcodes opCode, byte[] request)
 {
     using (base.CreateCostHandle())
     {
         base.WrappedObject.ProcessRequest(opCode, request);
     }
     if (request != null)
     {
         base.Charge((uint)request.Length);
     }
 }
 void IMapiFxProxy.ProcessRequest(FxOpcodes opCode, byte[] request)
 {
     base.CreateContext("IMapiFxProxy.ProcessRequest", new DataContext[]
     {
         new SimpleValueDataContext("OpCode", opCode),
         new SimpleValueDataContext("DataLength", (request != null) ? request.Length : 0)
     }).Execute(delegate
     {
         this.WrappedObject.ProcessRequest(opCode, request);
     }, true);
 }
Exemple #5
0
            void IMapiFxProxy.ProcessRequest(FxOpcodes opCode, byte[] request)
            {
                Stopwatch stopwatch = Stopwatch.StartNew();

                try
                {
                    base.WrappedObject.ProcessRequest(opCode, request);
                }
                finally
                {
                    this.updateDuration(stopwatch.Elapsed);
                    stopwatch.Stop();
                }
            }
        void IMapiFxProxy.ProcessRequest(FxOpcodes opCode, byte[] data)
        {
            switch (opCode)
            {
            case FxOpcodes.Config:
            {
                if (data == null || data.Length != 8)
                {
                    throw new FastTransferBufferException("data", (data == null) ? -1 : data.Length);
                }
                uint transferMethod = BitConverter.ToUInt32(data, 4);
                IFastTransferProcessor <FastTransferUploadContext> fxProcessor = this.GetFxProcessor(transferMethod);
                this.uploadContext = new FastTransferUploadContext(Encoding.ASCII, NullResourceTracker.Instance, PropertyFilterFactory.IncludeAllFactory, this.IsMoveUser);
                this.uploadContext.PushInitial(fxProcessor);
                return;
            }

            case FxOpcodes.TransferBuffer:
                ExAssert.RetailAssert(this.uploadContext != null, "StorageFxProxy:ProcessRequest: null upload context");
                try
                {
                    this.uploadContext.PutNextBuffer(new ArraySegment <byte>(data));
                    return;
                }
                catch (ArgumentException innerException)
                {
                    throw new FastTransferArgumentException(innerException);
                }
                break;

            case FxOpcodes.IsInterfaceOk:
            case FxOpcodes.TellPartnerVersion:
                return;
            }
            throw new FastTransferBufferException("opCode", (int)opCode);
        }
 protected abstract void MessageProcessRequest(TMessageEntry message, FxOpcodes opcode, byte[] request);
 protected abstract void FolderProcessRequest(TFolderEntry folder, FxOpcodes opcode, byte[] request);
 void IMapiFxProxy.ProcessRequest(FxOpcodes opCode, byte[] request)
 {
     this.owner.MessageProcessRequest(base.WrappedObject, opCode, request);
 }
Exemple #10
0
 protected override void FolderProcessRequest(MapiFxProxyPool.FolderEntry entry, FxOpcodes opcode, byte[] request)
 {
     entry.Proxy.ProcessRequest(opcode, request);
 }
Exemple #11
0
 protected override void MessageProcessRequest(MapiFxProxyPool.MessageEntry message, FxOpcodes opcode, byte[] request)
 {
     message.Proxy.ProcessRequest(opcode, request);
 }
Exemple #12
0
 public FxProxyImportBufferMessage(FxOpcodes opcode, byte[] data) : base(data)
 {
     this.opcode = opcode;
 }
 void IMapiFxProxy.ProcessRequest(FxOpcodes opCode, byte[] request)
 {
     base.WrappedObject.ProcessRequest(opCode, request);
 }
 void IMapiFxProxy.ProcessRequest(FxOpcodes opcode, byte[] request)
 {
     base.WrappedObject.SendMessage(new FxProxyImportBufferMessage(opcode, request));
 }
 void IMapiFxProxy.ProcessRequest(FxOpcodes opCode, byte[] request)
 {
     this.Pool.BufferOrSendMessage(new FxProxyImportBufferMessage(opCode, request));
 }
Exemple #16
0
 protected override void FolderProcessRequest(PSTFxProxyPool.FolderEntry entry, FxOpcodes opcode, byte[] request)
 {
     throw new NotImplementedException();
 }