Exemple #1
0
        public override void ConfigureProviders()
        {
            RequestStatisticsBase cachedRequestJob      = base.MRSJob.CachedRequestJob;
            PublicFolderRecipient localMailboxRecipient = this.publicFolderConfiguration.GetLocalMailboxRecipient(base.TargetMailboxGuid);

            if (localMailboxRecipient == null)
            {
                throw new RecipientNotFoundPermanentException(base.TargetMailboxGuid);
            }
            List <MRSProxyCapabilities> list = new List <MRSProxyCapabilities>();
            ProxyServerSettings         proxyServerSettings = CommonUtils.MapDatabaseToProxyServer(localMailboxRecipient.Database.ObjectGuid);

            list.Add(MRSProxyCapabilities.PublicFolderMigration);
            IDestinationMailbox destinationMailbox = this.GetDestinationMailbox(localMailboxRecipient.Database.ObjectGuid, proxyServerSettings.ExtraFlags | LocalMailboxFlags.Move, list);

            destinationMailbox.Config(base.MRSJob.GetReservation(localMailboxRecipient.Database.ObjectGuid, ReservationFlags.Write), base.TargetMailboxGuid, base.TargetMailboxGuid, CommonUtils.GetPartitionHint(cachedRequestJob.OrganizationId), localMailboxRecipient.Database.ObjectGuid, MailboxType.DestMailboxIntraOrg, null);
            base.ConfigDestinationMailbox(destinationMailbox);
            ADSessionSettings sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(this.publicFolderConfiguration.OrganizationId);

            this.orgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(false, ConsistencyMode.PartiallyConsistent, sessionSettings, 170, "ConfigureProviders", "f:\\15.00.1497\\sources\\dev\\mrs\\src\\Service\\PublicFolderMailboxMigrator.cs");
            if (!CommonUtils.IsMultiTenantEnabled() && !base.Flags.HasFlag(MailboxCopierFlags.CrossOrg))
            {
                this.orgRecipientSession.EnforceDefaultScope = false;
                this.orgRecipientSession.UseGlobalCatalog    = true;
            }
            ArgumentValidator.ThrowIfNull("orgRecipientSession", this.orgRecipientSession);
        }
Exemple #2
0
        protected override StorageFxProxyPool.FolderEntry CreateFolder(FolderRec folderRec)
        {
            IDestinationMailbox destinationMailbox = this.destMailbox;

            byte[] folderID;
            destinationMailbox.CreateFolder(folderRec, CreateFolderFlags.None, out folderID);
            return(this.OpenFolder(folderID));
        }
 public DestinationMailboxWrapper(IDestinationMailbox mailbox, MailboxWrapperFlags flags, LocalizedString tracingId, params Guid[] syncStateKeyPrefixGuids) : base(mailbox, flags, tracingId)
 {
     Guid[] array = new Guid[syncStateKeyPrefixGuids.Length + 1];
     syncStateKeyPrefixGuids.CopyTo(array, 0);
     array[syncStateKeyPrefixGuids.Length] = DestinationMailboxWrapper.SyncStateKeySuffix;
     this.syncStateKey = DestinationMailboxWrapper.GetSyncStateKey(array);
     array[syncStateKeyPrefixGuids.Length] = DestinationMailboxWrapper.ICSSyncStateKeySuffix;
     this.icsSyncStateKey = DestinationMailboxWrapper.GetSyncStateKey(array);
     array[syncStateKeyPrefixGuids.Length] = DestinationMailboxWrapper.ReplaySyncStateKeySuffix;
     this.replaySyncStateKey = DestinationMailboxWrapper.GetSyncStateKey(array);
 }
