Пример #1
0
        public int GetQueueLength()
        {
            MrsTracer.Common.Function("RequestJobProvider.GetQueueLength", new object[0]);
            RequestJobNamedPropertySet requestJobNamedPropertySet = RequestJobNamedPropertySet.Get(this.SystemMailbox);
            Restriction restriction  = Restriction.EQ(requestJobNamedPropertySet.PropTags[4], true);
            Restriction restriction2 = Restriction.BitMaskNonZero(requestJobNamedPropertySet.PropTags[10], 256);
            Restriction restriction3 = Restriction.EQ(requestJobNamedPropertySet.PropTags[0], RequestStatus.Completed);
            Restriction restriction4 = Restriction.EQ(requestJobNamedPropertySet.PropTags[0], RequestStatus.CompletedWithWarning);
            Restriction restriction5 = Restriction.Or(new Restriction[]
            {
                restriction,
                restriction2,
                restriction3,
                restriction4
            });
            Restriction restriction6 = Restriction.Not(restriction5);
            int         result;

            using (MapiFolder requestJobsFolder = RequestJobXML.GetRequestJobsFolder(this.SystemMailbox))
            {
                using (MapiTable contentsTable = requestJobsFolder.GetContentsTable(ContentsTableFlags.DeferredErrors))
                {
                    contentsTable.Restrict(restriction6);
                    int rowCount = contentsTable.GetRowCount();
                    MrsTracer.Common.Debug("Queue length is {0}", new object[]
                    {
                        rowCount
                    });
                    result = rowCount;
                }
            }
            return(result);
        }
        protected override void ProcessJobs(MapiStore systemMbx, MapiTable contentsTable, RequestJobNamedPropertySet nps)
        {
            SortOrder sortOrder = new SortOrder(nps.PropTags[17], SortFlags.Descend);

            sortOrder.Add(nps.PropTags[7], SortFlags.Ascend);
            MrsTracer.Service.Debug("Searching for MRs to Rehome...", new object[0]);
            Restriction restriction = Restriction.And(new Restriction[]
            {
                Restriction.EQ(nps.PropTags[4], false),
                Restriction.EQ(nps.PropTags[20], true)
            });

            MrsTracer.Service.Debug("Searching for MRs to Suspend...", new object[0]);
            base.ProcessJobsInBatches(restriction, false, sortOrder, contentsTable, systemMbx, null);
            Restriction restriction2 = Restriction.And(new Restriction[]
            {
                Restriction.BitMaskNonZero(nps.PropTags[10], 256),
                Restriction.EQ(nps.PropTags[4], false),
                Restriction.EQ(nps.PropTags[20], false),
                Restriction.NE(nps.PropTags[0], RequestStatus.Failed),
                Restriction.NE(nps.PropTags[0], RequestStatus.Suspended),
                Restriction.NE(nps.PropTags[0], RequestStatus.AutoSuspended),
                Restriction.NE(nps.PropTags[0], RequestStatus.Completed),
                Restriction.NE(nps.PropTags[0], RequestStatus.CompletedWithWarning)
            });

            base.ProcessJobsInBatches(restriction2, false, sortOrder, contentsTable, systemMbx, null);
            MrsTracer.Service.Debug("Searching for MRs to Resume...", new object[0]);
            Restriction restriction3 = Restriction.And(new Restriction[]
            {
                Restriction.BitMaskZero(nps.PropTags[10], 256),
                Restriction.EQ(nps.PropTags[4], false),
                Restriction.EQ(nps.PropTags[20], false),
                Restriction.Or(new Restriction[]
                {
                    Restriction.EQ(nps.PropTags[0], RequestStatus.Failed),
                    Restriction.EQ(nps.PropTags[0], RequestStatus.Suspended),
                    Restriction.EQ(nps.PropTags[0], RequestStatus.AutoSuspended)
                })
            });

            base.ProcessJobsInBatches(restriction3, false, sortOrder, contentsTable, systemMbx, null);
            SortOrder sort   = new SortOrder(nps.PropTags[13], SortFlags.Ascend);
            DateTime  utcNow = DateTime.UtcNow;

            MrsTracer.Service.Debug("Searching for Completed MRs to clean up...", new object[0]);
            Restriction restriction4 = Restriction.And(new Restriction[]
            {
                Restriction.EQ(nps.PropTags[20], false),
                Restriction.EQ(nps.PropTags[4], false),
                Restriction.EQ(nps.PropTags[0], RequestStatus.Completed),
                Restriction.NE(nps.PropTags[13], SystemMailboxLightJobs.defaultDoNotPickUntil)
            });

            base.ProcessJobsInBatches(restriction4, false, sort, contentsTable, systemMbx, (MoveJob moveJob) => moveJob.DoNotPickUntilTimestamp > utcNow);
        }
        internal static Restriction BuildIsReadRestriction(SinglePropertyFilter filter, IFilterBuilderHelper mapper)
        {
            ContentFilterSchema.ContentFilterPropertyDefinition contentFilterPropertyDefinition = (ContentFilterSchema.ContentFilterPropertyDefinition)filter.Property;
            PropTag propTagToSearch = contentFilterPropertyDefinition.PropTagToSearch;
            bool    flag;

            ContentFilterBuilder.CheckFilterIsEQorNE(filter, out flag);
            bool flag2 = (bool)ContentFilterBuilder.GetPropertyValue(filter);

            if (flag)
            {
                flag2 = !flag2;
            }
            if (!flag2)
            {
                return(Restriction.BitMaskZero(propTagToSearch, 1));
            }
            return(Restriction.BitMaskNonZero(propTagToSearch, 1));
        }
