Ejemplo n.º 1
0
        // Token: 0x06000351 RID: 849 RVA: 0x00011FC4 File Offset: 0x000101C4
        public static ADNotificationRequestCookie RegisterChangeNotification <T>(ADObjectId baseDN, ADNotificationCallback callback, object context, int retryCount) where T : ADConfigurationObject, new()
        {
            object wrappedContext;

            ADNotificationAdapter.CreateWrappedContextForRegisterChangeNotification(ref baseDN, callback, context, out wrappedContext);
            return(ADNotificationAdapter.RegisterChangeNotification <T>(baseDN, wrappedContext, true, retryCount));
        }
Ejemplo n.º 2
0
        // Token: 0x0600035A RID: 858 RVA: 0x00012274 File Offset: 0x00010474
        public static ADNotificationRequestCookie RegisterExchangeTopologyChangeNotification(ADNotificationCallback callback, object context, ExchangeTopologyScope topologyType)
        {
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 387, "RegisterExchangeTopologyChangeNotification", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\ADNotificationAdapter.cs");
            ADObjectId childId        = topologyConfigurationSession.ConfigurationNamingContext.GetChildId("CN", "Sites");
            ADObjectId childId2       = childId.GetChildId("CN", "Inter-Site Transports").GetChildId("CN", "IP");
            ADObjectId orgContainerId = topologyConfigurationSession.GetOrgContainerId();

            ADNotificationRequest[] requests;
            switch (topologyType)
            {
            case ExchangeTopologyScope.Complete:
                requests = new ADNotificationRequest[]
                {
                    ADNotificationAdapter.RegisterChangeNotification <ADServer>(childId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADSite>(childId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADSiteLink>(childId2, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADSubnet>(childId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADVirtualDirectory>(orgContainerId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <Server>(orgContainerId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ReceiveConnector>(orgContainerId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADEmailTransport>(orgContainerId, callback, context).Requests[0]
                };
                break;

            case ExchangeTopologyScope.ServerAndSiteTopology:
                requests = new ADNotificationRequest[]
                {
                    ADNotificationAdapter.RegisterChangeNotification <ADSite>(childId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADSiteLink>(childId2, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <Server>(orgContainerId, callback, context).Requests[0]
                };
                break;

            case ExchangeTopologyScope.ADAndExchangeServerAndSiteTopology:
                requests = new ADNotificationRequest[]
                {
                    ADNotificationAdapter.RegisterChangeNotification <ADServer>(childId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADSite>(childId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADSiteLink>(childId2, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <Server>(orgContainerId, callback, context).Requests[0]
                };
                break;

            case ExchangeTopologyScope.ADAndExchangeServerAndSiteAndVirtualDirectoryTopology:
                requests = new ADNotificationRequest[]
                {
                    ADNotificationAdapter.RegisterChangeNotification <ADServer>(childId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADSite>(childId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADSiteLink>(childId2, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <Server>(orgContainerId, callback, context).Requests[0],
                    ADNotificationAdapter.RegisterChangeNotification <ADVirtualDirectory>(orgContainerId, callback, context).Requests[0]
                };
                break;

            default:
                throw new ArgumentException("topologyType", "topologyType");
            }
            return(new ADNotificationRequestCookie(requests));
        }
Ejemplo n.º 3
0
        // Token: 0x06000356 RID: 854 RVA: 0x000121D0 File Offset: 0x000103D0
        public static ADOperationResult TryRegisterChangeNotification <T>(Func <ADObjectId> baseDNGetter, ADNotificationCallback callback, object context, int retryCount, out ADNotificationRequestCookie cookie) where T : ADConfigurationObject, new()
        {
            cookie = null;
            ADNotificationRequestCookie returnedCookie = cookie;
            ADOperationResult           result         = ADNotificationAdapter.TryRunADOperation(delegate()
            {
                ADObjectId baseDN = (baseDNGetter == null) ? null : baseDNGetter();
                object wrappedContext;
                ADNotificationAdapter.CreateWrappedContextForRegisterChangeNotification(ref baseDN, callback, context, out wrappedContext);
                returnedCookie = ADNotificationAdapter.RegisterChangeNotification <T>(baseDN, wrappedContext, false, 0);
            }, retryCount);

            cookie = returnedCookie;
            return(result);
        }
Ejemplo n.º 4
0
        // Token: 0x06000352 RID: 850 RVA: 0x00012014 File Offset: 0x00010214
        public static ADNotificationRequestCookie RegisterChangeNotification <T>(ADObjectId baseDN, object wrappedContext, bool wrapAsADOperation, int retryCount) where T : ADConfigurationObject, new()
        {
            ADNotificationRequestCookie cookie = null;

            if (wrapAsADOperation)
            {
                ADNotificationAdapter.RunADOperation(delegate()
                {
                    cookie = ADNotificationAdapter.RegisterChangeNotification <T>(baseDN, new ADNotificationCallback(ADNotificationAdapter.OnNotification), wrappedContext);
                }, retryCount);
            }
            else
            {
                cookie = ADNotificationAdapter.RegisterChangeNotification <T>(baseDN, new ADNotificationCallback(ADNotificationAdapter.OnNotification), wrappedContext);
            }
            return(cookie);
        }
Ejemplo n.º 5
0
 // Token: 0x06000353 RID: 851 RVA: 0x00012083 File Offset: 0x00010283
 public static ADNotificationRequestCookie RegisterChangeNotification <T>(ADObjectId baseDN, ADNotificationCallback callback, object context) where T : ADConfigurationObject, new()
 {
     return(ADNotificationAdapter.RegisterChangeNotification <T>(Activator.CreateInstance <T>(), baseDN, callback, context));
 }
Ejemplo n.º 6
0
 // Token: 0x06000350 RID: 848 RVA: 0x00011FB8 File Offset: 0x000101B8
 public static ADNotificationRequestCookie RegisterChangeNotification <T>(ADObjectId baseDN, ADNotificationCallback callback) where T : ADConfigurationObject, new()
 {
     return(ADNotificationAdapter.RegisterChangeNotification <T>(baseDN, callback, null, 10));
 }