예제 #1
0
 void IMailbox.SetOtherSideVersion(VersionInformation otherSideVersion)
 {
     base.CreateContext("IMailbox.SetOtherSideMailboxServerInformation", new DataContext[0]).Execute(delegate
     {
         this.WrappedObject.SetOtherSideVersion(otherSideVersion);
     }, true);
 }
 public FxProxyPoolTransmitter(IDataImport destination, bool ownsDestination, VersionInformation destinationCapabilities) : base(destination, ownsDestination)
 {
     this.currentEntries          = new Stack <FxProxyPoolTransmitter.EntryWrapper>();
     this.pendingOperations       = new Queue <IDataMessage>();
     this.destinationCapabilities = destinationCapabilities;
     this.folderDataMap           = null;
 }
예제 #3
0
 void IMailbox.SetOtherSideVersion(VersionInformation otherSideVersion)
 {
     MrsTracer.ProxyClient.Function("RemoteMailbox.GetMailboxServerInformation", new object[0]);
     this.VerifyMailboxConnection();
     if (!base.ServerVersion[56])
     {
         return;
     }
     base.MrsProxy.IMailbox_SetOtherSideVersion(base.Handle, otherSideVersion);
 }
 public void ReconstructAndThrow(string serverName, VersionInformation serverVersion)
 {
     ExecutionContext.Create(new DataContext[]
     {
         this.DataContext.IsEmpty ? null : new WrappedDataContext(this.DataContext),
         OperationSideDataContext.GetContext(new ExceptionSide?(this.Side)),
         string.IsNullOrEmpty(serverName) ? null : new WrappedDataContext(MrsStrings.RemoteServerName(serverName))
     }).Execute(delegate
     {
         throw this.Reconstruct(serverVersion);
     });
 }
 void IMailboxReplicationService.ExchangeVersionInformation(VersionInformation clientVersion, out VersionInformation serverVersion)
 {
     serverVersion      = VersionInformation.MRS;
     this.clientVersion = clientVersion;
     this.ForwardKnownExceptions(delegate
     {
         if (clientVersion.ProductMajor < VersionInformation.MRS.ProductMajor)
         {
             throw new DownlevelClientsNotSupportedPermanentException();
         }
         if (!clientVersion[0])
         {
             MrsTracer.Service.Error("Talking to downlevel client: no Archive support", new object[0]);
             throw new UnsupportedClientVersionPermanentException(clientVersion.ComputerName, clientVersion.ToString(), "Archives");
         }
     }, null);
 }
 private void ExchangeVersionInformation(MRSCapabilities requiredCapability)
 {
     this.CallService(delegate()
     {
         VersionInformation serverVersion = null;
         base.Channel.ExchangeVersionInformation(VersionInformation.MRS, out serverVersion);
         base.ServerVersion = serverVersion;
     });
     if (!base.ServerVersion[0])
     {
         MrsTracer.Common.Error("Talking to downlevel server: no RTM support", new object[0]);
         throw new UnsupportedRemoteServerVersionWithOperationPermanentException(base.Endpoint.Address.ToString(), base.ServerVersion.ToString(), "E14_RTM_Support");
     }
     if (!base.ServerVersion[(int)requiredCapability])
     {
         MrsTracer.Common.Error("Talking to downlevel server: no {0} support", new object[]
         {
             requiredCapability.ToString()
         });
         throw new UnsupportedRemoteServerVersionWithOperationPermanentException(base.Endpoint.Address.ToString(), base.ServerVersion.ToString(), requiredCapability.ToString());
     }
 }
예제 #7
0
        private static void CallWCFService <ExceptionT>(Action serviceCall, string epAddress, Action <ExceptionT> faultHandler, VersionInformation serverVersion) where ExceptionT : FaultException
        {
            string serviceURI = epAddress;

            if (serverVersion != null)
            {
                serviceURI = string.Format("{0} {1} ({2})", epAddress, serverVersion.ComputerName, serverVersion.ToString());
            }
            try
            {
                serviceCall();
            }
            catch (TimeoutException ex)
            {
                throw new TimeoutErrorTransientException(serviceURI, CommonUtils.FullExceptionMessage(ex), ex);
            }
            catch (ExceptionT exceptionT)
            {
                ExceptionT obj = (ExceptionT)((object)exceptionT);
                faultHandler(obj);
            }
            catch (EndpointNotFoundException ex2)
            {
                throw new EndpointNotFoundTransientException(serviceURI, CommonUtils.FullExceptionMessage(ex2), ex2);
            }
            catch (CommunicationException ex3)
            {
                if (ex3 is FaultException)
                {
                    FaultException ex4 = (FaultException)ex3;
                    if (ex4.Code != null && ex4.Code.SubCode != null && ex4.Code.IsSenderFault && ex4.Code.SubCode.Name == "DeserializationFailed")
                    {
                        throw new CommunicationErrorPermanentException(serviceURI, CommonUtils.FullExceptionMessage(ex3), ex3);
                    }
                }
                throw new CommunicationErrorTransientException(serviceURI, CommonUtils.FullExceptionMessage(ex3), ex3);
            }
            catch (InvalidOperationException ex5)
            {
                throw new InvalidOperationTransientException(serviceURI, CommonUtils.FullExceptionMessage(ex5), ex5);
            }
            catch (InvalidDataException ex6)
            {
                throw new InvalidDataTransientException(serviceURI, CommonUtils.FullExceptionMessage(ex6), ex6);
            }
        }
