Пример #1
0
        protected override void InternalValidate()
        {
            base.InternalValidate();
            if (base.HasErrors)
            {
                return;
            }
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 796, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\transport\\Queueviewer\\MessageTasks.cs");

            foreach (Fqdn fqdn in this.Target)
            {
                Server server = topologyConfigurationSession.FindServerByFqdn(fqdn);
                if (server == null)
                {
                    base.WriteError(new LocalizedException(QueueViewerStrings.UnknownServer(fqdn)), ErrorCategory.InvalidArgument, null);
                }
                else if (!server.IsHubTransportServer)
                {
                    base.WriteError(new LocalizedException(QueueViewerStrings.NotTransportHubServer(fqdn)), ErrorCategory.InvalidArgument, null);
                }
            }
        }
Пример #2
0
        protected override void InternalValidate()
        {
            base.InternalValidate();
            if (this.OutboundIPPool < 0 || this.OutboundIPPool > 65535)
            {
                base.WriteError(new LocalizedException(QueueViewerStrings.SetMessageOutboundPoolOutsideRange(this.OutboundIPPool, 0, 65535)), ErrorCategory.InvalidData, this.OutboundIPPool);
            }
            if (base.Fields.IsModified("OutboundIPPool") && (!base.Fields.IsModified("Resubmit") || !this.Resubmit))
            {
                base.WriteError(new LocalizedException(QueueViewerStrings.SetMessageResubmitMustBeTrue), ErrorCategory.InvalidData, "Resubmit");
            }
            long          identity      = 1L;
            QueueIdentity queueIdentity = QueueIdentity.Empty;

            if (base.Identity != null)
            {
                identity      = base.Identity.InternalId;
                queueIdentity = base.Identity.QueueIdentity;
            }
            this.properties = new PropertyBagBasedMessageInfo(identity, queueIdentity);
            this.properties.OutboundIPPool = this.OutboundIPPool;
        }
 public LocDescriptionAttribute(QueueViewerStrings.IDs ids) : base(QueueViewerStrings.GetLocalizedString(ids))
 {
 }
Пример #4
0
        public static LocalizedException GetLocalizedException(int errorCode, ObjectId identity, ServerIdParameter server)
        {
            if (errorCode == QVErrorCode.QV_E_OBJECT_NOT_FOUND)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.ObjectNotFound(ErrorMapper.GetIdentityString(identity))));
            }
            if (errorCode == QVErrorCode.QV_E_MULTIPLE_IDENTITY_MATCH)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.MultipleIdentityMatch(ErrorMapper.GetIdentityString(identity))));
            }
            if (errorCode == QVErrorCode.QV_E_INVALID_OPERATION)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.InvalidOperation(ErrorMapper.GetIdentityString(identity))));
            }
            if (errorCode == QVErrorCode.QV_E_INCOMPLETE_IDENTITY)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.IncompleteIdentity(ErrorMapper.GetIdentityString(identity))));
            }
            if (errorCode == QVErrorCode.QV_E_MESSAGE_NOT_SUSPENDED)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.MessageNotSuspended(ErrorMapper.GetIdentityString(identity))));
            }
            if (errorCode == QVErrorCode.QV_E_INVALID_IDENTITY_FOR_EQUALITY)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.InvalidIdentityForEquality));
            }
            if (errorCode == QVErrorCode.QV_E_AMBIGUOUS_PARAMETER_SET)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.AmbiguousParameterSet));
            }
            if (errorCode == QVErrorCode.QV_E_FILTER_TYPE_NOT_SUPPORTED)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.FilterTypeNotSupported));
            }
            if (errorCode == QVErrorCode.QV_E_TEXT_MATCHING_NOT_SUPPORTED)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.TextMatchingNotSupported));
            }
            if (errorCode == QVErrorCode.QV_E_INVALID_FIELD_NAME)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.InvalidFieldName));
            }
            if (errorCode == QVErrorCode.QV_E_TOO_MANY_RESULTS)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.TooManyResults));
            }
            if (errorCode == QVErrorCode.QV_E_INVALID_IDENTITY_STRING)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.InvalidIdentityString));
            }
            if (errorCode == QVErrorCode.QV_E_COMPARISON_NOT_SUPPORTED)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.ComparisonNotSupported));
            }
            if (errorCode == QVErrorCode.QV_E_RPC_SERVER_UNAVAILABLE)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.RpcUnavailable((string)server)));
            }
            if (errorCode == QVErrorCode.QV_E_ENDPOINT_NOT_REGISTERED || errorCode == QVErrorCode.QV_E_UNKNOWN_INTERFACE)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.RpcNotRegistered((string)server)));
            }
            if (errorCode == QVErrorCode.QV_E_INVALID_CLIENT_DATA)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.InvalidClientData));
            }
            if (errorCode == QVErrorCode.QV_E_INVALID_SERVER_DATA)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.InvalidServerData));
            }
            if (errorCode == QVErrorCode.QV_E_INVALID_SERVER_VERSION)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.InvalidServerVersion));
            }
            if (errorCode == QVErrorCode.QV_E_INVALID_SERVER_COLLECTION)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.InvalidServerCollection));
            }
            if (errorCode == QVErrorCode.QV_E_QUEUE_RESUBMIT_IN_PROGRESS)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.QueueResubmitInProgress));
            }
            if (errorCode == QVErrorCode.QV_E_REDIRECT_MESSAGE_IN_PROGRESS)
            {
                return(ErrorMapper.NewLocalizedException(errorCode, QueueViewerStrings.RedirectMessageInProgress));
            }
            Win32Exception ex = new Win32Exception(errorCode);

            return(new LocalizedException(QueueViewerStrings.GenericRpcError(ex.Message, (string)server), ex));
        }