internal static RequestStatisticsBase CreateRequestStatistics(Type t, RequestJobXML rj, bool acceptBase) { RequestStatisticsBase requestStatisticsBase = null; if (t.Equals(typeof(MoveRequestStatistics))) { requestStatisticsBase = new MoveRequestStatistics(rj); } else if (t.Equals(typeof(MergeRequestStatistics))) { requestStatisticsBase = new MergeRequestStatistics(rj); } else if (t.Equals(typeof(MailboxImportRequestStatistics))) { requestStatisticsBase = new MailboxImportRequestStatistics(rj); } else if (t.Equals(typeof(MailboxExportRequestStatistics))) { requestStatisticsBase = new MailboxExportRequestStatistics(rj); } else if (t.Equals(typeof(MailboxRelocationRequestStatistics))) { requestStatisticsBase = new MailboxRelocationRequestStatistics(rj); } else if (t.Equals(typeof(MailboxRestoreRequestStatistics))) { requestStatisticsBase = new MailboxRestoreRequestStatistics(rj); } else if (t.Equals(typeof(PublicFolderMoveRequestStatistics))) { requestStatisticsBase = new PublicFolderMoveRequestStatistics(rj); } else if (t.Equals(typeof(PublicFolderMigrationRequestStatistics))) { requestStatisticsBase = new PublicFolderMigrationRequestStatistics(rj); } else if (t.Equals(typeof(PublicFolderMailboxMigrationRequestStatistics))) { requestStatisticsBase = new PublicFolderMailboxMigrationRequestStatistics(rj); } else if (t.Equals(typeof(SyncRequestStatistics))) { requestStatisticsBase = new SyncRequestStatistics(rj); } else if (t.Equals(typeof(FolderMoveRequestStatistics))) { requestStatisticsBase = new FolderMoveRequestStatistics(rj); } else if (acceptBase && t.Equals(typeof(RequestStatisticsBase))) { return(RequestJobProvider.CreateRequestStatistics(rj)); } if (requestStatisticsBase != null) { rj.Retire(); } return(requestStatisticsBase); }
internal static RequestStatisticsBase CreateRequestStatistics(RequestJobXML rj) { RequestStatisticsBase requestStatisticsBase = null; switch (rj.RequestType) { case MRSRequestType.Move: requestStatisticsBase = new MoveRequestStatistics(rj); break; case MRSRequestType.Merge: requestStatisticsBase = new MergeRequestStatistics(rj); break; case MRSRequestType.MailboxImport: requestStatisticsBase = new MailboxImportRequestStatistics(rj); break; case MRSRequestType.MailboxExport: requestStatisticsBase = new MailboxExportRequestStatistics(rj); break; case MRSRequestType.MailboxRestore: requestStatisticsBase = new MailboxRestoreRequestStatistics(rj); break; case MRSRequestType.PublicFolderMove: requestStatisticsBase = new PublicFolderMoveRequestStatistics(rj); break; case MRSRequestType.PublicFolderMigration: requestStatisticsBase = new PublicFolderMigrationRequestStatistics(rj); break; case MRSRequestType.Sync: requestStatisticsBase = new SyncRequestStatistics(rj); break; case MRSRequestType.MailboxRelocation: requestStatisticsBase = new MailboxRelocationRequestStatistics(rj); break; case MRSRequestType.FolderMove: requestStatisticsBase = new FolderMoveRequestStatistics(rj); break; case MRSRequestType.PublicFolderMailboxMigration: requestStatisticsBase = new PublicFolderMailboxMigrationRequestStatistics(rj); break; } if (requestStatisticsBase != null) { rj.Retire(); } return(requestStatisticsBase); }
internal static RequestStatisticsBase CreateRequestStatistics(TransactionalRequestJob rj) { RequestStatisticsBase result = null; switch (rj.RequestType) { case MRSRequestType.Move: result = new MoveRequestStatistics(rj); break; case MRSRequestType.Merge: result = new MergeRequestStatistics(rj); break; case MRSRequestType.MailboxImport: result = new MailboxImportRequestStatistics(rj); break; case MRSRequestType.MailboxExport: result = new MailboxExportRequestStatistics(rj); break; case MRSRequestType.MailboxRestore: result = new MailboxRestoreRequestStatistics(rj); break; case MRSRequestType.PublicFolderMove: result = new PublicFolderMoveRequestStatistics(rj); break; case MRSRequestType.PublicFolderMigration: result = new PublicFolderMigrationRequestStatistics(rj); break; case MRSRequestType.Sync: result = new SyncRequestStatistics(rj); break; case MRSRequestType.MailboxRelocation: result = new MailboxRelocationRequestStatistics(rj); break; case MRSRequestType.FolderMove: result = new FolderMoveRequestStatistics(rj); break; case MRSRequestType.PublicFolderMailboxMigration: result = new PublicFolderMailboxMigrationRequestStatistics(rj); break; } return(result); }
internal static void ValidateRequestJob(RequestJobBase requestJob) { if (requestJob.IsFake || requestJob.WorkItemQueueMdb == null) { requestJob.ValidationResult = new RequestJobBase.ValidationResultEnum?(RequestJobBase.ValidationResultEnum.DataMissing); requestJob.ValidationMessage = MrsStrings.ValidationMoveRequestNotDeserialized; return; } if (requestJob.OriginatingMDBGuid != Guid.Empty && requestJob.OriginatingMDBGuid != requestJob.WorkItemQueueMdb.ObjectGuid) { requestJob.ValidationResult = new RequestJobBase.ValidationResultEnum?(RequestJobBase.ValidationResultEnum.Orphaned); requestJob.ValidationMessage = MrsStrings.ValidationMoveRequestInWrongMDB(requestJob.OriginatingMDBGuid, requestJob.WorkItemQueueMdb.ObjectGuid); return; } if (requestJob.CancelRequest) { requestJob.ValidationResult = new RequestJobBase.ValidationResultEnum?(RequestJobBase.ValidationResultEnum.Valid); requestJob.ValidationMessage = LocalizedString.Empty; return; } if (requestJob.Status == RequestStatus.Completed || requestJob.Status == RequestStatus.CompletedWithWarning) { MailboxImportRequestStatistics.LoadAdditionalPropertiesFromUser(requestJob); requestJob.ValidationResult = new RequestJobBase.ValidationResultEnum?(RequestJobBase.ValidationResultEnum.Valid); requestJob.ValidationMessage = LocalizedString.Empty; return; } if (!requestJob.ValidateUser(requestJob.TargetUser, requestJob.TargetUserId)) { return; } if (!requestJob.ValidateMailbox(requestJob.TargetUser, requestJob.TargetIsArchive)) { return; } MailboxImportRequestStatistics.LoadAdditionalPropertiesFromUser(requestJob); if (!requestJob.ValidateRequestIndexEntries()) { return; } requestJob.ValidationResult = new RequestJobBase.ValidationResultEnum?(RequestJobBase.ValidationResultEnum.Valid); requestJob.ValidationMessage = LocalizedString.Empty; }
public MailboxImportRequestIdParameter(MailboxImportRequestStatistics requestStats) : base(requestStats) { }