Exemple #4
0
        public void CreateMissingFolders()
        {
            IDestinationMailbox destMailbox = (IDestinationMailbox)this.MbxWrapper.Mailbox;

            base.EnumerateFolderHierarchy(EnumHierarchyFlags.AllFolders, delegate(FolderRecWrapper fRec, FolderMap.EnumFolderContext ctx)
            {
                if (fRec.EntryId != null)
                {
                    return;
                }
                FolderMapping fm      = (FolderMapping)fRec;
                fm.FolderRec.ParentId = fm.ParentId;
                ExecutionContext.Create(new DataContext[]
                {
                    new FolderRecWrapperDataContext(fRec)
                }).Execute(delegate
                {
                    byte[] array;
                    destMailbox.CreateFolder(fRec.FolderRec, CreateFolderFlags.FailIfExists, out array);
                    fm.FolderRec.EntryId = array;
                    this[array]          = fm;
                    if (fm.SourceFolder != null)
                    {
                        List <PropValueData> list = new List <PropValueData>();
                        list.Add(new PropValueData(this.SourceEntryIDPtag, fm.SourceFolder.EntryId));
                        list.Add(new PropValueData(this.SourceLastModifiedTimestampPtag, fm.SourceFolder.FolderRec.LastModifyTimestamp));
                        if (fm.SourceFolder.WKFType != WellKnownFolderType.None)
                        {
                            list.Add(new PropValueData(this.SourceWKFTypePtag, (int)fm.SourceFolder.WKFType));
                        }
                        using (IDestinationFolder folder = destMailbox.GetFolder(array))
                        {
                            if (folder != null)
                            {
                                folder.SetProps(list.ToArray());
                            }
                            else
                            {
                                MrsTracer.Service.Warning("Something just deleted newly created folder from under us. Ignoring.", new object[0]);
                            }
                        }
                        if (fm.SourceFolder.WKFType != WellKnownFolderType.None && this.GetWellKnownFolder(fm.SourceFolder.WKFType) == null)
                        {
                            this.SetWellKnownFolder(fm.SourceFolder.WKFType, fm);
                            if (this.RootFolder == this.RootRec && (this.MbxWrapper.Flags & MailboxWrapperFlags.Archive) == (MailboxWrapperFlags)0 && (this.MbxWrapper.Flags & MailboxWrapperFlags.PST) == (MailboxWrapperFlags)0)
                            {
                                this.WriteWellKnownFolderReference(fm.SourceFolder.WKFType, fm.EntryId);
                            }
                        }
                    }
                });
            });
        }
 protected override void ConfigureProviders(bool continueAfterConfiguringProviders)
 {
     using (DisposeGuard disposeGuard = default(DisposeGuard))
     {
         ISourceMailbox sourceMailbox = this.ConfigureSourceMailbox();
         disposeGuard.Add <ISourceMailbox>(sourceMailbox);
         IDestinationMailbox destinationMailbox = this.ConfigureDestinationMailbox();
         disposeGuard.Add <IDestinationMailbox>(destinationMailbox);
         this.PrimaryHierarchyMbxWrapper = this.ConfigureHierarchyMailbox(sourceMailbox, destinationMailbox);
         string orgID = (base.CachedRequestJob.OrganizationId != null && base.CachedRequestJob.OrganizationId.OrganizationalUnit != null) ? (base.CachedRequestJob.OrganizationId.OrganizationalUnit.Name + "\\") : string.Empty;
         this.SourceMbxWrapper = new SourceMailboxWrapper(sourceMailbox, MailboxWrapperFlags.Source, MrsStrings.AuxFolderMoveTracingId(orgID, base.CachedRequestJob.SourceExchangeGuid));
         this.folderMover.SetMailboxWrappers(this.SourceMbxWrapper, destinationMailbox);
         disposeGuard.Success();
     }
     base.ConfigureProviders(continueAfterConfiguringProviders);
 }
Exemple #6
0
        public override void ConfigureProviders()
        {
            RequestStatisticsBase cachedRequestJob      = base.MRSJob.CachedRequestJob;
            PublicFolderRecipient localMailboxRecipient = this.publicFolderConfiguration.GetLocalMailboxRecipient(base.TargetMailboxGuid);

            if (localMailboxRecipient == null)
            {
                throw new RecipientNotFoundPermanentException(base.TargetMailboxGuid);
            }
            List <MRSProxyCapabilities> list = new List <MRSProxyCapabilities>();
            ProxyServerSettings         proxyServerSettings = CommonUtils.MapDatabaseToProxyServer(localMailboxRecipient.Database.ObjectGuid);

            list.Add(MRSProxyCapabilities.PublicFolderMigration);
            IDestinationMailbox destinationMailbox = this.GetDestinationMailbox(localMailboxRecipient.Database.ObjectGuid, proxyServerSettings.ExtraFlags | LocalMailboxFlags.Move, list);

            destinationMailbox.Config(base.MRSJob.GetReservation(localMailboxRecipient.Database.ObjectGuid, ReservationFlags.Write), base.TargetMailboxGuid, base.TargetMailboxGuid, CommonUtils.GetPartitionHint(cachedRequestJob.OrganizationId), localMailboxRecipient.Database.ObjectGuid, MailboxType.DestMailboxIntraOrg, null);
            base.ConfigDestinationMailbox(destinationMailbox);
        }
