public override void Initialize(TransactionalRequestJob mergeRequest) { base.Initialize(mergeRequest); if (mergeRequest.RequestType == MRSRequestType.MailboxImport || mergeRequest.RequestType == MRSRequestType.MailboxExport || mergeRequest.RequestType == MRSRequestType.MailboxRestore || mergeRequest.RequestType == MRSRequestType.Sync) { return; } base.RequestJobIdentity = mergeRequest.Identity.ToString(); bool flag = mergeRequest.RequestStyle == RequestStyle.CrossOrg && mergeRequest.Direction == RequestDirection.Pull; bool flag2 = mergeRequest.RequestStyle == RequestStyle.CrossOrg && mergeRequest.Direction == RequestDirection.Push; LocalizedString sourceTracingID = LocalizedString.Empty; LocalizedString targetTracingID = LocalizedString.Empty; string orgID = (mergeRequest.OrganizationId != null && mergeRequest.OrganizationId.OrganizationalUnit != null) ? (mergeRequest.OrganizationId.OrganizationalUnit.Name + "\\") : string.Empty; Guid guid; if (flag) { guid = Guid.Empty; sourceTracingID = MrsStrings.RPCHTTPMailboxId(mergeRequest.RemoteMailboxLegacyDN); } else { guid = mergeRequest.SourceExchangeGuid; sourceTracingID = (mergeRequest.SourceIsArchive ? MrsStrings.ArchiveMailboxTracingId(orgID, guid) : MrsStrings.PrimaryMailboxTracingId(orgID, guid)); } Guid guid2; if (flag2) { guid2 = Guid.Empty; targetTracingID = MrsStrings.RPCHTTPMailboxId(mergeRequest.RemoteMailboxLegacyDN); } else { guid2 = mergeRequest.TargetExchangeGuid; targetTracingID = (mergeRequest.TargetIsArchive ? MrsStrings.ArchiveMailboxTracingId(orgID, guid2) : MrsStrings.PrimaryMailboxTracingId(orgID, guid2)); } MailboxCopierFlags mailboxCopierFlags = MailboxCopierFlags.Merge; if (mergeRequest.RequestStyle == RequestStyle.CrossOrg) { mailboxCopierFlags |= MailboxCopierFlags.CrossOrg; } if (mergeRequest.SourceIsArchive) { mailboxCopierFlags |= MailboxCopierFlags.SourceIsArchive; } if (mergeRequest.TargetIsArchive) { mailboxCopierFlags |= MailboxCopierFlags.TargetIsArchive; } this.MailboxMerger = new MailboxMerger(guid, guid2, mergeRequest, this, mailboxCopierFlags, sourceTracingID, targetTracingID); }
public override void Initialize(TransactionalRequestJob importRequest) { base.Initialize(importRequest); base.RequestJobIdentity = importRequest.Identity.ToString(); Guid targetExchangeGuid = importRequest.TargetExchangeGuid; string orgID = (importRequest.OrganizationId != null && importRequest.OrganizationId.OrganizationalUnit != null) ? (importRequest.OrganizationId.OrganizationalUnit.Name + "\\") : string.Empty; LocalizedString sourceTracingID = MrsStrings.PstTracingId(importRequest.FilePath); LocalizedString targetTracingID = importRequest.TargetIsArchive ? MrsStrings.ArchiveMailboxTracingId(orgID, targetExchangeGuid) : MrsStrings.PrimaryMailboxTracingId(orgID, targetExchangeGuid); MailboxCopierFlags flags = MailboxCopierFlags.Merge | MailboxCopierFlags.SourceIsPST; base.MailboxMerger = new MailboxMerger(Guid.Empty, targetExchangeGuid, importRequest, this, flags, sourceTracingID, targetTracingID); }
public override void Initialize(TransactionalRequestJob restoreRequest) { base.Initialize(restoreRequest); base.RequestJobIdentity = restoreRequest.Identity.ToString(); Guid targetExchangeGuid = restoreRequest.TargetExchangeGuid; Guid sourceExchangeGuid = restoreRequest.SourceExchangeGuid; string orgID = (restoreRequest.OrganizationId != null && restoreRequest.OrganizationId.OrganizationalUnit != null) ? (restoreRequest.OrganizationId.OrganizationalUnit.Name + "\\") : string.Empty; string dbName = (restoreRequest.SourceDatabase != null) ? restoreRequest.SourceDatabase.Name : ((restoreRequest.RemoteDatabaseGuid != null) ? restoreRequest.RemoteDatabaseGuid.Value.ToString() : string.Empty); LocalizedString sourceTracingID = MrsStrings.RestoreMailboxTracingId(dbName, restoreRequest.SourceExchangeGuid); LocalizedString targetTracingID = restoreRequest.TargetIsArchive ? MrsStrings.ArchiveMailboxTracingId(orgID, targetExchangeGuid) : MrsStrings.PrimaryMailboxTracingId(orgID, targetExchangeGuid); MailboxCopierFlags flags = MailboxCopierFlags.Merge; base.MailboxMerger = new MailboxMerger(sourceExchangeGuid, targetExchangeGuid, restoreRequest, this, flags, sourceTracingID, targetTracingID); }