コード例 #1
0
        // Token: 0x0600001C RID: 28 RVA: 0x00002F60 File Offset: 0x00001160
        private bool RegisterConfigurationChangeHandlers(out ADOperationResult opResult)
        {
            ExTraceGlobals.ServiceTracer.TraceDebug(0L, "TransportService register configuration change notifications");
            Server server;

            if (ADNotificationAdapter.TryReadConfiguration <Server>(delegate()
            {
                Server result;
                try
                {
                    result = TransportService.adConfigurationSession.FindLocalServer();
                }
                catch (LocalServerNotFoundException)
                {
                    result = null;
                }
                return(result);
            }, out server, out opResult))
            {
                opResult = ADNotificationAdapter.TryRunADOperation(delegate()
                {
                    if (this.receiveConnectorNotificationCookie == null)
                    {
                        this.receiveConnectorNotificationCookie = TransportADNotificationAdapter.Instance.RegisterForLocalServerReceiveConnectorNotifications(server.Id, new ADNotificationCallback(this.ConnectorsConfigUpdate));
                        ExTraceGlobals.ServiceTracer.TraceDebug <ADObjectId>(0L, "TransportService registered for Receive Connector configuration change notifications (server id={0})", server.Id);
                    }
                    this.serverNotificationCookie = TransportADNotificationAdapter.Instance.RegisterForExchangeServerNotifications(server.Id, new ADNotificationCallback(this.ServerConfigUpdate));
                    ExTraceGlobals.ServiceTracer.TraceDebug <ADObjectId>(0L, "TransportService registered for Server configuration change notifications (server id={0})", server.Id);
                });
                return(opResult.Succeeded);
            }
            ExTraceGlobals.ServiceTracer.TraceDebug(0L, "TransportService failed to get local server. Failed to register for configuration change notifications.");
            return(false);
        }
コード例 #2
0
        // Token: 0x0600101E RID: 4126 RVA: 0x00041FE0 File Offset: 0x000401E0
        protected override void OnServerChangeCallback(ADNotificationEventArgs args)
        {
            if (args != null)
            {
                this.tracer.TraceDebug <string, string>(0L, "OnServerChangeCallback notification change type {0}, object ID {1}", args.ChangeType.ToString(), (args.Id == null) ? "(null)" : args.Id.ToString());
            }
            if (args.ChangeType == ADNotificationChangeType.ModifyOrAdd && args.Id != null)
            {
                Server            server;
                ADOperationResult adoperationResult;
                if (ADNotificationAdapter.TryReadConfiguration <Server>(() => this.configurationSession.Read <Server>(args.Id), out server, out adoperationResult))
                {
                    lock (this.serversLock)
                    {
                        if (this.servers != null && this.servers.IsChangeIgnorable(server))
                        {
                            return;
                        }
                        goto IL_107;
                    }
                }
                this.tracer.TraceError <ADObjectId, Exception>(0L, "Failed to read server object with Id {0} due to {1}", args.Id, adoperationResult.Exception);
            }
IL_107:
            base.ReadConfiguration();
        }
コード例 #3
0
        // Token: 0x06000032 RID: 50 RVA: 0x0000389C File Offset: 0x00001A9C
        private static void ServerChangeCallback(ADNotificationEventArgs args)
        {
            Server server = null;

            ADNotificationAdapter.TryReadConfiguration <Server>(delegate()
            {
                ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 362, "ServerChangeCallback", "f:\\15.00.1497\\sources\\dev\\Approval\\src\\Applications\\ModeratedDLApplication\\ModeratedDLApplication.cs");
                return(topologyConfigurationSession.ReadLocalServer());
            }, out server);
            if (server == null)
            {
                ModeratedDLApplication.diag.TraceError(0L, "Cannot read local server for updating message tracking config. Continue with previous config.");
                return;
            }
            MessageTrackingLog.Configure(server);
        }
コード例 #4
0
        // Token: 0x06000022 RID: 34 RVA: 0x0000318C File Offset: 0x0000138C
        private bool ReadServerConfig(out ADOperationResult opResult)
        {
            ExTraceGlobals.ServiceTracer.TraceDebug(0L, "Read MaxConnectionRatePerMinute from AD");
            Server server = null;

            if (!ADNotificationAdapter.TryReadConfiguration <Server>(delegate()
            {
                Server result;
                try
                {
                    result = TransportService.adConfigurationSession.FindLocalServer();
                }
                catch (LocalServerNotFoundException)
                {
                    result = null;
                }
                return(result);
            }, out server, out opResult))
            {
                return(false);
            }
            base.MaxConnectionRate = server.MaxConnectionRatePerMinute;
            return(true);
        }