Exemple #7
0
        private void WriteWellKnownFolderReferenceToFolder(WellKnownFolderType targetFolderType, WellKnownFolderType wkfType, PropTagFolderMapping ptfm, byte[] folderId)
        {
            FolderMapping wellKnownFolder = this.GetWellKnownFolder(targetFolderType);

            if (wellKnownFolder == null && targetFolderType == WellKnownFolderType.NonIpmSubtree)
            {
                wellKnownFolder = this.GetWellKnownFolder(WellKnownFolderType.Root);
            }
            if (wellKnownFolder == null)
            {
                MrsTracer.Service.Warning("There's no {0} in the target mailbox, not writing WKF reference for {1}", new object[]
                {
                    targetFolderType,
                    wkfType
                });
            }
            IDestinationMailbox destinationMailbox = this.MbxWrapper.Mailbox as IDestinationMailbox;

            using (IDestinationFolder folder = destinationMailbox.GetFolder(wellKnownFolder.EntryId))
            {
                if (folder == null)
                {
                    MrsTracer.Service.Error("{0} disappeared??? Not writing WKF reference for {1}", new object[]
                    {
                        targetFolderType,
                        wkfType
                    });
                }
                else
                {
                    this.WriteEntryIdReference(ptfm, folderId, (PropTag[] pta) => folder.GetProps(pta), delegate(PropValueData[] pvda)
                    {
                        folder.SetProps(pvda);
                    });
                }
            }
        }
Exemple #8
0
        private void WriteWellKnownFolderReference(WellKnownFolderType wkfType, byte[] folderId)
        {
            WellKnownFolderMapping wellKnownFolderMapping = FolderHierarchyUtils.FindWKFMapping(wkfType, (int)this.Flags);
            PropTagFolderMapping   propTagFolderMapping   = wellKnownFolderMapping as PropTagFolderMapping;

            if (propTagFolderMapping != null)
            {
                if (propTagFolderMapping is MailboxRootFolderMapping)
                {
                    IDestinationMailbox mbx = this.MbxWrapper.Mailbox as IDestinationMailbox;
                    this.WriteEntryIdReference(propTagFolderMapping, folderId, (PropTag[] pta) => mbx.GetProps(pta), delegate(PropValueData[] pvda)
                    {
                        mbx.SetProps(pvda);
                    });
                    return;
                }
                if (propTagFolderMapping is InboxFolderMapping)
                {
                    this.WriteWellKnownFolderReferenceToFolder(WellKnownFolderType.Inbox, wkfType, propTagFolderMapping, folderId);
                    this.WriteWellKnownFolderReferenceToFolder(WellKnownFolderType.NonIpmSubtree, wkfType, propTagFolderMapping, folderId);
                    return;
                }
            }
            else
            {
                if (wellKnownFolderMapping is NamedFolderMapping)
                {
                    return;
                }
                MrsTracer.Service.Warning("Unable to write WKF reference {0} -> {1}", new object[]
                {
                    wkfType,
                    TraceUtils.DumpEntryId(folderId)
                });
            }
        }
 private static void ConnectAndValidateDestination(IDestinationMailbox destinationMailboxes, MailboxConnectFlags connectFlags, out MailboxServerInformation destinationHierarchyMailboxServerInfo, out MailboxInformation destinationHierarchyMailboxInfo)
 {
     destinationMailboxes.Connect(connectFlags);
     destinationHierarchyMailboxServerInfo = destinationMailboxes.GetMailboxServerInformation();
     destinationHierarchyMailboxInfo       = destinationMailboxes.GetMailboxInformation();
 }
Exemple #10
0
 public TranslatorPFProxy(ISourceMailbox sourceMailbox, IDestinationMailbox destinationMailbox, IFxProxyPool destinationProxyPool) : base(destinationProxyPool, true)
 {
     this.sourceMailbox      = sourceMailbox;
     this.destinationMailbox = destinationMailbox;
 }
