Package io.grpc.xds.internal
Class GoogleDefaultXdsCredentialsProvider
java.lang.Object
io.grpc.xds.XdsCredentialsProvider
io.grpc.xds.internal.GoogleDefaultXdsCredentialsProvider
A wrapper class that supports
GoogleDefaultChannelCredentials for
Xds by implementing XdsCredentialsProvider.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetName()Returns the xDS credential name associated with this provider which makes it selectable viaXdsCredentialsRegistry.getProvider(java.lang.String).booleanWhether this provider is available for use, taking the current environment into consideration.protected io.grpc.ChannelCredentialsnewChannelCredentials(Map<String, ?> jsonConfig) Creates aChannelCredentialsfrom the given jsonConfig, ornullif the given config is invalid.intpriority()A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.
-
Field Details
-
CREDS_NAME
- See Also:
-
-
Constructor Details
-
GoogleDefaultXdsCredentialsProvider
public GoogleDefaultXdsCredentialsProvider()
-
-
Method Details
-
newChannelCredentials
Description copied from class:XdsCredentialsProviderCreates aChannelCredentialsfrom the given jsonConfig, ornullif the given config is invalid. The provider is free to ignore the config if it's not needed for producing the channel credentials.- Specified by:
newChannelCredentialsin classXdsCredentialsProvider- Parameters:
jsonConfig- json config that can be consumed by the provider to create the channel credentials
-
getName
Description copied from class:XdsCredentialsProviderReturns the xDS credential name associated with this provider which makes it selectable viaXdsCredentialsRegistry.getProvider(java.lang.String). This is called only when the class is loaded. It shouldn't change, and there is no point doing so.- Specified by:
getNamein classXdsCredentialsProvider
-
isAvailable
public boolean isAvailable()Description copied from class:XdsCredentialsProviderWhether this provider is available for use, taking the current environment into consideration. Iffalse,XdsCredentialsProvider.newChannelCredentials(java.util.Map<java.lang.String, ?>)is not safe to be called.- Specified by:
isAvailablein classXdsCredentialsProvider
-
priority
public int priority()Description copied from class:XdsCredentialsProviderA priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line.- Specified by:
priorityin classXdsCredentialsProvider
-