예제 #1
0
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter(new object[]
     {
         this.DataObject
     });
     try
     {
         TransactionalRequestJob dataObject = this.DataObject;
         if (!base.Stopping)
         {
             ReportData reportData = new ReportData(dataObject.RequestGuid, dataObject.ReportVersion);
             reportData.Delete(this.RJProvider.SystemMailbox);
             reportData.Append(this.GeneralReportEntries);
             reportData.Append(this.PerRecordReportEntries);
             reportData.Flush(this.RJProvider.SystemMailbox);
             base.InternalProcessRecord();
             RequestJobLog.Write(dataObject);
             if (this.MRSClient != null)
             {
                 if (this.MRSClient.ServerVersion[3])
                 {
                     this.MRSClient.RefreshMoveRequest2(dataObject.RequestGuid, this.MdbId.ObjectGuid, (int)dataObject.Flags, MoveRequestNotification.Created);
                 }
                 else
                 {
                     this.MRSClient.RefreshMoveRequest(dataObject.RequestGuid, this.MdbId.ObjectGuid, MoveRequestNotification.Created);
                 }
             }
             dataObject.CreateAsyncNotification((base.ExchangeRunspaceConfig != null) ? base.ExchangeRunspaceConfig.ExecutingUserAsRecipient : null, this.ExtendedAttributes);
         }
     }
     finally
     {
         TaskLogger.LogExit();
     }
 }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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();
            }
        }