コード例 #1
0
        public static QueueIdentity ParsePattern(string identity, ref MatchOptions matchOptions)
        {
            QueueIdentity queueIdentity = QueueIdentity.InternalParse(identity, true, false);

            queueIdentity.ParseDomain(ref matchOptions);
            return(queueIdentity);
        }
コード例 #2
0
 public void Reset(long identity, QueueIdentity queueIdentity)
 {
     this.propertyBag = new MessageInfoPropertyBag();
     this[this.propertyBag.ObjectIdentityPropertyDefinition] = new MessageIdentity(identity, queueIdentity);
     this.Subject           = null;
     this.InternetMessageId = null;
     this.FromAddress       = null;
     this.Status            = MessageStatus.None;
     this.Size = default(ByteQuantifiedSize);
     this.MessageSourceName = null;
     this.SourceIP          = null;
     this.SCL              = 0;
     this.DateReceived     = default(DateTime);
     this.ExpirationTime   = null;
     this.LastError        = null;
     this.LastErrorCode    = 0;
     this.RetryCount       = 0;
     this.Recipients       = null;
     this.ComponentLatency = null;
     this.MessageLatency   = default(EnhancedTimeSpan);
     this.DeferReason      = null;
     this.LockReason       = null;
     this.IsProbeMessage   = false;
     this.OutboundIPPool   = 0;
     this.Directionality   = MailDirectionality.Undefined;
     this.ExternalDirectoryOrganizationId = default(Guid);
     this.OriginalFromAddress             = null;
     this.AccountForest = null;
 }
コード例 #3
0
        private MessageIdentity(PropertyStreamReader reader)
        {
            KeyValuePair <string, object> item;

            reader.Read(out item);
            if (!string.Equals("NumProperties", item.Key, StringComparison.OrdinalIgnoreCase))
            {
                throw new SerializationException(string.Format("Cannot deserialize MessageIdentity. Expected property NumProperties, but found property '{0}'", item.Key));
            }
            int value = PropertyStreamReader.GetValue <int>(item);

            for (int i = 0; i < value; i++)
            {
                reader.Read(out item);
                if (string.Equals("InternalId", item.Key, StringComparison.OrdinalIgnoreCase))
                {
                    this.internalId = PropertyStreamReader.GetValue <long>(item);
                }
                else if (string.Equals("QueueIdentity", item.Key, StringComparison.OrdinalIgnoreCase))
                {
                    this.queueIdentity = QueueIdentity.Create(reader);
                }
                else
                {
                    ExTraceGlobals.SerializationTracer.TraceWarning <string>(0L, "Ignoring unknown property '{0} in messageIdentity", item.Key);
                }
            }
        }
コード例 #4
0
        public static int Compare(ObjectId a, ObjectId b)
        {
            MessageIdentity messageIdentity  = (MessageIdentity)a;
            MessageIdentity messageIdentity2 = (MessageIdentity)b;

            if (messageIdentity == messageIdentity2)
            {
                return(0);
            }
            if (messageIdentity == null && messageIdentity2 != null)
            {
                return(-1);
            }
            if (messageIdentity != null && messageIdentity2 == null)
            {
                return(1);
            }
            int num = messageIdentity.internalId.CompareTo(messageIdentity2.internalId);

            if (num != 0)
            {
                return(num);
            }
            return(QueueIdentity.Compare(messageIdentity.queueIdentity, messageIdentity2.queueIdentity));
        }
コード例 #5
0
 public MessageIdentity(long identity, QueueIdentity queueIdentity) : this(identity)
 {
     if (queueIdentity == null)
     {
         throw new ArgumentNullException("QueueIdentity");
     }
     this.queueIdentity = queueIdentity;
 }
