internal void Run(MeetingComparisonResult comparisonResult, ref Dictionary <GlobalObjectId, List <Attendee> > organizerRumsSent) { if (!this.SkipItem(ref organizerRumsSent)) { PrimaryConsistencyCheckChain primaryConsistencyCheckChain = ConsistencyCheckFactory.Instance.CreatePrimaryConsistencyCheckChain(this.context, comparisonResult); primaryConsistencyCheckChain.PerformChecks(this.context); if (primaryConsistencyCheckChain.ShouldTerminate) { if (RumFactory.Instance.Policy.RepairMode == CalendarRepairType.ValidateOnly && this.context.BaseItem.CalendarItemType == CalendarItemType.RecurringMaster) { RecurrenceBlobsConsistentCheck recurrenceBlobsConsistentCheck = new RecurrenceBlobsConsistentCheck(this.context); ConsistencyCheckResult consistencyCheckResult = recurrenceBlobsConsistentCheck.Run(); if (consistencyCheckResult.ShouldBeReported) { comparisonResult.AddCheckResult(consistencyCheckResult); } } } else { ConsistencyCheckChain <ConsistencyCheckResult> consistencyCheckChain = ConsistencyCheckFactory.Instance.CreateGeneralConsistencyCheckChain(this.context, comparisonResult, RumFactory.Instance.Policy.RepairMode == CalendarRepairType.ValidateOnly); consistencyCheckChain.PerformChecks(); } if (RumFactory.Instance.Policy.RepairMode == CalendarRepairType.RepairAndValidate && comparisonResult.RepairInfo.SendRums(this.context.BaseItem, ref organizerRumsSent)) { this.NumberOfSuccessfulRepairAttempts += 1L; } } }
internal void Validate(Dictionary <GlobalObjectId, List <Attendee> > organizerRumsSent, List <GlobalObjectId> inquiredMasterGoids, Action <long> onItemRepaired) { MeetingComparisonResult resultPerAttendee = CalendarInstanceContext.GetResultPerAttendee(this.ValidationResult, this.ValidationContext.Attendee); MeetingComparer meetingComparer = new MeetingComparer(this.ValidationContext); meetingComparer.Run(resultPerAttendee, ref organizerRumsSent); if (resultPerAttendee.InquiredMeeting && this.ValidationContext.BaseItem.CalendarItemType == CalendarItemType.RecurringMaster) { inquiredMasterGoids.Add(this.ValidationContext.BaseItem.GlobalObjectId); } if (onItemRepaired != null) { onItemRepaired(meetingComparer.NumberOfSuccessfulRepairAttempts); } foreach (ConsistencyCheckResult consistencyCheckResult in resultPerAttendee) { if (consistencyCheckResult.Status != CheckStatusType.Passed) { this.ValidationResult.IsConsistent = false; break; } } this.IsValidationDone = true; this.ValidationResult.WasValidationSuccessful = true; }
private static MeetingComparisonResult GetResultPerAttendee(MeetingValidationResult validationResult, UserObject user) { MeetingComparisonResult meetingComparisonResult = null; string key = user.EmailAddress.ToLower(); if (!validationResult.ResultsPerAttendee.TryGetValue(key, out meetingComparisonResult)) { meetingComparisonResult = MeetingComparisonResult.CreateInstance(user, validationResult.MeetingData); validationResult.ResultsPerAttendee.Add(key, meetingComparisonResult); } return(meetingComparisonResult); }
internal virtual bool PreProcess(MeetingComparisonResult totalResults) { if (this.dependsOnCheckPassList != null) { foreach (ConsistencyCheckType check in this.dependsOnCheckPassList) { CheckStatusType?checkStatusType = totalResults[check]; if (checkStatusType == null || checkStatusType.Value != CheckStatusType.Passed) { return(false); } } return(true); } return(true); }
internal PrimaryConsistencyCheckChain(int capacity, MeetingComparisonResult totalResult) : base(capacity, totalResult) { this.ShouldTerminate = false; }
internal ConsistencyCheckChain <ConsistencyCheckResult> CreateGeneralConsistencyCheckChain(CalendarValidationContext context, MeetingComparisonResult comparisonResult, bool validationOnly) { ConsistencyCheckChain <ConsistencyCheckResult> consistencyCheckChain = null; if (validationOnly || context.BaseItem.CalendarItemType != CalendarItemType.Occurrence || context.OppositeItem.CalendarItemType != CalendarItemType.Occurrence) { if (context.BaseItem.IsCancelled) { if (context.BaseRole == RoleType.Attendee) { if (validationOnly) { consistencyCheckChain = new ConsistencyCheckChain <ConsistencyCheckResult>(2, comparisonResult); consistencyCheckChain.AddCheck(new AttendeeOnListCheck(context)); consistencyCheckChain.AddCheck(new MeetingCancellationCheck(context)); } else { consistencyCheckChain = new ConsistencyCheckChain <ConsistencyCheckResult>(0, comparisonResult); } } else { consistencyCheckChain = new ConsistencyCheckChain <ConsistencyCheckResult>(1, comparisonResult); consistencyCheckChain.AddCheck(new MeetingCancellationCheck(context)); } } else { consistencyCheckChain = new ConsistencyCheckChain <ConsistencyCheckResult>(comparisonResult); if (context.BaseRole == RoleType.Organizer) { consistencyCheckChain.AddCheck(new MeetingCancellationCheck(context)); } if (context.BaseRole == RoleType.Attendee) { consistencyCheckChain.AddCheck(new AttendeeOnListCheck(context)); if (context.BaseItem.GetValueOrDefault <bool>(ItemSchema.IsResponseRequested, true)) { consistencyCheckChain.AddCheck(new CorrectResponseCheck(context)); } } if (validationOnly || context.BaseRole == RoleType.Organizer) { consistencyCheckChain.AddCheck(new TimeZoneConsistentCheck(context)); consistencyCheckChain.AddCheck(new MeetingPropertiesMatchCheck(context)); if (context.BaseItem.CalendarItemType == CalendarItemType.RecurringMaster) { consistencyCheckChain.AddCheck(new RecurrenceBlobsConsistentCheck(context)); consistencyCheckChain.AddCheck(new RecurrencesMatchCheck(context)); } else if (context.OppositeItem.CalendarItemType == CalendarItemType.RecurringMaster) { consistencyCheckChain.AddCheck(new RecurrenceBlobsConsistentCheck(context)); } } } } if (consistencyCheckChain == null) { consistencyCheckChain = new ConsistencyCheckChain <ConsistencyCheckResult>(0, comparisonResult); } return(consistencyCheckChain); }
internal PrimaryConsistencyCheckChain CreatePrimaryConsistencyCheckChain(CalendarValidationContext context, MeetingComparisonResult comparisonResult) { PrimaryConsistencyCheckChain primaryConsistencyCheckChain = new PrimaryConsistencyCheckChain(2, comparisonResult); primaryConsistencyCheckChain.AddCheck(new CanValidateOwnerCheck(context)); primaryConsistencyCheckChain.AddCheck(new ValidateStoreObjectCheck(context)); return(primaryConsistencyCheckChain); }
internal ConsistencyCheckChain(int capacity, MeetingComparisonResult totalResult) { this.checkList = new List <ConsistencyCheckBase <ResultType> >(capacity); this.totalResult = totalResult; }
internal ConsistencyCheckChain(MeetingComparisonResult totalResult) : this(1, totalResult) { }