Пример #4
0
 private Restriction BuildRestriction()
 {
     if (this.IsFieldSet("MailboxGuid") && this.IsFieldSet("EventNames"))
     {
         return(Restriction.And(new Restriction[]
         {
             Restriction.EQ(PropTag.EventMailboxGuid, this.MailboxGuid.ToByteArray()),
             Restriction.BitMaskNonZero(PropTag.EventMask, (int)this.EventNames)
         }));
     }
     if (this.IsFieldSet("MailboxGuid"))
     {
         return(Restriction.EQ(PropTag.EventMailboxGuid, this.MailboxGuid.ToByteArray()));
     }
     if (this.IsFieldSet("EventNames"))
     {
         return(Restriction.BitMaskNonZero(PropTag.EventMask, (int)this.EventNames));
     }
     return(null);
 }
Пример #5
0
        // Token: 0x060001E0 RID: 480 RVA: 0x00009D48 File Offset: 0x00007F48
        public EventController(DatabaseInfo databaseInfo, EventBasedAssistantCollection assistants, PoisonEventControl poisonControl, PerformanceCountersPerDatabaseInstance databaseCounters, ThrottleGovernor serverGovernor, MapiEventTypeFlags moreEvents)
        {
            this.databaseInfo     = databaseInfo;
            this.databaseCounters = databaseCounters;
            this.assistants       = assistants;
            this.shutdownState    = 0;
            this.poisonControl    = poisonControl;
            MapiEventTypeFlags mapiEventTypeFlags = this.assistants.EventMask | moreEvents;

            this.filter      = (((MapiEventTypeFlags)(-1) == mapiEventTypeFlags) ? null : Restriction.BitMaskNonZero(PropTag.EventMask, (int)mapiEventTypeFlags));
            this.governor    = new DatabaseGovernor("event processing on '" + databaseInfo.DisplayName + "'", serverGovernor, new Throttle("EventDatabase", serverGovernor.Throttle.OpenThrottleValue, serverGovernor.Throttle));
            this.eventAccess = EventAccess.Create(this.DatabaseInfo, this.assistants);
        }
Пример #6
0
        internal Restriction ReadRestriction()
        {
            OutlookBlobWriter.RestrictionType restrictionType = (OutlookBlobWriter.RestrictionType) this.ReadInt();
            switch (restrictionType)
            {
            case OutlookBlobWriter.RestrictionType.And:
            case OutlookBlobWriter.RestrictionType.Or:
            {
                int           num   = this.ReadInt();
                Restriction[] array = new Restriction[num];
                for (int i = 0; i < num; i++)
                {
                    array[i] = this.ReadRestriction();
                }
                if (restrictionType == OutlookBlobWriter.RestrictionType.And)
                {
                    return(Restriction.And(array));
                }
                return(Restriction.Or(array));
            }

            case OutlookBlobWriter.RestrictionType.Not:
                return(Restriction.Not(this.ReadRestriction()));

            case OutlookBlobWriter.RestrictionType.Content:
            {
                ContentFlags flags = (ContentFlags)this.ReadInt();
                PropTag      tag   = (PropTag)this.ReadInt();
                return(Restriction.Content(tag, this.ReadPropValue().Value, flags));
            }

            case OutlookBlobWriter.RestrictionType.Property:
            {
                Restriction.RelOp relOp = (Restriction.RelOp) this.ReadInt();
                PropTag           tag2  = (PropTag)this.ReadInt();
                return(new Restriction.PropertyRestriction(relOp, tag2, this.ReadPropValue().Value));
            }

            case OutlookBlobWriter.RestrictionType.PropertyComparison:
            {
                Restriction.RelOp relOp2   = (Restriction.RelOp) this.ReadInt();
                PropTag           tagLeft  = (PropTag)this.ReadInt();
                PropTag           tagRight = (PropTag)this.ReadInt();
                return(new Restriction.ComparePropertyRestriction(relOp2, tagLeft, tagRight));
            }

            case OutlookBlobWriter.RestrictionType.Bitmask:
                if (this.ReadInt() == 0)
                {
                    return(Restriction.BitMaskZero((PropTag)this.ReadInt(), this.ReadInt()));
                }
                return(Restriction.BitMaskNonZero((PropTag)this.ReadInt(), this.ReadInt()));

            case OutlookBlobWriter.RestrictionType.Size:
            {
                Restriction.RelOp relop = (Restriction.RelOp) this.ReadInt();
                PropTag           tag3  = (PropTag)this.ReadInt();
                int size = this.ReadInt();
                return(new Restriction.SizeRestriction(relop, tag3, size));
            }

            case OutlookBlobWriter.RestrictionType.Exist:
            {
                PropTag tag4 = (PropTag)this.ReadInt();
                return(Restriction.Exist(tag4));
            }

            case OutlookBlobWriter.RestrictionType.Subfilter:
            {
                PropTag propTag = (PropTag)this.ReadInt();
                if (propTag == PropTag.MessageAttachments || propTag == PropTag.MessageRecipients)
                {
                    return(Restriction.Sub(propTag, this.ReadRestriction()));
                }
                throw new CorruptDataException(ServerStrings.ExUnknownRestrictionType);
            }

            default:
                throw new CorruptDataException(ServerStrings.ExUnknownRestrictionType);
            }
        }
Пример #7
0
 protected static Restriction CreateHasAttachmentRestriction()
 {
     return(Restriction.BitMaskNonZero(PropTag.MessageFlags, 16));
 }