コード例 #6
0
        private PropertyBagBasedQueueInfo(PropertyStreamReader reader) : base(new QueueInfoPropertyBag())
        {
            KeyValuePair <string, object> item;

            reader.Read(out item);
            if (!string.Equals("NumProperties", item.Key, StringComparison.OrdinalIgnoreCase))
            {
                throw new SerializationException(string.Format("Cannot deserialize PropertyBagBasedQueueInfo. Expected property NumProperties, but found '{0}'", item.Key));
            }
            int value = PropertyStreamReader.GetValue <int>(item);

            for (int i = 0; i < value; i++)
            {
                reader.Read(out item);
                if (string.Equals(ExtensibleQueueInfoSchema.Identity.Name, item.Key, StringComparison.OrdinalIgnoreCase))
                {
                    QueueIdentity value2 = QueueIdentity.Parse(PropertyStreamReader.GetValue <string>(item));
                    this[this.propertyBag.ObjectIdentityPropertyDefinition] = value2;
                }
                else if (string.Equals(ExtensibleQueueInfoSchema.DeliveryType.Name, item.Key, StringComparison.OrdinalIgnoreCase))
                {
                    DeliveryType deliveryType = (DeliveryType)PropertyStreamReader.GetValue <int>(item);
                    this.propertyBag[ExtensibleQueueInfoSchema.DeliveryType] = deliveryType;
                }
                else if (string.Equals(ExtensibleQueueInfoSchema.Status.Name, item.Key, StringComparison.OrdinalIgnoreCase))
                {
                    QueueStatus value3 = (QueueStatus)PropertyStreamReader.GetValue <int>(item);
                    this.propertyBag[ExtensibleQueueInfoSchema.Status] = value3;
                }
                else if (string.Equals(ExtensibleQueueInfoSchema.RiskLevel.Name, item.Key, StringComparison.OrdinalIgnoreCase))
                {
                    RiskLevel value4 = (RiskLevel)PropertyStreamReader.GetValue <int>(item);
                    this.propertyBag[ExtensibleQueueInfoSchema.RiskLevel] = value4;
                }
                else if (string.Equals(ExtensibleQueueInfoSchema.NextHopCategory.Name, item.Key, StringComparison.OrdinalIgnoreCase))
                {
                    NextHopCategory value5 = (NextHopCategory)PropertyStreamReader.GetValue <int>(item);
                    this.propertyBag[ExtensibleQueueInfoSchema.NextHopCategory] = value5;
                }
                else
                {
                    PropertyDefinition fieldByName = PropertyBagBasedQueueInfo.schema.GetFieldByName(item.Key);
                    if (fieldByName != null)
                    {
                        this.propertyBag.SetField((QueueViewerPropertyDefinition <ExtensibleQueueInfo>)fieldByName, item.Value);
                    }
                    else
                    {
                        ExTraceGlobals.SerializationTracer.TraceWarning <string>(0L, "Cannot convert key index '{0}' into a property in the ExtensibleQueueInfo schema", item.Key);
                    }
                }
            }
            if (this.propertyBag[ExtensibleQueueInfoSchema.NextHopDomain] != null)
            {
                QueueIdentity queueIdentity = (QueueIdentity)this[this.propertyBag.ObjectIdentityPropertyDefinition];
                queueIdentity.NextHopDomain = (string)this.propertyBag[ExtensibleQueueInfoSchema.NextHopDomain];
            }
        }
コード例 #7
0
        public QueueIdentity(ExtensibleQueueInfo queue) : this()
        {
            QueueIdentity queueIdentity = (QueueIdentity)queue.Identity;

            this.server        = queueIdentity.server;
            this.queueType     = queueIdentity.queueType;
            this.queueRowId    = queueIdentity.queueRowId;
            this.nextHopDomain = queueIdentity.nextHopDomain;
        }
コード例 #8
0
        public int CompareTo(object obj)
        {
            QueueIdentity queueIdentity = obj as QueueIdentity;

            if (queueIdentity == null)
            {
                throw new ArgumentException(DataStrings.ExceptionQueueIdentityCompare(obj.GetType().FullName));
            }
            return(QueueIdentity.Compare(this, queueIdentity));
        }
コード例 #9
0
 public bool Match(QueueIdentity matchPattern, MatchOptions matchOptions)
 {
     if (!PagedObjectSchema.MatchString(this.NextHopDomain, matchPattern.nextHopDomain, matchOptions))
     {
         return(false);
     }
     if (string.IsNullOrEmpty(this.server))
     {
         throw new InvalidOperationException();
     }
     return(string.IsNullOrEmpty(matchPattern.server) || this.server.Equals(matchPattern.server, StringComparison.OrdinalIgnoreCase));
 }
