EndpointContext is an internal class used by the client library to resolve the endpoint. It is
created once the library is initialized should not be updated manually.
Contains the fields required to resolve the endpoint and Universe Domain
ServiceName is host URI for Google Cloud Services. It follows the format of{ServiceName}.googleapis.com. For example, speech.googleapis.com would have a ServiceName of
speech and cloudasset.googleapis.com would have a ServiceName of cloudasset.
Universe Domain is the domain for Google Cloud Services. It follows the format of{ServiceName}.{UniverseDomain}. For example, speech.googleapis.com would have a Universe
Domain value ofgoogleapis.comand cloudasset.test.com would have a Universe Domain oftest.com. If this value is not set, this will default togoogleapis.com.
Check that the User configured universe domain matches the Credentials' universe domain. The
status code parameter is passed in to this method as it's a limitation of Gax's modules. The
transport-neutral module does have access the transport-specific modules (which contain the
implementation of the StatusCode). This method is scoped to be internal and should be not be
accessed by users.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe latest version of EndpointContext is 2.63.1, and there are numerous previous versions listed, ranging down to 2.7.1.\u003c/p\u003e\n"],["\u003cp\u003eEndpointContext is an internal class in the client library used for resolving endpoints and should not be updated manually.\u003c/p\u003e\n"],["\u003cp\u003eIt contains fields necessary for endpoint resolution and managing the Universe Domain, with a default Universe Domain of \u003ccode\u003egoogleapis.com\u003c/code\u003e if not specified.\u003c/p\u003e\n"],["\u003cp\u003eKey functionalities of EndpointContext include retrieving the client settings endpoint, mtls endpoint, resolved endpoint, service name, and the ability to switch to an mtls endpoint.\u003c/p\u003e\n"],["\u003cp\u003eEndpointContext also includes methods for validating the configured Universe Domain against the Credentials' Universe Domain and ensuring that the domains match.\u003c/p\u003e\n"]]],[],null,["# Class EndpointContext (2.69.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.69.0 (latest)](/java/docs/reference/gax/latest/com.google.api.gax.rpc.EndpointContext)\n- [2.68.2](/java/docs/reference/gax/2.68.2/com.google.api.gax.rpc.EndpointContext)\n- [2.67.0](/java/docs/reference/gax/2.67.0/com.google.api.gax.rpc.EndpointContext)\n- [2.66.0](/java/docs/reference/gax/2.66.0/com.google.api.gax.rpc.EndpointContext)\n- [2.65.0](/java/docs/reference/gax/2.65.0/com.google.api.gax.rpc.EndpointContext)\n- [2.63.1](/java/docs/reference/gax/2.63.1/com.google.api.gax.rpc.EndpointContext)\n- [2.62.0](/java/docs/reference/gax/2.62.0/com.google.api.gax.rpc.EndpointContext)\n- [2.61.0](/java/docs/reference/gax/2.61.0/com.google.api.gax.rpc.EndpointContext)\n- [2.60.0](/java/docs/reference/gax/2.60.0/com.google.api.gax.rpc.EndpointContext)\n- [2.59.1](/java/docs/reference/gax/2.59.1/com.google.api.gax.rpc.EndpointContext)\n- [2.58.0](/java/docs/reference/gax/2.58.0/com.google.api.gax.rpc.EndpointContext)\n- [2.57.0](/java/docs/reference/gax/2.57.0/com.google.api.gax.rpc.EndpointContext)\n- [2.55.0](/java/docs/reference/gax/2.55.0/com.google.api.gax.rpc.EndpointContext)\n- [2.54.1](/java/docs/reference/gax/2.54.1/com.google.api.gax.rpc.EndpointContext)\n- [2.53.0](/java/docs/reference/gax/2.53.0/com.google.api.gax.rpc.EndpointContext)\n- [2.52.0](/java/docs/reference/gax/2.52.0/com.google.api.gax.rpc.EndpointContext)\n- [2.51.0](/java/docs/reference/gax/2.51.0/com.google.api.gax.rpc.EndpointContext)\n- [2.50.0](/java/docs/reference/gax/2.50.0/com.google.api.gax.rpc.EndpointContext)\n- [2.49.0](/java/docs/reference/gax/2.49.0/com.google.api.gax.rpc.EndpointContext)\n- [2.48.1](/java/docs/reference/gax/2.48.1/com.google.api.gax.rpc.EndpointContext)\n- [2.47.0](/java/docs/reference/gax/2.47.0/com.google.api.gax.rpc.EndpointContext)\n- [2.46.1](/java/docs/reference/gax/2.46.1/com.google.api.gax.rpc.EndpointContext)\n- [2.45.0](/java/docs/reference/gax/2.45.0/com.google.api.gax.rpc.EndpointContext)\n- [2.43.0](/java/docs/reference/gax/2.43.0/com.google.api.gax.rpc.EndpointContext)\n- [2.42.0](/java/docs/reference/gax/2.42.0/com.google.api.gax.rpc.EndpointContext)\n- [2.41.0](/java/docs/reference/gax/2.41.0/com.google.api.gax.rpc.EndpointContext)\n- [2.39.0](/java/docs/reference/gax/2.39.0/com.google.api.gax.rpc.EndpointContext)\n- [2.38.0](/java/docs/reference/gax/2.38.0/com.google.api.gax.rpc.EndpointContext)\n- [2.37.0](/java/docs/reference/gax/2.37.0/com.google.api.gax.rpc.EndpointContext)\n- [2.36.0](/java/docs/reference/gax/2.36.0/com.google.api.gax.rpc.EndpointContext)\n- [2.35.0](/java/docs/reference/gax/2.35.0/com.google.api.gax.rpc.EndpointContext)\n- [2.34.1](/java/docs/reference/gax/2.34.1/com.google.api.gax.rpc.EndpointContext)\n- [2.33.0](/java/docs/reference/gax/2.33.0/com.google.api.gax.rpc.EndpointContext)\n- [2.32.1](/java/docs/reference/gax/2.32.1/com.google.api.gax.rpc.EndpointContext)\n- [2.31.1](/java/docs/reference/gax/2.31.1/com.google.api.gax.rpc.EndpointContext)\n- [2.30.1](/java/docs/reference/gax/2.30.1/com.google.api.gax.rpc.EndpointContext)\n- [2.24.0](/java/docs/reference/gax/2.24.0/com.google.api.gax.rpc.EndpointContext)\n- [2.23.3](/java/docs/reference/gax/2.23.3/com.google.api.gax.rpc.EndpointContext)\n- [2.22.0](/java/docs/reference/gax/2.22.0/com.google.api.gax.rpc.EndpointContext)\n- [2.21.0](/java/docs/reference/gax/2.21.0/com.google.api.gax.rpc.EndpointContext)\n- [2.20.1](/java/docs/reference/gax/2.20.1/com.google.api.gax.rpc.EndpointContext)\n- [2.19.6](/java/docs/reference/gax/2.19.6/com.google.api.gax.rpc.EndpointContext)\n- [2.18.7](/java/docs/reference/gax/2.18.7/com.google.api.gax.rpc.EndpointContext)\n- [2.17.0](/java/docs/reference/gax/2.17.0/com.google.api.gax.rpc.EndpointContext)\n- [2.16.0](/java/docs/reference/gax/2.16.0/com.google.api.gax.rpc.EndpointContext)\n- [2.15.0](/java/docs/reference/gax/2.15.0/com.google.api.gax.rpc.EndpointContext)\n- [2.14.0](/java/docs/reference/gax/2.14.0/com.google.api.gax.rpc.EndpointContext)\n- [2.13.0](/java/docs/reference/gax/2.13.0/com.google.api.gax.rpc.EndpointContext)\n- [2.12.2](/java/docs/reference/gax/2.12.2/com.google.api.gax.rpc.EndpointContext)\n- [2.11.0](/java/docs/reference/gax/2.11.0/com.google.api.gax.rpc.EndpointContext)\n- [2.10.0](/java/docs/reference/gax/2.10.0/com.google.api.gax.rpc.EndpointContext)\n- [2.9.0](/java/docs/reference/gax/2.9.0/com.google.api.gax.rpc.EndpointContext)\n- [2.8.1](/java/docs/reference/gax/2.8.1/com.google.api.gax.rpc.EndpointContext)\n- [2.7.1](/java/docs/reference/gax/2.7.1/com.google.api.gax.rpc.EndpointContext) \n\n public abstract class EndpointContext\n\nEndpointContext is an internal class used by the client library to resolve the endpoint. It is\ncreated once the library is initialized should not be updated manually.\n\nContains the fields required to resolve the endpoint and Universe Domain \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e EndpointContext \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Fields\n-------------\n\n### GOOGLE_CLOUD_UNIVERSE_DOMAIN\n\n public static final String GOOGLE_CLOUD_UNIVERSE_DOMAIN\n\n### INVALID_UNIVERSE_DOMAIN_ERROR_TEMPLATE\n\n public static final String INVALID_UNIVERSE_DOMAIN_ERROR_TEMPLATE\n\n### UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE\n\n public static final String UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE\n\nStatic Methods\n--------------\n\n### getDefaultInstance()\n\n public static EndpointContext getDefaultInstance()\n\n### newBuilder()\n\n public static EndpointContext.Builder newBuilder()\n\nConstructors\n------------\n\n### EndpointContext()\n\n public EndpointContext()\n\nMethods\n-------\n\n### clientSettingsEndpoint()\n\n public abstract String clientSettingsEndpoint()\n\nClientSettingsEndpoint is the endpoint value set via the ClientSettings/StubSettings classes.\n\n### mtlsEndpoint()\n\n public abstract String mtlsEndpoint()\n\n### mtlsProvider()\n\n public abstract MtlsProvider mtlsProvider()\n\n### resolvedEndpoint()\n\n public abstract String resolvedEndpoint()\n\n### serviceName()\n\n public abstract String serviceName()\n\nServiceName is host URI for Google Cloud Services. It follows the format of\n`{ServiceName}.googleapis.com`. For example, speech.googleapis.com would have a ServiceName of\nspeech and cloudasset.googleapis.com would have a ServiceName of cloudasset.\n\n### switchToMtlsEndpointAllowed()\n\n public abstract boolean switchToMtlsEndpointAllowed()\n\n### toBuilder()\n\n public abstract EndpointContext.Builder toBuilder()\n\n### transportChannelProviderEndpoint()\n\n public abstract String transportChannelProviderEndpoint()\n\nTransportChannelProviderEndpoint is the endpoint value set via the TransportChannelProvider\nclass.\n\n### universeDomain()\n\n public abstract String universeDomain()\n\nUniverse Domain is the domain for Google Cloud Services. It follows the format of\n`{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a Universe\nDomain value of `googleapis.com` and cloudasset.test.com would have a Universe Domain of\n`test.com`. If this value is not set, this will default to `googleapis.com`.\n\n### usingGDCH()\n\n public abstract boolean usingGDCH()\n\n### validateUniverseDomain(Credentials credentials, StatusCode invalidUniverseDomainStatusCode)\n\n public void validateUniverseDomain(Credentials credentials, StatusCode invalidUniverseDomainStatusCode)\n\nCheck that the User configured universe domain matches the Credentials' universe domain. The\nstatus code parameter is passed in to this method as it's a limitation of Gax's modules. The\ntransport-neutral module does have access the transport-specific modules (which contain the\nimplementation of the StatusCode). This method is scoped to be internal and should be not be\naccessed by users."]]