Exemple #11
0
 public void SetHierarchyMailbox(IDestinationMailbox hierarchyMailbox)
 {
     this.hierarchyMailbox = hierarchyMailbox;
 }
		public PublicFolderMigrationSyncContext(ISourceMailbox sourceDatabase, FolderMap sourceFolderMap, IDestinationMailbox destinationMailbox, FolderMap targetFolderMap, bool isTargetPrimaryHierarchyMailbox) : base(sourceFolderMap, targetFolderMap)
		{
			this.sourceDatabase = sourceDatabase;
			this.destinationMailbox = destinationMailbox;
			this.isTargetPrimaryHierarchyMailbox = isTargetPrimaryHierarchyMailbox;
		}
Exemple #13
0
        public override void ConfigureProviders()
        {
            base.ConfigureProviders();
            RequestStatisticsBase cachedRequestJob   = base.MRSJob.CachedRequestJob;
            LocalMailboxFlags     localMailboxFlags  = LocalMailboxFlags.None;
            LocalMailboxFlags     localMailboxFlags2 = LocalMailboxFlags.None;

            if (cachedRequestJob.RequestType != MRSRequestType.MailboxRestore && cachedRequestJob.IgnoreRuleLimitErrors)
            {
                localMailboxFlags |= LocalMailboxFlags.StripLargeRulesForDownlevelTargets;
            }
            if (cachedRequestJob.OrganizationId == null)
            {
                OrganizationId forestWideOrgId = OrganizationId.ForestWideOrgId;
            }
            switch (cachedRequestJob.RequestType)
            {
            case MRSRequestType.Merge:
                if (cachedRequestJob.SourceIsLocal)
                {
                    localMailboxFlags |= LocalMailboxFlags.UseHomeMDB;
                }
                else
                {
                    localMailboxFlags |= LocalMailboxFlags.PureMAPI;
                }
                if (cachedRequestJob.TargetIsLocal)
                {
                    localMailboxFlags2 |= LocalMailboxFlags.UseHomeMDB;
                }
                else
                {
                    localMailboxFlags2 |= LocalMailboxFlags.PureMAPI;
                }
                break;

            case MRSRequestType.MailboxImport:
                localMailboxFlags2 |= LocalMailboxFlags.UseHomeMDB;
                break;

            case MRSRequestType.MailboxExport:
                localMailboxFlags |= LocalMailboxFlags.UseHomeMDB;
                break;

            case MRSRequestType.MailboxRestore:
                localMailboxFlags2 |= LocalMailboxFlags.UseHomeMDB;
                localMailboxFlags  |= LocalMailboxFlags.Restore;
                break;

            case MRSRequestType.Sync:
                localMailboxFlags2 |= LocalMailboxFlags.UseHomeMDB;
                if (cachedRequestJob.Flags.HasFlag(RequestFlags.TargetIsAggregatedMailbox))
                {
                    localMailboxFlags2 |= LocalMailboxFlags.AggregatedMailbox;
                }
                if (cachedRequestJob.SyncProtocol == SyncProtocol.Olc)
                {
                    localMailboxFlags2 |= LocalMailboxFlags.OlcSync;
                }
                break;
            }
            ISourceMailbox      sourceMailbox      = null;
            IDestinationMailbox destinationMailbox = null;

            switch (cachedRequestJob.RequestType)
            {
            case MRSRequestType.Merge:
            case MRSRequestType.MailboxExport:
            case MRSRequestType.MailboxRestore:
            {
                Guid primaryMailboxGuid = base.SourceMailboxGuid;
                Guid guid = cachedRequestJob.SourceMDBGuid;
                if (cachedRequestJob.SourceUser != null)
                {
                    primaryMailboxGuid = cachedRequestJob.SourceUser.ExchangeGuid;
                    if (localMailboxFlags.HasFlag(LocalMailboxFlags.UseHomeMDB))
                    {
                        ADObjectId adobjectId = cachedRequestJob.SourceIsArchive ? cachedRequestJob.SourceUser.ArchiveDatabase : cachedRequestJob.SourceUser.Database;
                        if (adobjectId != null)
                        {
                            guid = adobjectId.ObjectGuid;
                        }
                    }
                }
                sourceMailbox = this.GetSourceMailbox(new ADObjectId(guid, PartitionId.LocalForest.ForestFQDN), localMailboxFlags, null);
                sourceMailbox.Config(base.MRSJob.GetReservation(cachedRequestJob.SourceMDBGuid, ReservationFlags.Read), primaryMailboxGuid, base.SourceMailboxGuid, CommonUtils.GetPartitionHint(cachedRequestJob.OrganizationId), guid, MailboxType.SourceMailbox, null);
                if (cachedRequestJob.RequestType == MRSRequestType.MailboxRestore)
                {
                    sourceMailbox.ConfigRestore((cachedRequestJob.MailboxRestoreFlags != null) ? cachedRequestJob.MailboxRestoreFlags.Value : MailboxRestoreType.None);
                }
                break;
            }

            case MRSRequestType.MailboxImport:
                sourceMailbox = this.GetSourceMailbox(new ADObjectId(Guid.Empty), localMailboxFlags, null);
                sourceMailbox.ConfigPst(cachedRequestJob.FilePath, cachedRequestJob.ContentCodePage);
                break;

            case MRSRequestType.Sync:
            {
                sourceMailbox = this.GetSourceMailbox(new ADObjectId(Guid.Empty), localMailboxFlags, null);
                SyncProtocol syncProtocol = cachedRequestJob.SyncProtocol;
                if (syncProtocol == SyncProtocol.Eas)
                {
                    sourceMailbox.ConfigEas(cachedRequestJob.RemoteCredential, cachedRequestJob.EmailAddress, cachedRequestJob.TargetExchangeGuid, cachedRequestJob.SourceServer);
                }
                break;
            }
            }
            switch (cachedRequestJob.RequestType)
            {
            case MRSRequestType.Merge:
            case MRSRequestType.MailboxImport:
            case MRSRequestType.MailboxRestore:
            case MRSRequestType.Sync:
            {
                Guid primaryMailboxGuid2 = base.TargetMailboxGuid;
                Guid mdbGuid             = cachedRequestJob.TargetMDBGuid;
                if (cachedRequestJob.TargetUser != null)
                {
                    primaryMailboxGuid2 = cachedRequestJob.TargetUser.ExchangeGuid;
                    ADObjectId adobjectId2 = cachedRequestJob.TargetIsArchive ? cachedRequestJob.TargetUser.ArchiveDatabase : cachedRequestJob.TargetUser.Database;
                    if (adobjectId2 != null)
                    {
                        mdbGuid = adobjectId2.ObjectGuid;
                    }
                }
                destinationMailbox = this.GetDestinationMailbox(mdbGuid, localMailboxFlags2, null);
                if (cachedRequestJob.RequestType == MRSRequestType.Sync && localMailboxFlags2.HasFlag(LocalMailboxFlags.AggregatedMailbox) && !string.IsNullOrEmpty(cachedRequestJob.DomainControllerToUpdate))
                {
                    destinationMailbox.ConfigPreferredADConnection(cachedRequestJob.DomainControllerToUpdate);
                }
                destinationMailbox.Config(base.MRSJob.GetReservation(cachedRequestJob.TargetMDBGuid, ReservationFlags.Write), primaryMailboxGuid2, base.TargetMailboxGuid, CommonUtils.GetPartitionHint(cachedRequestJob.OrganizationId), mdbGuid, cachedRequestJob.TargetIsLocal ? MailboxType.DestMailboxIntraOrg : MailboxType.DestMailboxCrossOrg, null);
                if (cachedRequestJob.IsPublicFolderMailboxRestore && cachedRequestJob.RequestType == MRSRequestType.MailboxRestore)
                {
                    MailboxRestoreType restoreFlags = (cachedRequestJob.MailboxRestoreFlags != null) ? (cachedRequestJob.MailboxRestoreFlags.Value & ~MailboxRestoreType.Recovery) : MailboxRestoreType.None;
                    destinationMailbox.ConfigRestore(restoreFlags);
                }
                break;
            }

            case MRSRequestType.MailboxExport:
                destinationMailbox = this.GetDestinationMailbox(Guid.Empty, localMailboxFlags2, null);
                destinationMailbox.ConfigPst(cachedRequestJob.FilePath, null);
                destinationMailbox.Config(null, Guid.Empty, Guid.Empty, cachedRequestJob.PartitionHint, Guid.Empty, cachedRequestJob.TargetIsLocal ? MailboxType.DestMailboxIntraOrg : MailboxType.DestMailboxCrossOrg, null);
                break;
            }
            if (cachedRequestJob.RequestType == MRSRequestType.Merge && cachedRequestJob.RequestStyle == RequestStyle.CrossOrg)
            {
                bool credentialIsAdmin = cachedRequestJob.IsAdministrativeCredential == null || cachedRequestJob.IsAdministrativeCredential.Value;
                bool useNTLMAuth       = cachedRequestJob.AuthenticationMethod != null && cachedRequestJob.AuthenticationMethod.Value == AuthenticationMethod.Ntlm;
                if (cachedRequestJob.Direction == RequestDirection.Pull)
                {
                    ((MapiSourceMailbox)sourceMailbox).ConfigRPCHTTP(cachedRequestJob.RemoteMailboxLegacyDN, cachedRequestJob.RemoteUserLegacyDN, cachedRequestJob.RemoteMailboxServerLegacyDN, cachedRequestJob.OutlookAnywhereHostName, cachedRequestJob.RemoteCredential, credentialIsAdmin, useNTLMAuth);
                }
                else
                {
                    ((MapiDestinationMailbox)destinationMailbox).ConfigRPCHTTP(cachedRequestJob.RemoteMailboxLegacyDN, cachedRequestJob.RemoteUserLegacyDN, cachedRequestJob.RemoteMailboxServerLegacyDN, cachedRequestJob.OutlookAnywhereHostName, cachedRequestJob.RemoteCredential, credentialIsAdmin, useNTLMAuth);
                }
            }
            base.Config(sourceMailbox, destinationMailbox);
            FolderHierarchyFlags folderHierarchyFlags = FolderHierarchyFlags.None;

            if (cachedRequestJob.IsPublicFolderMailboxRestore)
            {
                folderHierarchyFlags |= FolderHierarchyFlags.PublicFolderMailbox;
            }
            this.SourceHierarchy = new FolderHierarchy(folderHierarchyFlags, base.SourceMailboxWrapper);
            this.DestHierarchy   = new FolderHierarchy(folderHierarchyFlags, base.DestMailboxWrapper);
            FolderIdTranslator  folderIdTranslator = new FolderIdTranslator(this.SourceHierarchy, this.DestHierarchy);
            PrincipalTranslator principalTranslator;

            if (cachedRequestJob.RequestStyle == RequestStyle.CrossOrg)
            {
                principalTranslator = new PrincipalTranslator(base.SourceMailboxWrapper.PrincipalMapper, base.DestMailboxWrapper.PrincipalMapper);
            }
            else
            {
                principalTranslator = null;
            }
            base.ConfigTranslators(principalTranslator, folderIdTranslator);
        }