コード例 #10
0
        public static int Compare(ObjectId a, ObjectId b)
        {
            QueueIdentity queueIdentity  = (QueueIdentity)a;
            QueueIdentity queueIdentity2 = (QueueIdentity)b;

            if (queueIdentity == queueIdentity2)
            {
                return(0);
            }
            if (queueIdentity == null && queueIdentity2 != null)
            {
                return(-1);
            }
            if (queueIdentity != null && queueIdentity2 == null)
            {
                return(1);
            }
            if (queueIdentity.IsEmpty || queueIdentity2.IsEmpty)
            {
                throw new QueueViewerException(QVErrorCode.QV_E_INCOMPLETE_IDENTITY);
            }
            int num2;

            if (queueIdentity.queueType != QueueType.Undefined && queueIdentity2.queueType != QueueType.Undefined)
            {
                int num = (int)queueIdentity.queueType;
                num2 = num.CompareTo((int)queueIdentity2.queueType);
                if (num2 != 0)
                {
                    return(num2);
                }
            }
            if (queueIdentity.queueRowId != 0L && queueIdentity2.queueRowId != 0L)
            {
                num2 = queueIdentity.queueRowId.CompareTo(queueIdentity2.queueRowId);
            }
            else
            {
                num2 = string.Compare(queueIdentity.nextHopDomain, queueIdentity2.nextHopDomain, StringComparison.OrdinalIgnoreCase);
            }
            if (num2 != 0)
            {
                return(num2);
            }
            if (string.IsNullOrEmpty(queueIdentity.server) || string.IsNullOrEmpty(queueIdentity2.server))
            {
                return(0);
            }
            return(string.Compare(queueIdentity.server, queueIdentity2.server, StringComparison.OrdinalIgnoreCase));
        }
コード例 #11
0
ファイル: MessageInfo.cs プロジェクト: YHZX2013/exchange_diff
 public void Reset(long identity, QueueIdentity queueIdentity)
 {
     this.identity          = new MessageIdentity(identity, queueIdentity);
     this.subject           = null;
     this.internetMessageId = null;
     this.fromAddress       = null;
     this.status            = MessageStatus.None;
     this.size = default(ByteQuantifiedSize);
     this.messageSourceName = null;
     this.sourceIP          = null;
     this.scl              = 0;
     this.dateReceived     = default(DateTime);
     this.expirationTime   = null;
     this.lastError        = null;
     this.lastErrorCode    = 0;
     this.retryCount       = 0;
     this.recipients       = null;
     this.componentLatency = null;
     this.messageLatency   = default(EnhancedTimeSpan);
 }
コード例 #12
0
        internal static MessageIdentity InternalParse(string identity, bool queuePartAlwaysAsDomain)
        {
            int    num  = identity.LastIndexOf('\\');
            string text = null;
            string text2;

            if (num == -1)
            {
                text2 = identity;
            }
            else
            {
                text2 = identity.Substring(num + 1);
                text  = identity.Substring(0, num);
            }
            if (string.IsNullOrEmpty(text2))
            {
                throw new ArgumentNullException("Identity");
            }
            QueueIdentity queueIdentity;

            if (!string.IsNullOrEmpty(text))
            {
                queueIdentity = QueueIdentity.InternalParse(text, queuePartAlwaysAsDomain, false);
            }
            else
            {
                queueIdentity = QueueIdentity.Empty;
            }
            long identity2;

            if (long.TryParse(text2, out identity2))
            {
                return(new MessageIdentity(identity2, queueIdentity));
            }
            throw new ArgumentException(DataStrings.ExceptionParseInternalMessageId, "Identity");
        }
コード例 #13
0
 internal PropertyBagBasedQueueInfo(QueueIdentity identity) : base(new QueueInfoPropertyBag())
 {
     this[this.propertyBag.ObjectIdentityPropertyDefinition] = identity;
     this.NextHopDomain = identity.NextHopDomain;
     this.propertyBag[ExtensibleQueueInfoSchema.PriorityDescriptions] = base.PriorityDescriptions;
 }
