Beispiel #1
0
        protected override ServiceEndpoint CreateOnCacheMiss(string serviceEndpointId, ref bool shouldAdd)
        {
            PlacesConfigurationCache.Tracer.TraceDebug <string>((long)this.GetHashCode(), "PlacesConfigurationCache.CreateOnCacheMiss called for service endpoint id: {0}", serviceEndpointId);
            ServiceEndpoint result = null;

            try
            {
                ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 215, "CreateOnCacheMiss", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\SystemConfiguration\\ConfigurationCache\\PlacesConfigurationCache.cs");
                ServiceEndpointContainer      endpointContainer            = topologyConfigurationSession.GetEndpointContainer();
                result = endpointContainer.GetEndpoint(serviceEndpointId);
            }
            catch (EndpointContainerNotFoundException)
            {
                PlacesConfigurationCache.Tracer.TraceDebug(0L, "PlacesConfigurationCache: Endpoint Container doesn't exist.");
            }
            catch (ServiceEndpointNotFoundException)
            {
                PlacesConfigurationCache.Tracer.TraceDebug <string>(0L, "PlacesConfigurationCache: Endpoint '{0}' doesn't exist.", serviceEndpointId);
            }
            catch (LocalizedException arg)
            {
                PlacesConfigurationCache.Tracer.TraceError <LocalizedException>(0L, "PlacesConfigurationCache: Unable to read service endpoint due to exception: {0}", arg);
            }
            return(result);
        }
Beispiel #2
0
        internal static string GetMserveWebServiceClientTokenFromEndpointConfig(ITopologyConfigurationSession configSession)
        {
            if (configSession == null)
            {
                configSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 153, "GetMserveWebServiceClientTokenFromEndpointConfig", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\SystemConfiguration\\EdgeSyncMservConnector.cs");
            }
            ServiceEndpointContainer endpointContainer = configSession.GetEndpointContainer();
            ServiceEndpoint          endpoint          = endpointContainer.GetEndpoint(ServiceEndpointId.DeltaSyncPartnerProvision);

            return(endpoint.Token);
        }