Beispiel #1
0
        protected override void UpdateStoreAssociationMasterData(MailboxAssociation association, IMailboxAssociationBaseItem item)
        {
            IMailboxAssociationGroup mailboxAssociationGroup = (IMailboxAssociationGroup)item;

            BaseAssociationAdaptor.UpdateLocatorDataInStoreItem(association.Group, mailboxAssociationGroup);
            mailboxAssociationGroup.IsPin   = association.IsPin;
            mailboxAssociationGroup.PinDate = association.PinDate;
        }
Beispiel #2
0
        protected override void UpdateStoreAssociationSlaveData(MailboxAssociation association, IMailboxAssociationBaseItem item)
        {
            IMailboxAssociationUser mailboxAssociationUser = (IMailboxAssociationUser)item;

            BaseAssociationAdaptor.UpdateLocatorDataInStoreItem(association.User, mailboxAssociationUser);
            mailboxAssociationUser.SyncedIdentityHash = association.Group.IdentityHash;
            mailboxAssociationUser.IsPin = association.IsPin;
        }
Beispiel #3
0
        protected override void UpdateStoreAssociationSlaveData(MailboxAssociation association, IMailboxAssociationBaseItem item)
        {
            IMailboxAssociationGroup mailboxAssociationGroup = (IMailboxAssociationGroup)item;

            BaseAssociationAdaptor.UpdateLocatorDataInStoreItem(association.Group, mailboxAssociationGroup);
            mailboxAssociationGroup.SyncedIdentityHash = association.User.IdentityHash;
            mailboxAssociationGroup.IsMember           = association.IsMember;
            mailboxAssociationGroup.JoinDate           = association.JoinDate;
            if (!association.IsMember)
            {
                mailboxAssociationGroup.IsPin = false;
            }
        }
Beispiel #4
0
        protected override void UpdateStoreAssociationMasterData(MailboxAssociation association, IMailboxAssociationBaseItem item)
        {
            IMailboxAssociationUser mailboxAssociationUser = (IMailboxAssociationUser)item;

            BaseAssociationAdaptor.UpdateLocatorDataInStoreItem(association.User, mailboxAssociationUser);
            mailboxAssociationUser.SmtpAddress      = association.UserSmtpAddress;
            mailboxAssociationUser.IsMember         = association.IsMember;
            mailboxAssociationUser.ShouldEscalate   = association.ShouldEscalate;
            mailboxAssociationUser.IsAutoSubscribed = association.IsAutoSubscribed;
            mailboxAssociationUser.JoinedBy         = association.JoinedBy;
            mailboxAssociationUser.JoinDate         = association.JoinDate;
            mailboxAssociationUser.LastVisitedDate  = association.LastVisitedDate;
            if (!association.IsMember && mailboxAssociationUser.IsPin)
            {
                mailboxAssociationUser.IsPin = false;
            }
        }
        public void UpdateSlaveDataFromMailboxAssociation(MasterMailboxType masterMailboxData, MailboxAssociationType associationType)
        {
            GroupMailboxAccessLayer.Tracer.TraceDebug <MasterMailboxType, MailboxAssociationType>((long)this.GetHashCode(), "GroupMailboxAccessLayer::UpdateSlaveDataFromMailboxAssociation. Replicating data from mailbox: {0}. Association data: {1}", masterMailboxData, associationType);
            if (masterMailboxData.MailboxType != UserMailboxLocator.MailboxLocatorType && masterMailboxData.MailboxType != GroupMailboxLocator.MailboxLocatorType)
            {
                throw new InvalidOperationException("UpdateSlaveDataFromMailboxAssociation: Invalid MasterMailboxType");
            }
            MailboxAssociation mailboxAssociation = EwsAssociationDataConverter.Convert(associationType, this.adSession);
            IMailboxLocator    mailboxLocator;

            if (!(masterMailboxData.MailboxType == GroupMailboxLocator.MailboxLocatorType))
            {
                IMailboxLocator group = mailboxAssociation.Group;
                mailboxLocator = group;
            }
            else
            {
                mailboxLocator = mailboxAssociation.User;
            }
            IMailboxLocator targetMailbox = mailboxLocator;

            using (IAssociationStore associationStore = this.storeProviderBuilder.Create(targetMailbox, this.PerformanceTracker))
            {
                this.LogCommandExecution("UpdateSlaveDataFromMailboxAssociation", mailboxAssociation.Group, new UserMailboxLocator[]
                {
                    mailboxAssociation.User
                });
                BaseAssociationAdaptor baseAssociationAdaptor = (masterMailboxData.MailboxType == GroupMailboxLocator.MailboxLocatorType) ? new GroupAssociationAdaptor(associationStore, this.adSession, mailboxAssociation.User) : new UserAssociationAdaptor(associationStore, this.adSession, mailboxAssociation.Group);
                baseAssociationAdaptor.UseAlternateLocatorLookup = true;
                baseAssociationAdaptor.MasterMailboxData         = masterMailboxData;
                baseAssociationAdaptor.ReplicateAssociation(mailboxAssociation);
                if (masterMailboxData.MailboxType == GroupMailboxLocator.MailboxLocatorType && mailboxAssociation.IsMember)
                {
                    TimeSpan latency = ExDateTime.UtcNow - mailboxAssociation.JoinDate;
                    this.LogPerformanceCounter(MailboxAssociationLogSchema.PerformanceCounterName.JoinGroupAssociationReplication, latency, "Group={0}, User={1}", new object[]
                    {
                        mailboxAssociation.Group.ExternalId,
                        mailboxAssociation.User.ExternalId
                    });
                }
            }
        }