コード例 #14
0
 public static bool operator ==(QueueIdentity v1, QueueIdentity v2)
 {
     return(QueueIdentity.Compare(v1, v2) == 0);
 }
コード例 #15
0
 internal ExtensibleMessageInfo(long identity, QueueIdentity queueIdentity, MessageInfoPropertyBag propertyBag) : base(propertyBag)
 {
     this[this.propertyBag.ObjectIdentityPropertyDefinition] = new MessageIdentity(identity, queueIdentity);
 }
コード例 #16
0
 internal QueueInfo(QueueIdentity identity)
 {
     this.identity = identity;
 }
コード例 #17
0
 public MessageIdentity(QueueIdentity queueId)
 {
     this.queueIdentity = queueId;
 }
コード例 #18
0
        internal static QueueIdentity InternalParse(string identity, bool queuePartAlwaysAsDomain, bool implicitShadow)
        {
            int    num  = identity.IndexOf('\\');
            string text = null;
            string text2;

            if (num == -1)
            {
                text2 = identity;
            }
            else
            {
                text = identity.Substring(0, num);
                if (string.Equals(text, QueueIdentity.ShadowIdentityString, StringComparison.OrdinalIgnoreCase))
                {
                    text  = null;
                    text2 = identity;
                }
                else
                {
                    text2 = identity.Substring(num + 1);
                }
            }
            if (string.IsNullOrEmpty(text2))
            {
                throw new ExArgumentNullException("QueueIdentity");
            }
            string text3 = QueueIdentity.ShadowIdentityString + "\\";
            bool   flag  = text2.StartsWith(text3, StringComparison.OrdinalIgnoreCase);

            if (flag)
            {
                text2 = text2.Substring(text3.Length);
            }
            QueueIdentity queueIdentity = new QueueIdentity();
            int           num2;

            if (!queuePartAlwaysAsDomain && int.TryParse(text2, out num2))
            {
                queueIdentity.queueType  = ((flag || implicitShadow) ? QueueType.Shadow : QueueType.Delivery);
                queueIdentity.queueRowId = (long)num2;
            }
            else if (!queuePartAlwaysAsDomain && string.Compare(text2, QueueIdentity.PoisonIdentityString, StringComparison.OrdinalIgnoreCase) == 0)
            {
                queueIdentity.queueType = QueueType.Poison;
            }
            else if (!queuePartAlwaysAsDomain && string.Compare(text2, QueueIdentity.SubmissionIdentityString, StringComparison.OrdinalIgnoreCase) == 0)
            {
                queueIdentity.queueType = QueueType.Submission;
            }
            else if (!queuePartAlwaysAsDomain && string.Compare(text2, QueueIdentity.UnreachableIdentityString, StringComparison.OrdinalIgnoreCase) == 0)
            {
                queueIdentity.queueType = QueueType.Unreachable;
            }
            else
            {
                if (!text2.StartsWith("*", StringComparison.OrdinalIgnoreCase) && !text2.EndsWith("*", StringComparison.OrdinalIgnoreCase))
                {
                    queueIdentity.queueType = (flag ? QueueType.Shadow : QueueType.Delivery);
                }
                queueIdentity.nextHopDomain = text2;
            }
            if (!string.IsNullOrEmpty(text))
            {
                queueIdentity.Server = text;
            }
            return(queueIdentity);
        }
コード例 #19
0
 public static QueueIdentity Parse(string identity, bool implicitShadow)
 {
     return(QueueIdentity.InternalParse(identity, false, implicitShadow));
 }
コード例 #20
0
 public static QueueIdentity Parse(string identity)
 {
     return(QueueIdentity.InternalParse(identity, false, false));
 }
コード例 #21
0
 internal PropertyBagBasedMessageInfo(long identity, QueueIdentity queueIdentity) : base(identity, queueIdentity, new MessageInfoPropertyBag())
 {
 }
コード例 #22
0
ファイル: MessageInfo.cs プロジェクト: YHZX2013/exchange_diff
 internal MessageInfo(long identity, QueueIdentity queueIdentity)
 {
     this.identity = new MessageIdentity(identity, queueIdentity);
 }