public GlobalEndpointManager(DatabaseAccountManagerInternal client) { this.client = client; this.enableEndpointDiscovery = client.getConnectionPolicy().getEnableEndpointDiscovery(); Collection<String> preferredLocations = client.getConnectionPolicy().getPreferredLocations() != null ? Collections.unmodifiableCollection(client.getConnectionPolicy().getPreferredLocations()) : null; this.defaultEndpoint = client.getServiceEndpoint(); this.backgroundRefreshLocationTimeIntervalInMS = getBackgroundRefreshLocationTimeIntervalInMS(); this.locationCache = createLocationCache(preferredLocations, client.getServiceEndpoint(), this.enableEndpointDiscovery, client.getConnectionPolicy().isUsingMultipleWriteLocations(), this.backgroundRefreshLocationTimeIntervalInMS); this.isRefreshing = false; this.refreshLock = new Object(); }