internal static bool IsMessageTypeSupported(MapiMessage message, MapiStore store) { RequestJobNamedPropertySet requestJobNamedPropertySet = RequestJobNamedPropertySet.Get(store); PropValue prop = message.GetProp(requestJobNamedPropertySet.PropTags[9]); MRSJobType value = MapiUtils.GetValue <MRSJobType>(prop, MRSJobType.RequestJobE14R3); return(RequestJobXML.IsKnownJobType(value)); }
public MoveJob(PropValue[] properties, Guid requestQueueGuid) { this.JobType = MapiUtils.GetValue <MRSJobType>(properties[9], MRSJobType.Unknown); if (!RequestJobXML.IsKnownJobType(this.JobType)) { MrsTracer.Service.Debug("Skipping unknown jobType {0}", new object[] { (int)this.JobType }); return; } this.RequestGuid = MapiUtils.GetValue <Guid>(properties[26], Guid.Empty); this.ExchangeGuid = MapiUtils.GetValue <Guid>(properties[5], Guid.Empty); this.ArchiveGuid = MapiUtils.GetValue <Guid>(properties[6], Guid.Empty); this.CancelRequest = MapiUtils.GetValue <bool>(properties[4], false); this.MrsServerName = MapiUtils.GetValue <string>(properties[2], null); this.Status = MapiUtils.GetValue <RequestStatus>(properties[0], RequestStatus.None); this.JobState = MapiUtils.GetValue <JobProcessingState>(properties[1], JobProcessingState.NotReady); this.LastUpdateTimeStamp = MapiUtils.GetValue <DateTime>(properties[7], DateTime.MinValue); this.Flags = MapiUtils.GetValue <RequestFlags>(properties[10], RequestFlags.None); this.SourceDatabaseGuid = MapiUtils.GetValue <Guid>(properties[11], Guid.Empty); this.TargetDatabaseGuid = MapiUtils.GetValue <Guid>(properties[12], Guid.Empty); this.SourceArchiveDatabaseGuid = MapiUtils.GetValue <Guid>(properties[15], Guid.Empty); this.TargetArchiveDatabaseGuid = MapiUtils.GetValue <Guid>(properties[16], Guid.Empty); this.Priority = MapiUtils.GetValue <int>(properties[17], -1); this.DoNotPickUntilTimestamp = MapiUtils.GetValue <DateTime>(properties[13], DateTime.MinValue); this.RequestType = MapiUtils.GetValue <MRSRequestType>(properties[14], MRSRequestType.Move); this.MessageID = MapiUtils.GetValue <byte[]>(properties[27], null); this.SourceExchangeGuid = MapiUtils.GetValue <Guid>(properties[18], Guid.Empty); this.TargetExchangeGuid = MapiUtils.GetValue <Guid>(properties[19], Guid.Empty); this.RehomeRequest = MapiUtils.GetValue <bool>(properties[20], false); this.InternalFlags = MapiUtils.GetValue <RequestJobInternalFlags>(properties[21], RequestJobInternalFlags.None); this.PoisonCount = MapiUtils.GetValue <int>(properties[23], 0); this.FailureType = MapiUtils.GetValue <string>(properties[24], null); this.WorkloadType = MapiUtils.GetValue <RequestWorkloadType>(properties[25], RequestWorkloadType.None); byte[] value = MapiUtils.GetValue <byte[]>(properties[22], null); this.PartitionHint = ((value != null && value.Length > 0) ? TenantPartitionHint.FromPersistablePartitionHint(value) : null); this.RequestQueueGuid = requestQueueGuid; this.IsActiveOnThisMRSInstance = MRSService.JobIsActive(this.RequestGuid); this.isInteractive = MoveJob.IsInteractive(this.RequestType, this.WorkloadType); }
public LocalizedString ComputePositionInQueue(Guid requestGuid) { int crows = 1000; int num = 0; int num2 = 0; if (requestGuid.Equals(Guid.Empty)) { return(MrsStrings.ErrorEmptyMailboxGuid); } using (MapiFolder requestJobsFolder = RequestJobXML.GetRequestJobsFolder(this.SystemMailbox)) { using (MapiTable contentsTable = requestJobsFolder.GetContentsTable(ContentsTableFlags.DeferredErrors)) { RequestJobNamedPropertySet requestJobNamedPropertySet = RequestJobNamedPropertySet.Get(this.SystemMailbox); contentsTable.SetColumns(requestJobNamedPropertySet.PropTags); SortOrder sortOrder = new SortOrder(requestJobNamedPropertySet.PropTags[7], SortFlags.Ascend); contentsTable.SortTable(sortOrder, SortTableFlags.None); Restriction restriction = Restriction.EQ(requestJobNamedPropertySet.PropTags[0], RequestStatus.Queued); contentsTable.Restrict(restriction); contentsTable.SeekRow(BookMark.Beginning, 0); PropValue[][] array = contentsTable.QueryRows(crows); bool flag = false; while (array != null && array.Length > 0) { int num3 = 0; if (!flag) { foreach (PropValue[] array3 in array) { num3++; if (num2 + num3 >= 10000) { break; } Guid value = MapiUtils.GetValue <Guid>(array3[26], Guid.Empty); if (requestGuid.Equals(value)) { flag = true; num = num2 + num3; break; } } } num2 += array.Length; if (num2 >= 10000) { break; } array = contentsTable.QueryRows(crows); } } } LocalizedString value2 = LocalizedString.Empty; LocalizedString value3 = LocalizedString.Empty; if (num == 0) { if (num2 < 10000) { value2 = MrsStrings.MoveRequestNotFoundInQueue; value3 = MrsStrings.PositionInteger(num2); } else { value2 = MrsStrings.PositionIntegerPlus(10000); value3 = MrsStrings.PositionIntegerPlus(10000); } } else { value2 = MrsStrings.PositionInteger(num); if (num2 < 10000) { value3 = MrsStrings.PositionInteger(num2); } else { value3 = MrsStrings.PositionIntegerPlus(num2); } } return(MrsStrings.PositionOfMoveRequestInSystemMailboxQueue(value2, value3)); }