Пример #1
0
        public ADNotificationRequestCookie RegisterForJournalRuleNotifications(ADObjectId baseDN, ADNotificationCallback callback)
        {
            ADNotificationRequestCookie result = ADNotificationAdapter.RegisterChangeNotification <TransportRule>(baseDN, callback);

            if (this.NeedExplicitDeletedObjectSubscription)
            {
                this.VerifyRootWasRegistered <TransportRule>();
            }
            return(result);
        }
Пример #2
0
        public ADNotificationRequestCookie RegisterForRemoteDomainNotifications(ADObjectId baseDN, ADNotificationCallback callback)
        {
            ADNotificationRequestCookie result = ADNotificationAdapter.RegisterChangeNotification <DomainContentConfig>(baseDN, callback);

            if (this.NeedExplicitDeletedObjectSubscription)
            {
                this.VerifyRootWasRegistered <DomainContentConfig>();
            }
            return(result);
        }
Пример #3
0
        public ADNotificationRequestCookie RegisterForLocalServerReceiveConnectorNotifications(ADObjectId baseDN, ADNotificationCallback callback)
        {
            ADNotificationRequestCookie result = ADNotificationAdapter.RegisterChangeNotification <ReceiveConnector>(baseDN, callback);

            if (this.NeedExplicitDeletedObjectSubscription)
            {
                this.VerifyRootWasRegistered <ReceiveConnector>();
            }
            return(result);
        }
Пример #4
0
        public static ADOperationResult TryRegisterNotifications(Func <ADObjectId> baseDNGetter, ADNotificationCallback callback, TransportADNotificationAdapter.TransportADNotificationRegister registerDelegate, int retryCount, out ADNotificationRequestCookie cookie)
        {
            ADNotificationRequestCookie adCookie = null;
            ADOperationResult           result   = ADNotificationAdapter.TryRunADOperation(delegate()
            {
                ADObjectId root = (baseDNGetter == null) ? null : baseDNGetter();
                adCookie        = registerDelegate(root, callback);
            }, retryCount);

            cookie = adCookie;
            return(result);
        }
Пример #5
0
        public ADNotificationRequestCookie RegisterForMailGatewayNotifications(ADObjectId rootId, ADNotificationCallback callback)
        {
            ADNotificationRequestCookie result = ADNotificationAdapter.RegisterChangeNotification <MailGateway>(rootId, callback);

            if (this.NeedExplicitDeletedObjectSubscription)
            {
                this.VerifyRootWasRegistered <SmtpSendConnectorConfig>();
                this.VerifyRootWasRegistered <DeliveryAgentConnector>();
                this.VerifyRootWasRegistered <ForeignConnector>();
            }
            return(result);
        }
Пример #6
0
        protected override ADNotificationRequestCookie Register(IConfigurationSession session)
        {
            ADNotificationRequestCookie request = ADNotificationAdapter.RegisterChangeNotification <PolicyTipMessageConfig>(PerTenantPolicyNudgeRulesCollection.GetPolicyTipMessageConfigsContainerId(session), new ADNotificationCallback(base.ChangeCallback), session);
            ADNotificationRequestCookie result;

            try
            {
                result = ADNotificationAdapter.RegisterChangeNotification <TransportRule>(PerTenantPolicyNudgeRulesCollection.GetPolicyNudgeRuleContainerId(session), new ADNotificationCallback(base.ChangeCallback), session);
            }
            catch (Exception ex)
            {
                ADNotificationAdapter.UnregisterChangeNotification(request);
                throw ex;
            }
            return(result);
        }
Пример #7
0
        // Token: 0x06000002 RID: 2 RVA: 0x000020F4 File Offset: 0x000002F4
        public override void Work()
        {
            Servicelet.Tracer.TraceDebug((long)this.GetHashCode(), "Work(): Entering");
            this.session = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 104, "Work", "f:\\15.00.1497\\sources\\dev\\Management\\src\\ServiceHost\\Servicelets\\CertificateDeployment\\Program\\CertificateDeploymentServicelet.cs");
            try
            {
                this.localServer = this.session.FindLocalServer();
            }
            catch (LocalServerNotFoundException ex)
            {
                Servicelet.Tracer.TraceError <LocalServerNotFoundException>((long)this.GetHashCode(), "LocalServerNotFound: {0}", ex);
                this.eventLogger.LogEvent(MSExchangeCertificateDeploymentEventLogConstants.Tuple_PermanentException, null, new object[]
                {
                    ex
                });
                return;
            }
            ADNotificationRequestCookie adnotificationRequestCookie  = null;
            ADNotificationRequestCookie adnotificationRequestCookie2 = null;

            try
            {
                this.distributionTimer       = new GuardedTimer(new TimerCallback(this.DoScheduledWork), null, Servicelet.NotificationDelay, Servicelet.ReloadDelay);
                adnotificationRequestCookie  = this.InstallConfigMonitor <FederationTrust>("Federation Trusts");
                adnotificationRequestCookie2 = this.InstallConfigMonitor <AuthConfig>(AuthConfig.ContainerName);
                base.StopEvent.WaitOne();
                Servicelet.Tracer.TraceDebug((long)this.GetHashCode(), "Work(): Exiting");
            }
            finally
            {
                if (adnotificationRequestCookie != null)
                {
                    ADNotificationAdapter.UnregisterChangeNotification(adnotificationRequestCookie);
                }
                if (adnotificationRequestCookie2 != null)
                {
                    ADNotificationAdapter.UnregisterChangeNotification(adnotificationRequestCookie2);
                }
                if (this.distributionTimer != null)
                {
                    this.distributionTimer.Dispose(false);
                }
            }
        }
Пример #8
0
        // Token: 0x06000003 RID: 3 RVA: 0x0000227C File Offset: 0x0000047C
        private ADNotificationRequestCookie InstallConfigMonitor <T>(string containerName) where T : ADConfigurationObject, new()
        {
            ADNotificationRequestCookie notificationCookie = null;
            ADOperationResult           adoperationResult  = ADNotificationAdapter.TryRunADOperation(delegate()
            {
                ADObjectId childId = this.session.GetOrgContainerId().GetChildId(containerName);
                notificationCookie = ADNotificationAdapter.RegisterChangeNotification <T>(childId, new ADNotificationCallback(this.ChangeNotificationDispatch));
            }, 3);

            if (!adoperationResult.Succeeded)
            {
                Servicelet.Tracer.TraceError <Exception>((long)this.GetHashCode(), "Notification Registration Failed: {0}", adoperationResult.Exception);
                this.eventLogger.LogEvent(MSExchangeCertificateDeploymentEventLogConstants.Tuple_NotificationException, null, new object[]
                {
                    adoperationResult.Exception
                });
            }
            return(notificationCookie);
        }
Пример #9
0
 public void UnregisterChangeNotification(ADNotificationRequestCookie cookie)
 {
     ADNotificationAdapter.UnregisterChangeNotification(cookie);
 }