예제 #8
0
 internal ConnectivityRec(ServerKind serverKind, VersionInformation versionInfo)
 {
     this.ServerKind    = serverKind;
     this.ServerName    = versionInfo.ComputerName;
     this.ServerVersion = versionInfo.ServerVersion;
 }
        private Exception Reconstruct(VersionInformation serverVersion)
        {
            LocalizedException ex             = null;
            Exception          innerException = (this.InnerException != null) ? this.InnerException.Reconstruct(serverVersion) : null;

            if (this.MrsErrorType == MailboxReplicationServiceFault.MRSErrorType.ProxyThrottlingLimitReached)
            {
                ex = new MRSProxyConnectionLimitReachedTransientException(this.Message, innerException);
            }
            else
            {
                WellKnownException ex2 = this.MatchWellKnownException(new WellKnownException[]
                {
                    WellKnownException.StaticCapacityExceededReservation,
                    WellKnownException.WlmCapacityExceededReservation,
                    WellKnownException.WlmResourceUnhealthy
                });
                if (ex2 != WellKnownException.None)
                {
                    switch (ex2)
                    {
                    case WellKnownException.StaticCapacityExceededReservation:
                        ex = new StaticCapacityExceededReservationException(this.ResourceName, this.ResourceType, this.Capacity);
                        break;

                    case WellKnownException.WlmCapacityExceededReservation:
                        ex = new WlmCapacityExceededReservationException(this.ResourceName, this.ResourceType, this.WlmResourceKey, this.WlmResourceMetricType, this.Capacity);
                        break;

                    case WellKnownException.WlmResourceUnhealthy:
                        ex = new WlmResourceUnhealthyException(this.ResourceName, this.ResourceType, this.WlmResourceKey, this.WlmResourceMetricType, this.LoadRatio, this.LoadState, this.LoadMetric);
                        break;
                    }
                }
                if (ex == null)
                {
                    if (this.MrsErrorType == MailboxReplicationServiceFault.MRSErrorType.Transient)
                    {
                        ex = new RemoteTransientException(this.Message, innerException);
                    }
                    else
                    {
                        ex = new RemotePermanentException(this.Message, innerException);
                    }
                }
            }
            IMRSRemoteException ex3 = ex as IMRSRemoteException;

            if (ex3 != null)
            {
                ex3.OriginalFailureType = this.ExceptionType;
                ex3.MapiLowLevelError   = this.MapiLowLevelError;
                ex3.RemoteStackTrace    = this.StackTrace;
                if (this.WKEClasses != null)
                {
                    ex3.WKEClasses = new WellKnownException[this.WKEClasses.Length + 1];
                    for (int i = 0; i < this.WKEClasses.Length; i++)
                    {
                        ex3.WKEClasses[i] = (WellKnownException)this.WKEClasses[i];
                    }
                    ex3.WKEClasses[this.WKEClasses.Length] = WellKnownException.MRSRemote;
                }
                else
                {
                    ex3.WKEClasses = CommonUtils.ClassifyException(ex);
                }
                if (serverVersion != null && !serverVersion[17])
                {
                    if (!CommonUtils.ExceptionIs(ex, new WellKnownException[]
                    {
                        WellKnownException.MRSMailboxIsLocked
                    }) && (MailboxReplicationServiceFault.DownlevelMailboxIsLockedFailureTypes.Contains(ex3.OriginalFailureType) || this.Message.StringId == MrsStrings.DestMailboxAlreadyBeingMoved.StringId || this.Message.StringId == MrsStrings.SourceMailboxAlreadyBeingMoved.StringId))
                    {
                        ex3.WKEClasses = new List <WellKnownException>(ex3.WKEClasses)
                        {
                            WellKnownException.MRSMailboxIsLocked
                        }.ToArray();
                    }
                    if (!CommonUtils.ExceptionIs(ex, new WellKnownException[]
                    {
                        WellKnownException.MapiNotFound
                    }) && ex3.OriginalFailureType == "MapiExceptionNotFound")
                    {
                        ex3.WKEClasses = new List <WellKnownException>(ex3.WKEClasses)
                        {
                            WellKnownException.MapiNotFound
                        }.ToArray();
                    }
                }
            }
            ex.ErrorCode = this.ErrorCode;
            return(ex);
        }