class InstanceProviderManager {

    ProviderScheme getProviderEndpointScheme(URI uri) {
        
        // verify that we have a valid endpoint that ends in one of our
        // configured domains.
        
        String host = uri.getHost();
        if (host == null) {
            LOGGER.error("verifyProviderEndpoint: Provider endpoint {} has no host component",
                    uri.toString());
            return ProviderScheme.UNKNOWN;
        }
        host = host.toLowerCase();
        
        String scheme = uri.getScheme();
        if (scheme == null) {
            LOGGER.error("verifyProviderEndpoint: Provider endpoint {} has no scheme component",
                    uri.toString());
            return ProviderScheme.UNKNOWN;
        }
        
        ProviderScheme schemeType = getProviderScheme(uri);
        if (schemeType == ProviderScheme.UNKNOWN) {
            LOGGER.error("verifyProviderEndpoint: Unknown scheme in URI {}", uri.toString());
            return ProviderScheme.UNKNOWN;
        }
        
        // we only validate endpoints for https requests
        
        if (schemeType != ProviderScheme.HTTPS) {
            return schemeType;
        }
        
        if (!verifyProviderEndpoint(host)) {
            LOGGER.error("verifyProviderEndpoint: Provider host {} does not match with any of the configured domains",
                    host);
            return ProviderScheme.UNKNOWN;
        }

        return schemeType;
    }

    public  InstanceProviderManager(DataStore dataStore, SSLContext sslContext, KeyStore keyStore);

}