private void DeleteMailboxAssociation(MailboxAssociationFromStore association, IAssociationAdaptor associationAdaptor, ADUser masterMailbox, IExtensibleLogger logger)
 {
     if (association != null)
     {
         associationAdaptor.DeleteAssociation(association);
         return;
     }
     base.WriteError(new ManagementObjectNotFoundException(base.GetErrorMessageObjectNotFound(this.Identity.AssociationIdValue, typeof(MailboxAssociationPresentationObject).ToString(), this.Identity.MailboxId.ToString())), ExchangeErrorCategory.Client, this.Identity);
 }
Esempio n. 2
0
        private bool DeleteMailboxNotFoundAssociation(MailboxAssociation association, IAssociationAdaptor masterAdaptor, MailboxNotFoundException exception)
        {
            bool flag = association.JoinDate.Add(InProcessAssociationReplicator.TimeRequiredAfterJoinToStopAssociationReplicationAttempts) < ExDateTime.UtcNow;

            InProcessAssociationReplicator.Tracer.TraceDebug <bool, MailboxNotFoundException, MailboxAssociation>((long)this.GetHashCode(), "InProcessAssociationReplicator.DeleteMailboxNotFoundAssociation. Should delete = {0}. Exception = {1}. Association = {2}", flag, exception, association);
            if (flag)
            {
                this.LogWarning("InProcessAssociationReplicator.DeleteMailboxNotFoundAssociation", string.Format("Deleting association given that target mailbox was not found and it is not a recently joined group. Association='{0}'. Exception='{1}'", association, exception));
                masterAdaptor.DeleteAssociation(association);
                return(true);
            }
            return(false);
        }