Exemplo n.º 1
0
        protected override IConfigDataProvider CreateSession()
        {
            IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, base.SessionSettings, 149, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Mobility\\Aggregation\\SetSubscriptionBase.cs");

            if (this.Mailbox == null)
            {
                if (this.Identity != null && this.Identity.MailboxIdParameter != null)
                {
                    this.Mailbox = this.Identity.MailboxIdParameter;
                }
                else
                {
                    ADObjectId adObjectId;
                    if (!base.TryGetExecutingUserId(out adObjectId))
                    {
                        throw new ExecutingUserPropertyNotFoundException("executingUserid");
                    }
                    this.Mailbox = new MailboxIdParameter(adObjectId);
                }
            }
            ADUser            adUser  = (ADUser)base.GetDataObject <ADUser>(this.Mailbox, tenantOrRootOrgRecipientSession, null, new LocalizedString?(Strings.ErrorUserNotFound(this.Mailbox.ToString())), new LocalizedString?(Strings.ErrorUserNotUnique(this.Mailbox.ToString())));
            IRecipientSession session = AggregationTaskUtils.VerifyIsWithinWriteScopes(tenantOrRootOrgRecipientSession, adUser, new Task.TaskErrorLoggingDelegate(this.WriteDebugInfoAndError));
            AggregationSubscriptionDataProvider result = null;

            try
            {
                result = SubscriptionConfigDataProviderFactory.Instance.CreateSubscriptionDataProvider(this.AggregationType, AggregationTaskType.Set, session, adUser);
            }
            catch (MailboxFailureException exception)
            {
                this.WriteDebugInfoAndError(exception, ErrorCategory.InvalidArgument, this.Mailbox);
            }
            return(result);
        }
Exemplo n.º 2
0
        protected override IConfigDataProvider CreateSession()
        {
            ADSessionSettings sessionSettings = base.SessionSettings;
            IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.IgnoreInvalid, sessionSettings, 58, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Mobility\\Aggregation\\SetRemoteAccountSyncCache.cs");
            string            idStringValue    = this.Identity.ToString();
            ADUser            aduser           = (ADUser)base.GetDataObject <ADUser>(this.Identity.MailboxId, tenantOrRootOrgRecipientSession, null, new LocalizedString?(Strings.ErrorUserNotFound(idStringValue)), new LocalizedString?(Strings.ErrorUserNotUnique(idStringValue)));
            IRecipientSession recipientSession = AggregationTaskUtils.VerifyIsWithinWriteScopes(tenantOrRootOrgRecipientSession, aduser, new Task.TaskErrorLoggingDelegate(this.WriteDebugInfoAndError));

            try
            {
                this.userPrincipal = ExchangePrincipal.FromLegacyDN(recipientSession.SessionSettings, aduser.LegacyExchangeDN, RemotingOptions.AllowCrossSite);
            }
            catch (ObjectNotFoundException exception)
            {
                base.WriteError(exception, ErrorCategory.InvalidArgument, this.Identity.MailboxId);
            }
            return(new CacheDataProvider(SubscriptionCacheAction.Fix, this.userPrincipal));
        }
Exemplo n.º 3
0
        protected override IConfigDataProvider CreateSession()
        {
            IRecipientSession  tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, base.SessionSettings, 82, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Mobility\\Aggregation\\RemoveSubscriptionBase.cs");
            MailboxIdParameter mailboxIdParameter      = this.GetMailboxIdParameter();
            ADUser             adUser                  = (ADUser)base.GetDataObject <ADUser>(mailboxIdParameter, tenantOrRootOrgRecipientSession, null, new LocalizedString?(Strings.ErrorUserNotFound(mailboxIdParameter.ToString())), new LocalizedString?(Strings.ErrorUserNotUnique(mailboxIdParameter.ToString())));
            IRecipientSession  session                 = AggregationTaskUtils.VerifyIsWithinWriteScopes(tenantOrRootOrgRecipientSession, adUser, new Task.TaskErrorLoggingDelegate(this.WriteDebugInfoAndError));
            AggregationSubscriptionDataProvider result = null;

            try
            {
                AggregationType aggregationType = this.AggregationType;
                if (this.Identity != null && this.Identity.AggregationType != null)
                {
                    aggregationType = this.Identity.AggregationType.Value;
                }
                result = SubscriptionConfigDataProviderFactory.Instance.CreateSubscriptionDataProvider(aggregationType, AggregationTaskType.Remove, session, adUser);
            }
            catch (MailboxFailureException exception)
            {
                this.WriteDebugInfoAndError(exception, ErrorCategory.InvalidArgument, mailboxIdParameter);
            }
            return(result);
        }