protected override void InternalProcessRecord() { TaskLogger.LogEnter(new object[] { this.DataObject }); try { base.WriteVerbose(Strings.SettingRequest); TransactionalRequestJob dataObject = this.DataObject; int num = 1; for (;;) { if (dataObject.CheckIfUnderlyingMessageHasChanged()) { base.WriteVerbose(Strings.ReloadingRequest); dataObject.Refresh(); this.ValidateRequest(dataObject); } this.ModifyRequest(dataObject); try { base.InternalProcessRecord(); RequestJobLog.Write(dataObject); } catch (MapiExceptionObjectChanged) { if (num >= 5 || base.Stopping) { throw; } num++; continue; } break; } CommonUtils.CatchKnownExceptions(delegate { this.PostSaveAction(); }, delegate(Exception ex) { this.WriteWarning(MrsStrings.PostSaveActionFailed(CommonUtils.FullExceptionMessage(ex))); }); } finally { TaskLogger.LogExit(); } }
protected override void InternalProcessRecord() { TaskLogger.LogEnter(new object[] { this.DataObject }); try { TransactionalRequestJob moveRequest = this.DataObject; switch (this.mrCondition) { case RemoveMoveRequest.MoveRequestCondition.None: if (base.ParameterSetName.Equals("MigrationMoveRequestQueue")) { if (moveRequest != null) { if (moveRequest.CheckIfUnderlyingMessageHasChanged()) { base.WriteVerbose(Strings.ReloadingMoveRequest); moveRequest.Refresh(); this.ValidateMoveRequest(moveRequest); } base.MRProvider.Delete(moveRequest); CommonUtils.CatchKnownExceptions(delegate { ReportData reportData = new ReportData(moveRequest.ExchangeGuid, moveRequest.ReportVersion); reportData.Delete(this.MRProvider.SystemMailbox); }, null); } else { base.WriteError(new ManagementObjectNotFoundException(Strings.CouldNotRemoveMoveRequest(this.MailboxGuid.ToString())), ErrorCategory.InvalidArgument, base.Identity); } } else { base.InternalProcessRecord(); this.CleanupADEntry(base.LocalADUser.Id, base.LocalADUser); } break; case RemoveMoveRequest.MoveRequestCondition.FailedValidation: base.WriteVerbose(Strings.MoveFailedValidation(this.validationMessageString)); this.CleanupADEntry(base.LocalADUser.Id, base.LocalADUser); break; case RemoveMoveRequest.MoveRequestCondition.MdbDown: base.WriteVerbose(Strings.MailboxDatabaseIsDown); this.CleanupADEntry(base.LocalADUser.Id, base.LocalADUser); break; case RemoveMoveRequest.MoveRequestCondition.AdUserMissingMoveData: base.WriteVerbose(Strings.ADUserIsMissingData); this.CleanupADEntry(this.brokenADUser.Id, this.brokenADUser); break; case RemoveMoveRequest.MoveRequestCondition.MissingMR: base.WriteVerbose(Strings.MoveRequestIsMissing); this.CleanupADEntry(base.LocalADUser.Id, base.LocalADUser); break; case RemoveMoveRequest.MoveRequestCondition.MoveCompleted: if (moveRequest != null && !moveRequest.IsFake) { if (moveRequest.CheckIfUnderlyingMessageHasChanged()) { base.WriteVerbose(Strings.ReloadingMoveRequest); moveRequest.Refresh(); this.ValidateMoveRequest(moveRequest); } base.MRProvider.Delete(moveRequest); CommonUtils.CatchKnownExceptions(delegate { ReportData reportData = new ReportData(moveRequest.ExchangeGuid, moveRequest.ReportVersion); reportData.Delete(this.MRProvider.SystemMailbox); }, null); this.CleanupADEntry(base.LocalADUser.Id, base.LocalADUser); } else { base.WriteError(new ManagementObjectNotFoundException(Strings.CouldNotRemoveCompletedMoveRequest(base.LocalADUser.ToString())), ErrorCategory.InvalidArgument, base.Identity); } break; } } finally { TaskLogger.LogExit(); } }
protected override void InternalProcessRecord() { TaskLogger.LogEnter(new object[] { this.DataObject }); try { TransactionalRequestJob requestJob = this.DataObject; switch (this.requestCondition) { case RemoveRequest <TIdentity> .RequestCondition.None: if (base.ParameterSetName.Equals("MigrationRequestQueue")) { if (requestJob != null) { if (requestJob.CheckIfUnderlyingMessageHasChanged()) { base.WriteVerbose(Strings.ReloadingRequest); requestJob.Refresh(); this.ValidateRequest(requestJob); } base.RJProvider.Delete(requestJob); CommonUtils.CatchKnownExceptions(delegate { ReportData reportData = new ReportData(requestJob.RequestGuid, requestJob.ReportVersion); reportData.Delete(this.RJProvider.SystemMailbox); }, null); } else { base.WriteError(new ManagementObjectNotFoundException(Strings.CouldNotRemoveRequest(this.RequestGuid.ToString())), ErrorCategory.InvalidArgument, this.Identity); } } else { base.InternalProcessRecord(); this.CleanupIndexEntries(); } break; case RemoveRequest <TIdentity> .RequestCondition.FailedValidation: base.WriteVerbose(Strings.RequestFailedValidation(this.validationMessageString)); this.CleanupIndexEntries(); break; case RemoveRequest <TIdentity> .RequestCondition.IndexEntryMissingData: base.WriteVerbose(Strings.IndexEntryIsMissingData); this.CleanupIndexEntries(); break; case RemoveRequest <TIdentity> .RequestCondition.MissingRJ: base.WriteVerbose(Strings.RequestIsMissing); this.CleanupIndexEntries(); break; case RemoveRequest <TIdentity> .RequestCondition.Completed: if (requestJob != null && !requestJob.IsFake) { if (requestJob.CheckIfUnderlyingMessageHasChanged()) { base.WriteVerbose(Strings.ReloadingRequest); requestJob.Refresh(); this.ValidateRequest(requestJob); } base.RJProvider.Delete(requestJob); CommonUtils.CatchKnownExceptions(delegate { ReportData reportData = new ReportData(requestJob.RequestGuid, requestJob.ReportVersion); reportData.Delete(this.RJProvider.SystemMailbox); }, null); this.CleanupIndexEntries(); } else { base.WriteError(new ManagementObjectNotFoundException(Strings.CouldNotRemoveCompletedRequest(base.IndexEntry.ToString())), ErrorCategory.InvalidArgument, this.Identity); } break; case RemoveRequest <TIdentity> .RequestCondition.MdbDown: base.WriteVerbose(Strings.RequestOnInaccessibleDatabase); this.CleanupIndexEntries(); break; } } finally { TaskLogger.LogExit(); } }