Exemple #14
0
        public override void ConfigureProviders()
        {
            base.ConfigureProviders();
            RequestStatisticsBase       cachedRequestJob  = base.MRSJob.CachedRequestJob;
            LocalMailboxFlags           localMailboxFlags = LocalMailboxFlags.Move;
            List <MRSProxyCapabilities> list = new List <MRSProxyCapabilities>();

            if (cachedRequestJob.IgnoreRuleLimitErrors)
            {
                localMailboxFlags |= LocalMailboxFlags.StripLargeRulesForDownlevelTargets;
            }
            if (cachedRequestJob.IsSplitPrimaryAndArchive)
            {
                list.Add(MRSProxyCapabilities.ArchiveSeparation);
            }
            if (cachedRequestJob.TargetContainerGuid != null)
            {
                list.Add(MRSProxyCapabilities.ContainerOperations);
            }
            LocalMailboxFlags localMailboxFlags2 = LocalMailboxFlags.Move;

            if (base.Flags.HasFlag(MailboxCopierFlags.ContainerAggregated))
            {
                localMailboxFlags  |= LocalMailboxFlags.AggregatedMailbox;
                localMailboxFlags2 |= LocalMailboxFlags.AggregatedMailbox;
            }
            if (cachedRequestJob.RequestType == MRSRequestType.Move && base.IsRoot && base.IsPrimary && base.TargetMailboxContainerGuid != null)
            {
                localMailboxFlags2 |= LocalMailboxFlags.CreateNewPartition;
            }
            ADObjectId adobjectId = base.IsRoot ? cachedRequestJob.SourceDatabase : cachedRequestJob.SourceArchiveDatabase;

            if (base.Flags.HasFlag(MailboxCopierFlags.SourceIsArchive) && cachedRequestJob.JobType >= MRSJobType.RequestJobE14R5_PrimaryOrArchiveExclusiveMoves)
            {
                MrsTracer.Service.Debug("Overwriting archive guid in Archive MailboxMover...", new object[0]);
                ADObjectId adobjectId2;
                if ((adobjectId2 = cachedRequestJob.SourceArchiveDatabase) == null)
                {
                    adobjectId2 = new ADObjectId(cachedRequestJob.RemoteArchiveDatabaseGuid ?? Guid.Empty);
                }
                adobjectId         = adobjectId2;
                base.SourceMdbGuid = adobjectId.ObjectGuid;
                base.DestMdbGuid   = ((cachedRequestJob.TargetArchiveDatabase != null) ? cachedRequestJob.TargetArchiveDatabase.ObjectGuid : (cachedRequestJob.RemoteArchiveDatabaseGuid ?? Guid.Empty));
            }
            ISourceMailbox      sourceMailbox      = this.GetSourceMailbox(adobjectId, localMailboxFlags, list);
            IDestinationMailbox destinationMailbox = this.GetDestinationMailbox(base.DestMdbGuid, localMailboxFlags2, list);

            if (cachedRequestJob.RequestStyle == RequestStyle.CrossOrg && (cachedRequestJob.Flags & RequestFlags.RemoteLegacy) != RequestFlags.None)
            {
                if (cachedRequestJob.Direction == RequestDirection.Push)
                {
                    destinationMailbox.ConfigADConnection(cachedRequestJob.TargetDCName, cachedRequestJob.TargetDCName, cachedRequestJob.TargetCredential);
                }
                else
                {
                    sourceMailbox.ConfigADConnection(cachedRequestJob.SourceDCName, cachedRequestJob.SourceDCName, cachedRequestJob.SourceCredential);
                }
            }
            TenantPartitionHint partitionHint  = (cachedRequestJob.SourceIsLocal || cachedRequestJob.CrossResourceForest) ? this.partitionHintToUse : null;
            TenantPartitionHint partitionHint2 = (cachedRequestJob.TargetIsLocal || cachedRequestJob.CrossResourceForest) ? this.partitionHintToUse : null;

            if (base.MRSJob.TestIntegration.RemoteExchangeGuidOverride != Guid.Empty)
            {
                if (!cachedRequestJob.SourceIsLocal)
                {
                    partitionHint = this.partitionHintToUse;
                }
                if (!cachedRequestJob.TargetIsLocal)
                {
                    partitionHint2 = this.partitionHintToUse;
                }
            }
            Guid primaryMailboxGuid = base.Flags.HasFlag(MailboxCopierFlags.ContainerOrg) ? base.SourceMailboxGuid : cachedRequestJob.ExchangeGuid;

            sourceMailbox.Config(base.MRSJob.GetReservation(base.SourceMdbGuid, ReservationFlags.Read), primaryMailboxGuid, base.SourceMailboxGuid, partitionHint, base.SourceMdbGuid, MailboxType.SourceMailbox, null);
            destinationMailbox.Config(base.MRSJob.GetReservation(base.DestMdbGuid, ReservationFlags.Write), primaryMailboxGuid, base.TargetMailboxGuid, partitionHint2, base.DestMdbGuid, (cachedRequestJob.RequestStyle == RequestStyle.CrossOrg) ? MailboxType.DestMailboxCrossOrg : MailboxType.DestMailboxIntraOrg, base.TargetMailboxContainerGuid);
            base.Config(sourceMailbox, destinationMailbox);
        }
Exemple #15
0
 public PublicFolderMoveSyncContext(ISourceMailbox sourceMailbox, FolderMap sourceFolderMap, IDestinationMailbox destinationMailbox, FolderMap targetFolderMap) : base(sourceFolderMap, targetFolderMap)
 {
     this.sourceMailbox      = sourceMailbox;
     this.destinationMailbox = destinationMailbox;
 }
Exemple #16
0
 internal void SetMailboxWrappers(SourceMailboxWrapper sourceMailboxWrapper, IDestinationMailbox destinationMailbox)
 {
     base.SourceMailboxWrapper = sourceMailboxWrapper;
     this.destinationMailbox   = destinationMailbox;
 }